Moved System.IO references from DMO classes to Static Helpers

Removed nugetSource from pipeline
Removed more comments
Created Static Classes for most DMO / Controller Classes
Push ConfigurationManager.AppSettings to controller
Align Tests with other Projects
This commit is contained in:
2024-12-11 09:29:01 -07:00
parent b1c6903c1c
commit b99b721458
86 changed files with 2961 additions and 4432 deletions

View File

@ -11,7 +11,6 @@ public class LoginModel {
[Display(Name = "Login ID")]
public string LoginID { get; set; }
//[Required]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }

View File

@ -7,37 +7,47 @@ namespace Fab2ApprovalSystem.Models;
public class AppSettings {
internal AppSettings(string adminNotificationRecepient,
string? apiBaseUrl,
string attachmentFolder,
string? attachmentUrl,
string caBlankFormsLocation,
string? company,
string dBConnection,
string dbConnectionString,
string ftpPassword,
string ftpServer,
string ftpUser,
string holdFlagDirectory,
string hostURL,
string ifxContainer,
string ifxDomain,
bool isInfineonDomain,
string lotTempPipeLine,
string mesaTemplateFiles,
string naContainer,
string naDomain,
string nDriveURL,
string notificationSender,
string senderEmail,
string? smtpServer,
string spnMRBHoldFlagFTPLogDirectory,
string testEmailRecipients,
string urls,
int userId,
bool userIsAdmin,
string wsrURL,
string? workingDirectoryName) {
public AppSettings(string adminNotificationRecepient,
string? apiBaseUrl,
string attachmentFolder,
string? attachmentUrl,
string caBlankFormsLocation,
string? company,
string dBConnection,
string dbConnectionString,
string emailTemplatesPath,
string ftpPassword,
string ftpSPNBatchFileName,
string ftpSPNBatchFileName_Test,
string ftpServer,
string ftpUser,
string holdFlagDirectory,
string hostURL,
string ifxContainer,
string ifxDomain,
bool isInfineonDomain,
string lotTempPipeLine,
string mesaTemplateFiles,
string nDriveURL,
string naContainer,
string naDomain,
string notificationSender,
string senderEmail,
string? smtpServer,
string spnMRBHoldFlagDirectory,
string spnMRBHoldFlagFTPLogDirectory,
string ssrSFolder,
string ssrSBindingsByConfiguration,
string ssrSBaseURL,
string ssrSDomain,
string ssrSUsername,
string ssrSPassword,
string testEmailRecipients,
string urls,
int userId,
bool userIsAdmin,
string wsr_URL,
string? workingDirectoryName) {
AdminNotificationRecepient = adminNotificationRecepient;
ApiBaseUrl = apiBaseUrl;
AttachmentFolder = attachmentFolder;
@ -46,7 +56,10 @@ public class AppSettings {
Company = company;
DBConnection = dBConnection;
DBConnectionString = dbConnectionString;
EmailTemplatesPath = emailTemplatesPath;
FTPPassword = ftpPassword;
FTPSPNBatchFileName = ftpSPNBatchFileName;
FTPSPNBatchFileName_Test = ftpSPNBatchFileName_Test;
FTPServer = ftpServer;
FTPUser = ftpUser;
HoldFlagDirectory = holdFlagDirectory;
@ -56,18 +69,25 @@ public class AppSettings {
IsInfineonDomain = isInfineonDomain;
LotTempPipeLine = lotTempPipeLine;
MesaTemplateFiles = mesaTemplateFiles;
NDriveURL = nDriveURL;
NAContainer = naContainer;
NADomain = naDomain;
NDriveURL = nDriveURL;
NotificationSender = notificationSender;
SenderEmail = senderEmail;
SMTPServer = smtpServer;
SPNMRBHoldFlagDirectory = spnMRBHoldFlagDirectory;
SPNMRBHoldFlagFTPLogDirectory = spnMRBHoldFlagFTPLogDirectory;
TestEmailRecipients = testEmailRecipients;
SSRSFolder = ssrSFolder;
SSRSBindingsByConfiguration = ssrSBindingsByConfiguration;
SSRSBaseURL = ssrSBaseURL;
SSRSDomain = ssrSDomain;
SSRSUsername = ssrSUsername;
SSRSPassword = ssrSPassword;
URLs = urls;
UserId = userId;
UserIsAdmin = userIsAdmin;
WSR_URL = wsrURL;
WSR_URL = wsr_URL;
WorkingDirectoryName = workingDirectoryName;
}
@ -79,7 +99,10 @@ public class AppSettings {
public string? Company { get; }
public string DBConnection { get; }
public string DBConnectionString { get; }
public string EmailTemplatesPath { get; }
public string FTPPassword { get; }
public string FTPSPNBatchFileName { get; }
public string FTPSPNBatchFileName_Test { get; }
public string FTPServer { get; }
public string FTPUser { get; }
public string HoldFlagDirectory { get; }
@ -95,7 +118,14 @@ public class AppSettings {
public string NotificationSender { get; }
public string SenderEmail { get; }
public string? SMTPServer { get; }
public string SPNMRBHoldFlagDirectory { get; }
public string SPNMRBHoldFlagFTPLogDirectory { get; }
public string SSRSFolder { get; }
public string SSRSBindingsByConfiguration { get; }
public string SSRSBaseURL { get; }
public string SSRSDomain { get; }
public string SSRSUsername { get; }
public string SSRSPassword { get; }
public string TestEmailRecipients { get; }
public string URLs { get; }
public int UserId { get; }
@ -131,59 +161,108 @@ public class AppSettings {
internal static AppSettings LoadConfigurationManager() {
AppSettings result;
int userId = 0;
string adminNotificationRecepient = ConfigurationManager.ConnectionStrings["Admin Notification Recepient"].ToString();
string attachmentFolder = ConfigurationManager.ConnectionStrings["AttachmentFolder"].ToString();
string ftpPassword = ConfigurationManager.ConnectionStrings["FTP Password"].ToString();
string ftpServer = ConfigurationManager.ConnectionStrings["FTP Server"].ToString();
string ftpUser = ConfigurationManager.ConnectionStrings["FTP User"].ToString();
string holdFlagDirectory = ConfigurationManager.ConnectionStrings["HoldFlagDirectory"].ToString();
string ifxContainer = ConfigurationManager.ConnectionStrings["IFXContainer"].ToString();
string ifxDomain = ConfigurationManager.ConnectionStrings["IFXDomain"].ToString();
string lotTempPipeLine = ConfigurationManager.ConnectionStrings["LotTempPipeLine"].ToString();
string naContainer = ConfigurationManager.ConnectionStrings["NAContainer"].ToString();
string naDomain = ConfigurationManager.ConnectionStrings["NADomain"].ToString();
string notificationSender = ConfigurationManager.ConnectionStrings["Notification Sender"].ToString();
string spnMRBHoldFlagFTPLogDirectory = ConfigurationManager.ConnectionStrings["SPNMRBHoldFlagFTPLogDirectory"].ToString();
string testEmailRecipients = ConfigurationManager.ConnectionStrings["Test Email Recipients"].ToString();
string? apiBaseUrl = ConfigurationManager.ConnectionStrings["FabApprovalApiBaseUrl"]?.ToString();
string? attachmentUrl = ConfigurationManager.ConnectionStrings["AttachmentUrl"]?.ToString();
string? company = ConfigurationManager.ConnectionStrings["Company"]?.ToString();
string? smtpServer = ConfigurationManager.ConnectionStrings["SMTP Server"]?.ToString();
string? urls = ConfigurationManager.ConnectionStrings["URLs"]?.ToString();
string? workingDirectoryName = ConfigurationManager.ConnectionStrings["WorkingDirectoryName"]?.ToString();
result = new(adminNotificationRecepient: adminNotificationRecepient,
apiBaseUrl: apiBaseUrl,
attachmentFolder: attachmentFolder,
attachmentUrl: attachmentUrl,
caBlankFormsLocation: Misc.GlobalVars.CA_BlankFormsLocation,
company: company,
dBConnection: Misc.GlobalVars.DBConnection,
dbConnectionString: Misc.GlobalVars.DB_CONNECTION_STRING,
ftpPassword: ftpPassword,
ftpServer: ftpServer,
ftpUser: ftpUser,
holdFlagDirectory: holdFlagDirectory,
hostURL: Misc.GlobalVars.hostURL,
ifxContainer: ifxContainer,
ifxDomain: ifxDomain,
isInfineonDomain: Misc.GlobalVars.IS_INFINEON_DOMAIN,
lotTempPipeLine: lotTempPipeLine,
mesaTemplateFiles: Misc.GlobalVars.MesaTemplateFiles,
naContainer: naContainer,
naDomain: naDomain,
nDriveURL: Misc.GlobalVars.NDriveURL,
notificationSender: notificationSender,
senderEmail: Misc.GlobalVars.SENDER_EMAIL,
smtpServer: smtpServer,
spnMRBHoldFlagFTPLogDirectory: spnMRBHoldFlagFTPLogDirectory,
testEmailRecipients: testEmailRecipients,
urls: urls,
userId: userId,
userIsAdmin: Misc.GlobalVars.USER_ISADMIN,
wsrURL: Misc.GlobalVars.WSR_URL,
workingDirectoryName: workingDirectoryName);
return result;
try {
int userId = 0;
string adminNotificationRecepient = ConfigurationManager.AppSettings["Admin Notification Recepient"] ??
throw new ArgumentNullException("Admin Notification Recepient environment variable not found");
string attachmentFolder = ConfigurationManager.AppSettings["AttachmentFolder"] ??
throw new ArgumentNullException("AttachmentFolder environment variable not found");
string emailTemplatesPath = ConfigurationManager.AppSettings["EmailTemplatesPath"] ??
throw new ArgumentNullException("EmailTemplatesPath environment variable not found");
string ftpPassword = ConfigurationManager.AppSettings["FTP Password"] ??
throw new ArgumentNullException("FTP Password environment variable not found");
string ftpServer = ConfigurationManager.AppSettings["FTP Server"] ??
throw new ArgumentNullException("FTP Server environment variable not found");
string ftpSPNBatchFileName = ConfigurationManager.AppSettings["FTPSPNBatchFileName"] ??
throw new ArgumentNullException("FTPSPNBatchFileName environment variable not found");
string ftpSPNBatchFileName_Test = ConfigurationManager.AppSettings["FTPSPNBatchFileName_Test"] ??
throw new ArgumentNullException("FTPSPNBatchFileName_Test environment variable not found");
string ftpUser = ConfigurationManager.AppSettings["FTP User"] ??
throw new ArgumentNullException("FTP User environment variable not found");
string holdFlagDirectory = ConfigurationManager.AppSettings["HoldFlagDirectory"] ??
throw new ArgumentNullException("HoldFlagDirectory environment variable not found");
string ifxContainer = ConfigurationManager.AppSettings["IFXContainer"] ??
throw new ArgumentNullException("IFXContainer environment variable not found");
string ifxDomain = ConfigurationManager.AppSettings["IFXDomain"] ??
throw new ArgumentNullException("IFXDomain environment variable not found");
string lotTempPipeLine = ConfigurationManager.AppSettings["LotTempPipeLine"] ??
throw new ArgumentNullException("LotTempPipeLine environment variable not found");
string naContainer = ConfigurationManager.AppSettings["NAContainer"] ??
throw new ArgumentNullException("NAContainer environment variable not found");
string naDomain = ConfigurationManager.AppSettings["NADomain"] ??
throw new ArgumentNullException("NADomain environment variable not found");
string notificationSender = ConfigurationManager.AppSettings["Notification Sender"] ??
throw new ArgumentNullException("Notification Sender environment variable not found");
string spnMRBHoldFlagDirectory = ConfigurationManager.AppSettings["SPNMRBHoldFlagDirectory"] ??
throw new ArgumentNullException("SPNMRBHoldFlagDirectory environment variable not found");
string spnMRBHoldFlagFTPLogDirectory = ConfigurationManager.AppSettings["SPNMRBHoldFlagFTPLogDirectory"] ??
throw new ArgumentNullException("SPNMRBHoldFlagFTPLogDirectory environment variable not found");
string ssrSFolder = ConfigurationManager.AppSettings["SSRSFolder"] ??
throw new ArgumentNullException("SSRSFolder environment variable not found");
string ssrSBindingsByConfiguration = ConfigurationManager.AppSettings["SSRSBindingsByConfiguration"] ??
throw new ArgumentNullException("SSRSBindingsByConfiguration environment variable not found");
string ssrSBaseURL = ConfigurationManager.AppSettings["SSRSBaseURL"] ??
throw new ArgumentNullException("SSRSBaseURL environment variable not found");
string ssrSDomain = ConfigurationManager.AppSettings["SSRSDomain"] ??
throw new ArgumentNullException("SSRSDomain environment variable not found");
string ssrSUsername = ConfigurationManager.AppSettings["SSRSUsername"] ??
throw new ArgumentNullException("SSRSUsername environment variable not found");
string ssrSPassword = ConfigurationManager.AppSettings["SSRSPassword"] ??
throw new ArgumentNullException("SSRSPassword environment variable not found");
string testEmailRecipients = ConfigurationManager.AppSettings["Test Email Recipients"] ??
throw new ArgumentNullException("Test Email Recipients environment variable not found");
string? apiBaseUrl = ConfigurationManager.AppSettings["FabApprovalApiBaseUrl"]?.ToString();
string? attachmentUrl = ConfigurationManager.AppSettings["AttachmentUrl"]?.ToString();
string? company = ConfigurationManager.AppSettings["Company"]?.ToString();
string? smtpServer = ConfigurationManager.AppSettings["SMTP Server"]?.ToString();
string? urls = ConfigurationManager.AppSettings["URLs"]?.ToString();
string? workingDirectoryName = ConfigurationManager.AppSettings["WorkingDirectoryName"]?.ToString();
result = new(adminNotificationRecepient: adminNotificationRecepient,
apiBaseUrl: apiBaseUrl,
attachmentFolder: attachmentFolder,
attachmentUrl: attachmentUrl,
caBlankFormsLocation: Misc.GlobalVars.CA_BlankFormsLocation,
company: company,
dBConnection: Misc.GlobalVars.DBConnection,
dbConnectionString: Misc.GlobalVars.DB_CONNECTION_STRING,
emailTemplatesPath: emailTemplatesPath,
ftpPassword: ftpPassword,
ftpServer: ftpServer,
ftpSPNBatchFileName: ftpSPNBatchFileName,
ftpSPNBatchFileName_Test: ftpSPNBatchFileName_Test,
ftpUser: ftpUser,
holdFlagDirectory: holdFlagDirectory,
hostURL: Misc.GlobalVars.hostURL,
ifxContainer: ifxContainer,
ifxDomain: ifxDomain,
isInfineonDomain: Misc.GlobalVars.IS_INFINEON_DOMAIN,
lotTempPipeLine: lotTempPipeLine,
mesaTemplateFiles: Misc.GlobalVars.MesaTemplateFiles,
naContainer: naContainer,
naDomain: naDomain,
nDriveURL: Misc.GlobalVars.NDriveURL,
notificationSender: notificationSender,
senderEmail: Misc.GlobalVars.SENDER_EMAIL,
smtpServer: smtpServer,
spnMRBHoldFlagDirectory: spnMRBHoldFlagDirectory,
spnMRBHoldFlagFTPLogDirectory: spnMRBHoldFlagFTPLogDirectory,
testEmailRecipients: testEmailRecipients,
ssrSFolder: ssrSFolder,
ssrSBindingsByConfiguration: ssrSBindingsByConfiguration,
ssrSBaseURL: ssrSBaseURL,
ssrSDomain: ssrSDomain,
ssrSUsername: ssrSUsername,
ssrSPassword: ssrSPassword,
urls: urls,
userId: userId,
userIsAdmin: Misc.GlobalVars.USER_ISADMIN,
wsr_URL: Misc.GlobalVars.WSR_URL,
workingDirectoryName: workingDirectoryName);
return result;
} catch (Exception ex) {
Misc.Functions.WriteEvent(null, "LoadConfigurationManager - \r\n" + ex.Message.ToString(), System.Diagnostics.EventLogEntryType.Error);
throw;
}
}
}

View File

@ -9,7 +9,6 @@ public class ApprovalLogHistory {
public string Operation { get; set; }
public string SubRole { get; set; }
//[Display(Name = "Operation Time")]
public DateTime OperationTime { get; set; }
public string Comments { get; set; }

View File

@ -70,8 +70,6 @@ public class Lot {
[Display(Name = "Lot Dispos")]
public string OtherLotDispos { get; set; }
//MRB Lot
//[CustomDispoTypeValidationAttribute(ErrorMessage = "The values can only either A or B or C or D")]
public char? DispoType { get; set; }
[Display(Name = "Lot Dispos")]
public string LotDispositionsLinkedToLot { get; set; }

View File

@ -33,7 +33,6 @@ public class ECN : object {
public bool IsEmergencyTECN { get; set; }
[DataType(DataType.Date)]
//[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
public DateTime? ExpirationDate { get; set; }
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
@ -147,7 +146,6 @@ public class ECN : object {
return false;
// Return true if the fields match:
//return (IsECN == p.IsECN) && (IsEmergencyTECN == p.IsEmergencyTECN);
}
}

View File

@ -12,10 +12,9 @@ namespace Fab2ApprovalSystem.Models;
[Serializable]
public class LotDisposition {
//[Editable(false)]
[Display(Name = "Issue Number")]
public int IssueID { get; set; }
//[Editable(false)]
public string Title { get; set; }
public bool PERequired { get; set; }
public string IssueDescription { get; set; }
@ -32,7 +31,7 @@ public class LotDisposition {
public byte CurrentStep { get; set; }
// Extra field Defined for Scraping wafer for a given lot
public Lot Lot { get; set; }
//Extra field defined for Attachments
// Extra field defined for Attachments
public Attachment DocumentAttachment { get; set; }
// important!!make sure the id of the control matches the name of the field in the model it is being binded to,
@ -58,7 +57,7 @@ public class LotDisposition {
DepartmentIDs = new List<int>();
Lot = new Lot();
DocumentAttachment = new Attachment();
//Lots = new List<Lot>();
// Lots = new List<Lot>();
Attachments = new List<Attachment>();
Approvals = new List<Approval>();
ScrapLots = new List<ScrapLot>();

View File

@ -63,9 +63,6 @@ public class MRB {
}
}
/// <summary>
///
/// </summary>
public MRB() {
PartGroupIDs = new List<int>();
ModuleIDs = new List<int>();
@ -106,7 +103,7 @@ public class Disposition {
public string DispositionName { get; set; }
public string DispositionNotes { get; set; }
//Duplicated as the CloseToQDBOptionID is being used in the dropdown in the Grid kept the old code
// Duplicated as the CloseToQDBOptionID is being used in the dropdown in the Grid kept the old code
public int CloseToQDBOption_ID { get; set; }
[UIHint("CloseToQDBTemplate")]
@ -151,7 +148,6 @@ public class ContainmentActionObj {
public int CurrentResponsibilityOwnerID { get; set; }
public string ResponsibilityOwner { get; set; }
//[DataType(DataType.Date)]
public DateTime? ECD { get; set; }
[DataType(DataType.Date)]

View File

@ -1,7 +1,6 @@
namespace Fab2ApprovalSystem.Models;
public class WinEventLog {
//[Key]
public int SysDocumentID { get; set; }
public int IssueID { get; set; }