Compare commits
	
		
			6 Commits
		
	
	
		
			b99b721458
			...
			feature-13
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| e020ec8c01 | |||
| e68a1a4c3b | |||
| 7ddda56987 | |||
| 77f45fabb1 | |||
| 1b22ffa439 | |||
| 123bbdb9fe | 
							
								
								
									
										12
									
								
								Fab2ApprovalMKLink/.vscode/mklink.md
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								Fab2ApprovalMKLink/.vscode/mklink.md
									
									
									
									
										vendored
									
									
								
							| @ -35,3 +35,15 @@ mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\PdfGenerator" "L | |||||||
| mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\Jobs" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\Jobs" | mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\Jobs" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\Jobs" | ||||||
| mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\JobSchedules" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\JobSchedules" | mklink /J "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalMKLink\JobSchedules" "L:\DevOps\Mesa_FI\MesaFabApproval\Fab2ApprovalSystem\JobSchedules" | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
|  | ```bash 1734015544321 = 638696123443210000 = Thu Dec 12 2024 07:59:03 GMT-0700 (Mountain Standard Time) | ||||||
|  | mklink /J ".vscode\.UserSecrets" "%AppData%\Microsoft\UserSecrets\f2da5035-aba9-4676-9f8d-d6689f84663d" | ||||||
|  | mklink /J "DMO" "..\Fab2ApprovalSystem\DMO" | ||||||
|  | mklink /J "Jobs" "..\Fab2ApprovalSystem\Jobs" | ||||||
|  | mklink /J "JobSchedules" "..\Fab2ApprovalSystem\JobSchedules" | ||||||
|  | mklink /J "Misc" "..\Fab2ApprovalSystem\Misc" | ||||||
|  | mklink /J "Models" "..\Fab2ApprovalSystem\Models" | ||||||
|  | mklink /J "PdfGenerator" "..\Fab2ApprovalSystem\PdfGenerator" | ||||||
|  | mklink /J "Utilities" "..\Fab2ApprovalSystem\Utilities" | ||||||
|  | mklink /J "ViewModels" "..\Fab2ApprovalSystem\ViewModels" | ||||||
|  | ``` | ||||||
|  | |||||||
| @ -1,18 +1,19 @@ | |||||||
|     /*vertical height between form-groups*/ | /*vertical height between form-groups*/ | ||||||
|     .my-form .form-group { | .my-form .form-group { | ||||||
|         margin-bottom: 4px; |     margin-bottom: 4px; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | @media (min-width:768px) { | ||||||
|  |     .my-form .row { | ||||||
|  |         margin-left: -1px; | ||||||
|  |         margin-right: -1px; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @media (min-width:768px) { |     .my-form [class*="col-"] { | ||||||
|         .my-form .row { |         padding: 0 2px; | ||||||
|             margin-left: -1px; |  | ||||||
|             margin-right: -1px; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         .my-form [class*="col-"] { |  | ||||||
|             padding: 0 2px; |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
|  | } | ||||||
|  |  | ||||||
| body { | body { | ||||||
|     padding-top: 50px; |     padding-top: 50px; | ||||||
|     padding-bottom: 20px; |     padding-bottom: 20px; | ||||||
| @ -29,12 +30,12 @@ body { | |||||||
| /*input, | /*input, | ||||||
| select | select | ||||||
| { | { | ||||||
|     max-width: 280px; | max-width: 280px; | ||||||
| }*/ | }*/ | ||||||
|  |  | ||||||
| .row{ | .row { | ||||||
|   margin-top: 2px; |     margin-top: 2px; | ||||||
|   margin-bottom: 2px |     margin-bottom: 2px | ||||||
| } | } | ||||||
|  |  | ||||||
| textarea { | textarea { | ||||||
| @ -68,28 +69,28 @@ input[type="checkbox"].input-validation-error { | |||||||
| } | } | ||||||
|  |  | ||||||
| .navbar-inner { | .navbar-inner { | ||||||
|   padding-left: 20px; |     padding-left: 20px; | ||||||
|   padding-right: 20px; |     padding-right: 20px; | ||||||
|   background-color: #87b3de; |     background-color: #87b3de; | ||||||
|   background-image: -moz-linear-gradient(top,#87b3de, #4d79a5); |     background-image: -moz-linear-gradient(top, #87b3de, #4d79a5); | ||||||
|   background-image: -ms-linear-gradient(top,#87b3de, #4d79a5); |     background-image: -ms-linear-gradient(top, #87b3de, #4d79a5); | ||||||
|   background-image: -webkit-gradient(linear, 0 0, 0 50%, from( #87b3de), to(#4d79a5)); |     background-image: -webkit-gradient(linear, 0 0, 0 50%, from(#87b3de), to(#4d79a5)); | ||||||
|   background-image: -webkit-linear-gradient(top,#87b3de, #4d79a5); |     background-image: -webkit-linear-gradient(top, #87b3de, #4d79a5); | ||||||
|   background-image: -o-linear-gradient(top, #87b3de, #4d79a5); |     background-image: -o-linear-gradient(top, #87b3de, #4d79a5); | ||||||
|   background-image: linear-gradient(top, #87b3de, #4d79a5); |     background-image: linear-gradient(top, #87b3de, #4d79a5); | ||||||
|   background-repeat: repeat-x; |     background-repeat: repeat-x; | ||||||
|   filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#87b3de', endColorstr='#4d79a5', GradientType=0); |     filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#87b3de', endColorstr='#4d79a5', GradientType=0); | ||||||
|   -webkit-border-radius: 4px; |     -webkit-border-radius: 4px; | ||||||
|   -moz-border-radius: 4px; |     -moz-border-radius: 4px; | ||||||
|   border-radius: 4px; |     border-radius: 4px; | ||||||
|   -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); |     -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); | ||||||
|   -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); |     -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); | ||||||
|   box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); |     box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); | ||||||
| } | } | ||||||
|  |  | ||||||
| .label-color { | .label-color { | ||||||
|         background-color: #e5e0e0; |     background-color: #e5e0e0; | ||||||
|     } | } | ||||||
|  |  | ||||||
| .linkbutton { | .linkbutton { | ||||||
|     display: inline-block; |     display: inline-block; | ||||||
| @ -101,6 +102,17 @@ input[type="checkbox"].input-validation-error { | |||||||
|     border: 0; |     border: 0; | ||||||
|     vertical-align: middle; |     vertical-align: middle; | ||||||
| } | } | ||||||
|  |  | ||||||
| .linkbutton.edit { | .linkbutton.edit { | ||||||
|     background: url('/Content/icons/edit.gif'); |     background: url('/Content/icons/edit.gif'); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | .modal-dialog { | ||||||
|  |     margin-top: 80px; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .affix { | ||||||
|  |   position: fixed; | ||||||
|  |   top: 55px; | ||||||
|  |   left: 25px; | ||||||
|  | } | ||||||
| @ -24,12 +24,9 @@ namespace Fab2ApprovalSystem.Controllers; | |||||||
|  |  | ||||||
| [Authorize] | [Authorize] | ||||||
| public class AccountController : Controller { | public class AccountController : Controller { | ||||||
|     private string _apiBaseUrl; |  | ||||||
|  |  | ||||||
|     public AccountController() |     public AccountController() | ||||||
|         : this(new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()))) { |         : this(new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()))) { | ||||||
|         _apiBaseUrl = Environment.GetEnvironmentVariable("FabApprovalApiBaseUrl") ?? |  | ||||||
|             throw new ArgumentNullException("FabApprovalApiBaseUrl environment variable not found"); |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public AccountController(UserManager<ApplicationUser> userManager) { |     public AccountController(UserManager<ApplicationUser> userManager) { | ||||||
| @ -69,7 +66,7 @@ public class AccountController : Controller { | |||||||
|             bool isLoginValid; |             bool isLoginValid; | ||||||
|  |  | ||||||
|             HttpClient httpClient = HttpClientFactory.Create(); |             HttpClient httpClient = HttpClientFactory.Create(); | ||||||
|             httpClient.BaseAddress = new Uri(_apiBaseUrl); |             httpClient.BaseAddress = new Uri(GlobalVars.AppSettings.ApiBaseUrl); | ||||||
|  |  | ||||||
|             LoginResult loginResult = await AccountDMO.LoginAsync(httpClient, model); |             LoginResult loginResult = await AccountDMO.LoginAsync(httpClient, model); | ||||||
|  |  | ||||||
| @ -121,7 +118,7 @@ public class AccountController : Controller { | |||||||
|             bool isLoginValid; |             bool isLoginValid; | ||||||
|  |  | ||||||
|             HttpClient httpClient = HttpClientFactory.Create(); |             HttpClient httpClient = HttpClientFactory.Create(); | ||||||
|             httpClient.BaseAddress = new Uri(_apiBaseUrl); |             httpClient.BaseAddress = new Uri(GlobalVars.AppSettings.ApiBaseUrl); | ||||||
|  |  | ||||||
|             LoginResult loginResult = await AccountDMO.ExternalAuthSetupAsync(httpClient, authAttempt); |             LoginResult loginResult = await AccountDMO.ExternalAuthSetupAsync(httpClient, authAttempt); | ||||||
|  |  | ||||||
|  | |||||||
| @ -48,60 +48,23 @@ public class ChangeControlController : Controller { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     public ActionResult Edit(int issueID) { |     public ActionResult Edit(int issueID) { | ||||||
|         int isITARCompliant = 1; |         string jwt = Session["JWT"].ToString(); | ||||||
|         ChangeControlViewModel cc = new ChangeControlViewModel(); |         string encodedJwt = System.Net.WebUtility.UrlEncode(jwt); | ||||||
|         cc = ccDMO.GetChangeControlRead(issueID, out isITARCompliant, (int)Session[GlobalVars.SESSION_USERID]); |         string refreshToken = Session["RefreshToken"].ToString(); | ||||||
|  |         string encodedRefreshToken = System.Net.WebUtility.UrlEncode(refreshToken); | ||||||
|  |         string mrbUrl = $"{GlobalVars.AppSettings.WasmClientUrl}/redirect?jwt={encodedJwt}&refreshToken={encodedRefreshToken}&redirectPath=/pcrb/{issueID}"; | ||||||
|  |  | ||||||
|         List<ApproversListViewModel> userList = MiscDMO.GetApproversListByDocument(cc.PlanNumber, cc.CurrentStep, (int)GlobalVars.DocumentType.ChangeControl); |         return Redirect(mrbUrl); | ||||||
|         ApproversListViewModel appUser = userList.Find(delegate (ApproversListViewModel al) { return al.UserID == (int)Session[GlobalVars.SESSION_USERID]; }); |  | ||||||
|         if (appUser != null) { |  | ||||||
|             ViewBag.IsApprover = "true"; |  | ||||||
|         } |  | ||||||
|         // TODO locked functionality |  | ||||||
|  |  | ||||||
|         if (isITARCompliant == 0) // not ITAR Compliant |  | ||||||
|         { |  | ||||||
|             return View("UnAuthorizedAccess"); |  | ||||||
|         } else { |  | ||||||
|             if ((int)Session[GlobalVars.SESSION_USERID] == cc.OwnerID) |  | ||||||
|                 ViewBag.IsOriginator = "true"; |  | ||||||
|             else |  | ||||||
|                 ViewBag.IsOriginator = "false"; |  | ||||||
|  |  | ||||||
|             if ((cc.RecordLockIndicator && cc.RecordLockedBy != (int)Session[GlobalVars.SESSION_USERID]) || |  | ||||||
|                 cc.ClosedDate != null) { |  | ||||||
|                 return RedirectToAction("ReadOnlyCC", new { issueID = issueID }); |  | ||||||
|             } else { |  | ||||||
|                 cc = ccDMO.GetChangeControl(issueID, out isITARCompliant, (int)Session[GlobalVars.SESSION_USERID]); |  | ||||||
|                 ViewBag.Attendees = ccDMO.GetUsers(); |  | ||||||
|                 ViewBag.Generations = ccDMO.GetGenerations(); |  | ||||||
|                 ViewBag.PartNumbers = ccDMO.GetPartNumbers(); |  | ||||||
|                 ViewBag.Processes = ccDMO.GetProcesses(); |  | ||||||
|                 ViewBag.Logistics = ccDMO.GetLogistics(); |  | ||||||
|                 ViewBag.AIResponsibles = ccDMO.GetActionItemResponsible(); |  | ||||||
|                 ViewBag.Sites = ccDMO.GetSites(); |  | ||||||
|                 return View(cc); |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public ActionResult ReadOnlyCC(int issueID) { |     public ActionResult ReadOnlyCC(int issueID) { | ||||||
|         int isITARCompliant = 1; |         string jwt = Session["JWT"].ToString(); | ||||||
|         ChangeControlViewModel cc = new ChangeControlViewModel(); |         string encodedJwt = System.Net.WebUtility.UrlEncode(jwt); | ||||||
|         cc = ccDMO.GetChangeControlRead(issueID, out isITARCompliant, (int)Session[GlobalVars.SESSION_USERID]); |         string refreshToken = Session["RefreshToken"].ToString(); | ||||||
|         // TODO locked functionality |         string encodedRefreshToken = System.Net.WebUtility.UrlEncode(refreshToken); | ||||||
|  |         string mrbUrl = $"{GlobalVars.AppSettings.WasmClientUrl}/redirect?jwt={encodedJwt}&refreshToken={encodedRefreshToken}&redirectPath=/pcrb/{issueID}"; | ||||||
|  |  | ||||||
|         if (isITARCompliant == 0) // not ITAR Compliant |         return Redirect(mrbUrl); | ||||||
|         { |  | ||||||
|             return View("UnAuthorizedAccess"); |  | ||||||
|         } else { |  | ||||||
|             ViewBag.MeetingList = ccDMO.GetMeetingList(issueID); |  | ||||||
|             ViewBag.Generations = ccDMO.GetGenerations(); |  | ||||||
|             ViewBag.PartNumbers = ccDMO.GetPartNumbers(); |  | ||||||
|             ViewBag.Processes = ccDMO.GetProcesses(); |  | ||||||
|             ViewBag.Logistics = ccDMO.GetLogistics(); |  | ||||||
|             return View(cc); |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     [HttpPost] |     [HttpPost] | ||||||
|  | |||||||
| @ -601,7 +601,7 @@ public class ECNController : PdfViewController { | |||||||
|         try { |         try { | ||||||
|             string emailSentList = ""; |             string emailSentList = ""; | ||||||
|             ECN ecn = ecnDMO.GetECN(ecnNumber); |             ECN ecn = ecnDMO.GetECN(ecnNumber); | ||||||
|                 emailSentList = ECNHelper.NotifySubmitter(_AppSettings, ecnNumber, ecnTypeString, ecn); |             emailSentList = ECNHelper.NotifySubmitter(_AppSettings, ecnNumber, ecnTypeString, ecn); | ||||||
|             try { |             try { | ||||||
|                 EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = ecnTypeString, OperationType = "Email", Comments = "Approvers for Step " + ":" + emailSentList }); |                 EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = ecnTypeString, OperationType = "Email", Comments = "Approvers for Step " + ":" + emailSentList }); | ||||||
|             } catch { } |             } catch { } | ||||||
| @ -625,7 +625,7 @@ public class ECNController : PdfViewController { | |||||||
|             ECN ecn = ecnDMO.GetECN(ecnNumber); |             ECN ecn = ecnDMO.GetECN(ecnNumber); | ||||||
|             IEnumerable<int> ecnAdminIDs = MiscDMO.GetUserIDsBySubRoleID(383); |             IEnumerable<int> ecnAdminIDs = MiscDMO.GetUserIDsBySubRoleID(383); | ||||||
|             foreach (int id in ecnAdminIDs) { |             foreach (int id in ecnAdminIDs) { | ||||||
|                         emailSentList = ECNHelper.NotifyAdmin(_AppSettings, ecnNumber, ecnTypeString, ecn, id); |                 emailSentList = ECNHelper.NotifyAdmin(_AppSettings, ecnNumber, ecnTypeString, ecn, id); | ||||||
|                 try { |                 try { | ||||||
|                     EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = ecnTypeString, OperationType = "Email", Comments = "Approvers for Step " + ":" + emailSentList }); |                     EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = ecnTypeString, OperationType = "Email", Comments = "Approvers for Step " + ":" + emailSentList }); | ||||||
|                 } catch { } |                 } catch { } | ||||||
| @ -650,7 +650,7 @@ public class ECNController : PdfViewController { | |||||||
|             string emailSentList = ""; |             string emailSentList = ""; | ||||||
|             ECN ecn = ecnDMO.GetECN(ecnNumber); |             ECN ecn = ecnDMO.GetECN(ecnNumber); | ||||||
|             List<string> emailIst = MiscDMO.GetApproverEmailListByDocument(@ecnNumber, currentStep, documentType).Distinct().ToList(); |             List<string> emailIst = MiscDMO.GetApproverEmailListByDocument(@ecnNumber, currentStep, documentType).Distinct().ToList(); | ||||||
|                 emailSentList = ECNHelper.NotifyApprovers(_AppSettings, ecnNumber, ecnTypeString, emailSentList, ecn, emailIst); |             emailSentList = ECNHelper.NotifyApprovers(_AppSettings, ecnNumber, ecnTypeString, emailSentList, ecn, emailIst); | ||||||
|             try { |             try { | ||||||
|                 EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = ecnTypeString, OperationType = "Email", Comments = "Approvers for Step " + currentStep.ToString() + ":" + emailSentList }); |                 EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = ecnTypeString, OperationType = "Email", Comments = "Approvers for Step " + currentStep.ToString() + ":" + emailSentList }); | ||||||
|             } catch { } |             } catch { } | ||||||
| @ -953,8 +953,7 @@ public class ECNController : PdfViewController { | |||||||
|         } catch { } |         } catch { } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public void NotifyApproversForCancellation(int ecnNumber, byte currentStep, int documentType, string ecnTypeString) { |     public void NotifyApproversForCancellation(int ecnNumber, ECN ecn, byte currentStep, int documentType, string ecnTypeString) { | ||||||
|         ECN ecn = ecnDMO.GetECN(ecnNumber); |  | ||||||
|         string emailSentList = ECNHelper.NotifyApproversForCancellation(_AppSettings, ecnNumber, currentStep, documentType, ecnTypeString, ecn); |         string emailSentList = ECNHelper.NotifyApproversForCancellation(_AppSettings, ecnNumber, currentStep, documentType, ecnTypeString, ecn); | ||||||
|         try { |         try { | ||||||
|             EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = ecnTypeString, OperationType = "Email", Comments = "Approvers for Step " + currentStep.ToString() + ":" + emailSentList }); |             EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = ecnTypeString, OperationType = "Email", Comments = "Approvers for Step " + currentStep.ToString() + ":" + emailSentList }); | ||||||
| @ -977,10 +976,10 @@ public class ECNController : PdfViewController { | |||||||
|         } catch { } |         } catch { } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public void NotifyTECNCancellation(int ecnNumber, string ecnFolderPath) { |     public void NotifyTECNCancellation(int ecnNumber, string ecnFolderPath, string comments) { | ||||||
|         ECN ecn = ecnDMO.GetECN(ecnNumber); |         ECN ecn = ecnDMO.GetECN(ecnNumber); | ||||||
|         List<int> notificationUserList = ecnDMO.GetTECNNotificationUsers().ToList(); |         List<int> notificationUserList = ecnDMO.GetTECNNotificationUsers().ToList(); | ||||||
|         string emailSentList = ECNHelper.NotifyTECNCancellation(_AppSettings, userDMO, ecnNumber, ecnFolderPath, ecn, notificationUserList); |         string emailSentList = ECNHelper.NotifyTECNCancellation(_AppSettings, userDMO, ecnNumber, ecnFolderPath, comments, ecn, notificationUserList); | ||||||
|         try { |         try { | ||||||
|             EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = "E-TECN", OperationType = "Email", Comments = "Approvers for Cancellation :" + emailSentList }); |             EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = "E-TECN", OperationType = "Email", Comments = "Approvers for Cancellation :" + emailSentList }); | ||||||
|         } catch { } |         } catch { } | ||||||
| @ -1157,22 +1156,24 @@ public class ECNController : PdfViewController { | |||||||
|         return Content(ecnDMO.PCRBExists(pcrb).ToString()); |         return Content(ecnDMO.PCRBExists(pcrb).ToString()); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public ActionResult CancelDocument(int ecnNumber, byte currentStep, int documentType, string ecnTypeString) { |     public ActionResult CancelDocument(int ecnNumber, byte currentStep, int documentType, string ecnTypeString, string comments = "") { | ||||||
|  |         ECN ecn = ecnDMO.GetECN(ecnNumber); | ||||||
|         bool lastApproverAndLastStep = false; |         bool lastApproverAndLastStep = false; | ||||||
|  |         if (ecn.IsTECN && ecn.SubmitedDate is not null && currentStep >= 1) | ||||||
|  |             Approve(ecnNumber, currentStep, comments, documentType, ecnTypeString); | ||||||
|         int appoverCount = ecnDMO.SubmitForCancellation(ecnNumber, (byte)GlobalVars.WorkFLowStepNumber.Step1, (int)Session[GlobalVars.SESSION_USERID], documentType, ecnTypeString, (int)GlobalVars.TECNExpirationCancellation.Cancellation); |         int appoverCount = ecnDMO.SubmitForCancellation(ecnNumber, (byte)GlobalVars.WorkFLowStepNumber.Step1, (int)Session[GlobalVars.SESSION_USERID], documentType, ecnTypeString, (int)GlobalVars.TECNExpirationCancellation.Cancellation); | ||||||
|         if (appoverCount > 0) { |         if (appoverCount > 0) { | ||||||
|             NotifyApproversForCancellation(ecnNumber, currentStep, documentType, ecnTypeString); |             NotifyApproversForCancellation(ecnNumber, ecn, currentStep, documentType, ecnTypeString); | ||||||
|         } else // TODO Automatically close the |         } else { // TODO Automatically close the | ||||||
|           { |             lastApproverAndLastStep = ApproveCancellation(ecnNumber, currentStep, comments, documentType, ecnTypeString); | ||||||
|             lastApproverAndLastStep = ApproveCancellation(ecnNumber, currentStep, "", documentType, ecnTypeString); |  | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         if (!lastApproverAndLastStep) { |         if (!lastApproverAndLastStep) { | ||||||
|             try { |             try { | ||||||
|                 lastApproverAndLastStep = true; |                 lastApproverAndLastStep = true; | ||||||
|  |  | ||||||
|                 ECNPdf ecn = new ECNPdf(); |                 ECNPdf ecnPDF = new ECNPdf(); | ||||||
|                 GenerateECNPdf(ecnNumber, out ecn); |                 GenerateECNPdf(ecnNumber, out ecnPDF); | ||||||
|  |  | ||||||
|                 string sourceDirectory = _AppSettings.AttachmentFolder + "ECN\\" + ecnNumber.ToString() + "\\"; |                 string sourceDirectory = _AppSettings.AttachmentFolder + "ECN\\" + ecnNumber.ToString() + "\\"; | ||||||
|                 string outputFullFilePath = ""; |                 string outputFullFilePath = ""; | ||||||
| @ -1184,7 +1185,7 @@ public class ECNController : PdfViewController { | |||||||
|  |  | ||||||
|                 Zipper zip = new Zipper(); |                 Zipper zip = new Zipper(); | ||||||
|                 zip.CreateZip(outputFullFilePath, sourceDirectory); |                 zip.CreateZip(outputFullFilePath, sourceDirectory); | ||||||
|                 NotifyTECNCancellation(ecnNumber, outputFullFilePath); |                 NotifyTECNCancellation(ecnNumber, outputFullFilePath, comments); | ||||||
|  |  | ||||||
|             } catch (Exception ex) { |             } catch (Exception ex) { | ||||||
|                 EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = "TECN", OperationType = "Error", Comments = ex.Message }); |                 EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = "TECN", OperationType = "Error", Comments = ex.Message }); | ||||||
| @ -1208,19 +1209,20 @@ public class ECNController : PdfViewController { | |||||||
|     public bool ApproveCancellation(int ecnNumber, byte currentStep, string comments, int documentType, string ecnTypeString) { |     public bool ApproveCancellation(int ecnNumber, byte currentStep, string comments, int documentType, string ecnTypeString) { | ||||||
|         bool lastApproverAndLastStep = false; |         bool lastApproverAndLastStep = false; | ||||||
|         bool lastStep = false; |         bool lastStep = false; | ||||||
|  |         ECN ecn = ecnDMO.GetECN(ecnNumber); | ||||||
|         bool lastApprover = ecnDMO.ECNApproveCancelled_ExpiredDocument(ecnNumber, currentStep, comments, out lastStep, (int)Session[GlobalVars.SESSION_USERID], documentType); |         bool lastApprover = ecnDMO.ECNApproveCancelled_ExpiredDocument(ecnNumber, currentStep, comments, out lastStep, (int)Session[GlobalVars.SESSION_USERID], documentType); | ||||||
|         while (lastApprover && !lastStep) { |         while (lastApprover && !lastStep) { | ||||||
|             currentStep++; |             currentStep++; | ||||||
|             lastApprover = ecnDMO.ECNApproveCancelled_ExpiredDocument(ecnNumber, currentStep, comments, out lastStep, (int)Session[GlobalVars.SESSION_USERID], documentType); |             lastApprover = ecnDMO.ECNApproveCancelled_ExpiredDocument(ecnNumber, currentStep, comments, out lastStep, (int)Session[GlobalVars.SESSION_USERID], documentType); | ||||||
|             NotifyApproversForCancellation(ecnNumber, currentStep, documentType, ecnTypeString); |             NotifyApproversForCancellation(ecnNumber, ecn, currentStep, documentType, ecnTypeString); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         if (lastApprover && lastStep) { |         if (lastApprover && lastStep) { | ||||||
|             try { |             try { | ||||||
|                 lastApproverAndLastStep = true; |                 lastApproverAndLastStep = true; | ||||||
|  |  | ||||||
|                 ECNPdf ecn = new ECNPdf(); |                 ECNPdf ecnPDF = new ECNPdf(); | ||||||
|                 GenerateECNPdf(ecnNumber, out ecn); |                 GenerateECNPdf(ecnNumber, out ecnPDF); | ||||||
|  |  | ||||||
|                 string sourceDirectory = _AppSettings.AttachmentFolder + "ECN\\" + ecnNumber.ToString() + "\\"; |                 string sourceDirectory = _AppSettings.AttachmentFolder + "ECN\\" + ecnNumber.ToString() + "\\"; | ||||||
|                 string outputFullFilePath = ""; |                 string outputFullFilePath = ""; | ||||||
| @ -1232,7 +1234,7 @@ public class ECNController : PdfViewController { | |||||||
|  |  | ||||||
|                 Zipper zip = new Zipper(); |                 Zipper zip = new Zipper(); | ||||||
|                 zip.CreateZip(outputFullFilePath, sourceDirectory); |                 zip.CreateZip(outputFullFilePath, sourceDirectory); | ||||||
|                 NotifyTECNCancellation(ecnNumber, outputFullFilePath); |                 NotifyTECNCancellation(ecnNumber, outputFullFilePath, comments); | ||||||
|  |  | ||||||
|             } catch (Exception ex) { |             } catch (Exception ex) { | ||||||
|                 EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = "TECN", OperationType = "Error", Comments = ex.Message }); |                 EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = "TECN", OperationType = "Error", Comments = ex.Message }); | ||||||
|  | |||||||
| @ -79,9 +79,7 @@ public class MRBController : Controller { | |||||||
|         string encodedJwt = System.Net.WebUtility.UrlEncode(jwt); |         string encodedJwt = System.Net.WebUtility.UrlEncode(jwt); | ||||||
|         string refreshToken = Session["RefreshToken"].ToString(); |         string refreshToken = Session["RefreshToken"].ToString(); | ||||||
|         string encodedRefreshToken = System.Net.WebUtility.UrlEncode(refreshToken); |         string encodedRefreshToken = System.Net.WebUtility.UrlEncode(refreshToken); | ||||||
|         string wasmClientUrl = Environment.GetEnvironmentVariable("FabApprovalWasmClientUrl") ?? |         string mrbUrl = $"{GlobalVars.AppSettings.WasmClientUrl}/redirect?jwt={encodedJwt}&refreshToken={encodedRefreshToken}&redirectPath=/mrb/{issueID}"; | ||||||
|             "https://localhost:7255"; |  | ||||||
|         string mrbUrl = $"{wasmClientUrl}/redirect?jwt={encodedJwt}&refreshToken={encodedRefreshToken}&redirectPath=/mrb/{issueID}"; |  | ||||||
|  |  | ||||||
|         return Redirect(mrbUrl); |         return Redirect(mrbUrl); | ||||||
|     } |     } | ||||||
| @ -104,9 +102,7 @@ public class MRBController : Controller { | |||||||
|         string encodedJwt = System.Net.WebUtility.UrlEncode(jwt); |         string encodedJwt = System.Net.WebUtility.UrlEncode(jwt); | ||||||
|         string refreshToken = Session["RefreshToken"].ToString(); |         string refreshToken = Session["RefreshToken"].ToString(); | ||||||
|         string encodedRefreshToken = System.Net.WebUtility.UrlEncode(refreshToken); |         string encodedRefreshToken = System.Net.WebUtility.UrlEncode(refreshToken); | ||||||
|         string wasmClientUrl = Environment.GetEnvironmentVariable("FabApprovalWasmClientUrl") ?? |         string mrbUrl = $"{GlobalVars.AppSettings.WasmClientUrl}/redirect?jwt={encodedJwt}&refreshToken={encodedRefreshToken}&redirectPath=/mrb/{issueID}"; | ||||||
|             "https://localhost:7255"; |  | ||||||
|         string mrbUrl = $"{wasmClientUrl}/redirect?jwt={encodedJwt}&refreshToken={encodedRefreshToken}&redirectPath=/mrb/{issueID}"; |  | ||||||
|  |  | ||||||
|         return Redirect(mrbUrl); |         return Redirect(mrbUrl); | ||||||
|     } |     } | ||||||
|  | |||||||
							
								
								
									
										20
									
								
								Fab2ApprovalSystem/Controllers/PCRBController.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								Fab2ApprovalSystem/Controllers/PCRBController.cs
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,20 @@ | |||||||
|  | using System; | ||||||
|  | using System.Web.Mvc; | ||||||
|  |  | ||||||
|  | using Fab2ApprovalSystem.Misc; | ||||||
|  |  | ||||||
|  | namespace Fab2ApprovalSystem.Controllers; | ||||||
|  |  | ||||||
|  | [Authorize] | ||||||
|  | [SessionExpireFilter] | ||||||
|  | public class PCRBController : Controller { | ||||||
|  |     public ActionResult Edit(int issueID) { | ||||||
|  |         string jwt = Session["JWT"].ToString(); | ||||||
|  |         string encodedJwt = System.Net.WebUtility.UrlEncode(jwt); | ||||||
|  |         string refreshToken = Session["RefreshToken"].ToString(); | ||||||
|  |         string encodedRefreshToken = System.Net.WebUtility.UrlEncode(refreshToken); | ||||||
|  |         string mrbUrl = $"{GlobalVars.AppSettings.WasmClientUrl}/redirect?jwt={encodedJwt}&refreshToken={encodedRefreshToken}&redirectPath=/pcrb/{issueID}"; | ||||||
|  |  | ||||||
|  |         return Redirect(mrbUrl); | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -90,6 +90,7 @@ public class CorrectiveActionDMO { | |||||||
|                 parameters.Add("@EscapePoint", model.EscapePoint); |                 parameters.Add("@EscapePoint", model.EscapePoint); | ||||||
|                 parameters.Add("@FollowUpDate", model.FollowUpDate); |                 parameters.Add("@FollowUpDate", model.FollowUpDate); | ||||||
|                 parameters.Add("@CASubmitted", model.CASubmitted); |                 parameters.Add("@CASubmitted", model.CASubmitted); | ||||||
|  |                 parameters.Add("@CAStandardType", model.CAStandardType); | ||||||
|  |  | ||||||
|                 db.Execute("_8DUpdateCorrectiveAction", parameters, commandType: CommandType.StoredProcedure); |                 db.Execute("_8DUpdateCorrectiveAction", parameters, commandType: CommandType.StoredProcedure); | ||||||
|                 EventLogDMO.Add(new WinEventLog { UserID = "System", Comments = "Saved Corrective Action", DocumentType = "9", IssueID = model.CANo, OperationType = "Status", SysDocumentID = 1 }); |                 EventLogDMO.Add(new WinEventLog { UserID = "System", Comments = "Saved Corrective Action", DocumentType = "9", IssueID = model.CANo, OperationType = "Status", SysDocumentID = 1 }); | ||||||
|  | |||||||
| @ -15,6 +15,7 @@ using Fab2ApprovalSystem.ViewModels; | |||||||
| namespace Fab2ApprovalSystem.DMO; | namespace Fab2ApprovalSystem.DMO; | ||||||
|  |  | ||||||
| public class ECN_DMO { | public class ECN_DMO { | ||||||
|  |  | ||||||
|     private readonly IDbConnection db = new SqlConnection(GlobalVars.DB_CONNECTION_STRING); |     private readonly IDbConnection db = new SqlConnection(GlobalVars.DB_CONNECTION_STRING); | ||||||
|     private readonly WorkflowDMO wfDMO = new(); |     private readonly WorkflowDMO wfDMO = new(); | ||||||
|  |  | ||||||
| @ -367,7 +368,7 @@ public class ECN_DMO { | |||||||
|         return ecnItem; |         return ecnItem; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     internal ECN GetECN(int ecnNumber) { |     public ECN GetECN(int ecnNumber) { | ||||||
|         ECN ecnItem = new(); |         ECN ecnItem = new(); | ||||||
|         DynamicParameters parameters = new(); |         DynamicParameters parameters = new(); | ||||||
|         parameters.Add("@ECNNumber", value: ecnNumber); |         parameters.Add("@ECNNumber", value: ecnNumber); | ||||||
|  | |||||||
| @ -6,6 +6,8 @@ Please review the cancelled TECN form in the attachment. | |||||||
| <br/><br/> | <br/><br/> | ||||||
| https://messa016ec.infineon.com/ECN/Edit?issueID={1} | https://messa016ec.infineon.com/ECN/Edit?issueID={1} | ||||||
| <br/><br/> | <br/><br/> | ||||||
|  | Comments: {5} | ||||||
|  | <br/><br/> | ||||||
|  |  | ||||||
| If you have any questions or trouble logging on please contact a site administrator. | If you have any questions or trouble logging on please contact a site administrator. | ||||||
| <br/><br/> | <br/><br/> | ||||||
|  | |||||||
							
								
								
									
										17
									
								
								Fab2ApprovalSystem/EmailTemplates/TECNReturnedToProcess.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								Fab2ApprovalSystem/EmailTemplates/TECNReturnedToProcess.txt
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,17 @@ | |||||||
|  | <font size="2" face="verdana"> | ||||||
|  | *****Please DO NOT reply to this email*****  | ||||||
|  | <br/><br/> | ||||||
|  | {3}# {0} has been returned to process. Please remove posted TECN from point of use. The returned to process date is {4}  | ||||||
|  | Please review the returned to process TECN form in the attachment. | ||||||
|  | <br/><br/> | ||||||
|  | https://messa016ec.infineon.com/ECN/Edit?issueID={1} | ||||||
|  | <br/><br/> | ||||||
|  | Comments: {5} | ||||||
|  | <br/><br/> | ||||||
|  |  | ||||||
|  | If you have any questions or trouble logging on please contact a site administrator. | ||||||
|  | <br/><br/> | ||||||
|  | Thank you!  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | </font> | ||||||
| @ -179,7 +179,7 @@ | |||||||
|       <LastGenOutput>FabApproval.Designer.cs</LastGenOutput> |       <LastGenOutput>FabApproval.Designer.cs</LastGenOutput> | ||||||
|     </EntityDeploy> |     </EntityDeploy> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
|   <ItemGroup>     |   <ItemGroup> | ||||||
|     <Compile Include="Models\FabApproval.Context.cs"> |     <Compile Include="Models\FabApproval.Context.cs"> | ||||||
|       <AutoGen>True</AutoGen> |       <AutoGen>True</AutoGen> | ||||||
|       <DesignTime>True</DesignTime> |       <DesignTime>True</DesignTime> | ||||||
| @ -255,6 +255,7 @@ | |||||||
|     <Compile Include="Controllers\TrainingController.cs" /> |     <Compile Include="Controllers\TrainingController.cs" /> | ||||||
|     <Compile Include="Controllers\WebAPIController.cs" /> |     <Compile Include="Controllers\WebAPIController.cs" /> | ||||||
|     <Compile Include="Controllers\WorkflowController.cs" /> |     <Compile Include="Controllers\WorkflowController.cs" /> | ||||||
|  |     <Compile Include="Controllers\PCRBController.cs" /> | ||||||
|     <Compile Include="DMO\AccountDMO.cs" /> |     <Compile Include="DMO\AccountDMO.cs" /> | ||||||
|     <Compile Include="DMO\AdminDMO.cs" /> |     <Compile Include="DMO\AdminDMO.cs" /> | ||||||
|     <Compile Include="DMO\ApprovalLogDMO.cs" /> |     <Compile Include="DMO\ApprovalLogDMO.cs" /> | ||||||
| @ -387,8 +388,10 @@ | |||||||
|     <Content Include="Views\CorrectiveAction\_D7PAAttachment.cshtml" /> |     <Content Include="Views\CorrectiveAction\_D7PAAttachment.cshtml" /> | ||||||
|     <Content Include="Views\CorrectiveAction\Edit.cshtml" /> |     <Content Include="Views\CorrectiveAction\Edit.cshtml" /> | ||||||
|     <Content Include="Views\CorrectiveAction\ReadOnlyCA.cshtml" /> |     <Content Include="Views\CorrectiveAction\ReadOnlyCA.cshtml" /> | ||||||
|  |     <Content Include="Views\ECN\_ECNCancel.cshtml" /> | ||||||
|     <Content Include="Views\ECN\_ECNLayout.cshtml" /> |     <Content Include="Views\ECN\_ECNLayout.cshtml" /> | ||||||
|     <Content Include="Views\ECN\_ECNReassignOriginator.cshtml" /> |     <Content Include="Views\ECN\_ECNReassignOriginator.cshtml" /> | ||||||
|  |     <Content Include="Views\ECN\_ECNReturnToProcess.cshtml" /> | ||||||
|     <Content Include="Views\ECN\Acknowledge.cshtml" /> |     <Content Include="Views\ECN\Acknowledge.cshtml" /> | ||||||
|     <Content Include="Views\ECN\ECNApprovalPdf.cshtml" /> |     <Content Include="Views\ECN\ECNApprovalPdf.cshtml" /> | ||||||
|     <Content Include="Views\ECN\ECNPdf.cshtml" /> |     <Content Include="Views\ECN\ECNPdf.cshtml" /> | ||||||
| @ -513,6 +516,7 @@ | |||||||
|     <Content Include="EmailTemplates\TECNExpirationApproval.txt" /> |     <Content Include="EmailTemplates\TECNExpirationApproval.txt" /> | ||||||
|     <Content Include="EmailTemplates\TECNExpired.txt" /> |     <Content Include="EmailTemplates\TECNExpired.txt" /> | ||||||
|     <Content Include="EmailTemplates\TECNExtensionReject.txt" /> |     <Content Include="EmailTemplates\TECNExtensionReject.txt" /> | ||||||
|  |     <Content Include="EmailTemplates\TECNReturnedToProcess.txt" /> | ||||||
|     <Content Include="EmailTemplates\WorkRequestApproval.txt" /> |     <Content Include="EmailTemplates\WorkRequestApproval.txt" /> | ||||||
|     <Content Include="EmailTemplates\WorkRequestAssigned.txt" /> |     <Content Include="EmailTemplates\WorkRequestAssigned.txt" /> | ||||||
|     <Content Include="EmailTemplates\WorkRequestReAssigned.txt" /> |     <Content Include="EmailTemplates\WorkRequestReAssigned.txt" /> | ||||||
|  | |||||||
| @ -126,7 +126,7 @@ public class ECNHelper { | |||||||
|         return emailSentList; |         return emailSentList; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public static string NotifyTECNCancellation(AppSettings appSettings, UserAccountDMO userDMO, int ecnNumber, string ecnFolderPath, ECN ecn, List<int> notificationUserList) { |     public static string NotifyTECNCancellation(AppSettings appSettings, UserAccountDMO userDMO, int ecnNumber, string ecnFolderPath, string comments, ECN ecn, List<int> notificationUserList) { | ||||||
|         string emailSentList = ""; |         string emailSentList = ""; | ||||||
|         List<string> emailIst = MiscDMO.GetTECNCancelledApprovalNotifyList(ecnNumber).Distinct().ToList(); |         List<string> emailIst = MiscDMO.GetTECNCancelledApprovalNotifyList(ecnNumber).Distinct().ToList(); | ||||||
|         foreach (int userId in notificationUserList) { |         foreach (int userId in notificationUserList) { | ||||||
| @ -135,23 +135,27 @@ public class ECNHelper { | |||||||
|                 emailIst.Add(email); |                 emailIst.Add(email); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         string subject = string.Empty; |         string subject; | ||||||
|         string userEmail = string.Empty; |         string emailTemplate; | ||||||
|         string emailTemplate = "TECNCancelled.txt"; |  | ||||||
|         if (ecn.CancellationApprovalDate == null) { |  | ||||||
|             subject = "TECN Cancellation Initiated  Notice - " + ecnNumber + " for " + ecn.Title + ", Cancellation Initiated on:" + DateTime.Now; |  | ||||||
|         } else { |  | ||||||
|             subject = "TECN Cancellation Approved Notice - " + ecnNumber + " for " + ecn.Title + ", Cancelled:" + ecn.CancellationApprovalDate; |  | ||||||
|         } |  | ||||||
|         string senderName = "ECN"; |         string senderName = "ECN"; | ||||||
|  |         string userEmail = string.Empty; | ||||||
|  |         DateTime dateTime = ecn.CancellationApprovalDate is null ? DateTime.Now : ecn.CancellationApprovalDate.Value; | ||||||
|  |         if (ecn.ExpirationDate > DateTime.Today || ecn.ExtensionDate > DateTime.Today) { | ||||||
|  |             emailTemplate = "TECNCancelled.txt"; | ||||||
|  |             subject = "TECN Cancellation Approved Notice - " + ecnNumber + " for " + ecn.Title + ", Cancelled:" + dateTime; | ||||||
|  |         } else { | ||||||
|  |             emailTemplate = "TECNReturnedToProcess.txt"; | ||||||
|  |             subject = "TECN Return to Process Approved Notice - " + ecnNumber + " for " + ecn.Title + ", Returned:" + dateTime; | ||||||
|  |         } | ||||||
|  |  | ||||||
|         EmailNotification en = new(appSettings, subject); |         EmailNotification en = new(appSettings, subject); | ||||||
|         string[] emailparams = new string[5]; |         string[] emailparams = new string[6]; | ||||||
|         emailparams[0] = ecnNumber.ToString(); |         emailparams[0] = ecnNumber.ToString(); | ||||||
|         emailparams[1] = ecnNumber.ToString(); |         emailparams[1] = ecnNumber.ToString(); | ||||||
|         emailparams[2] = GlobalVars.hostURL; |         emailparams[2] = GlobalVars.hostURL; | ||||||
|         emailparams[3] = "TECN"; |         emailparams[3] = "TECN"; | ||||||
|         emailparams[4] = DateTime.Now.ToString(); |         emailparams[4] = DateTime.Now.ToString(); | ||||||
|  |         emailparams[5] = comments; | ||||||
|  |  | ||||||
| #if (DEBUG) | #if (DEBUG) | ||||||
|         userEmail = GlobalVars.SENDER_EMAIL; |         userEmail = GlobalVars.SENDER_EMAIL; | ||||||
|  | |||||||
| @ -8,7 +8,7 @@ namespace Fab2ApprovalSystem.Models; | |||||||
| public class AppSettings { | public class AppSettings { | ||||||
|  |  | ||||||
|     public AppSettings(string adminNotificationRecepient, |     public AppSettings(string adminNotificationRecepient, | ||||||
|                        string? apiBaseUrl, |                        string apiBaseUrl, | ||||||
|                        string attachmentFolder, |                        string attachmentFolder, | ||||||
|                        string? attachmentUrl, |                        string? attachmentUrl, | ||||||
|                        string caBlankFormsLocation, |                        string caBlankFormsLocation, | ||||||
| @ -46,6 +46,7 @@ public class AppSettings { | |||||||
|                        string urls, |                        string urls, | ||||||
|                        int userId, |                        int userId, | ||||||
|                        bool userIsAdmin, |                        bool userIsAdmin, | ||||||
|  |                        string wasmClientUrl, | ||||||
|                        string wsr_URL, |                        string wsr_URL, | ||||||
|                        string? workingDirectoryName) { |                        string? workingDirectoryName) { | ||||||
|         AdminNotificationRecepient = adminNotificationRecepient; |         AdminNotificationRecepient = adminNotificationRecepient; | ||||||
| @ -88,11 +89,12 @@ public class AppSettings { | |||||||
|         UserId = userId; |         UserId = userId; | ||||||
|         UserIsAdmin = userIsAdmin; |         UserIsAdmin = userIsAdmin; | ||||||
|         WSR_URL = wsr_URL; |         WSR_URL = wsr_URL; | ||||||
|  |         WasmClientUrl = wasmClientUrl; | ||||||
|         WorkingDirectoryName = workingDirectoryName; |         WorkingDirectoryName = workingDirectoryName; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public string AdminNotificationRecepient { get; } |     public string AdminNotificationRecepient { get; } | ||||||
|     public string? ApiBaseUrl { get; } |     public string ApiBaseUrl { get; } | ||||||
|     public string AttachmentFolder { get; } |     public string AttachmentFolder { get; } | ||||||
|     public string? AttachmentUrl { get; } |     public string? AttachmentUrl { get; } | ||||||
|     public string CABlankFormsLocation { get; } |     public string CABlankFormsLocation { get; } | ||||||
| @ -130,6 +132,7 @@ public class AppSettings { | |||||||
|     public string URLs { get; } |     public string URLs { get; } | ||||||
|     public int UserId { get; } |     public int UserId { get; } | ||||||
|     public bool UserIsAdmin { get; } |     public bool UserIsAdmin { get; } | ||||||
|  |     public string WasmClientUrl { get; } | ||||||
|     public string WSR_URL { get; } |     public string WSR_URL { get; } | ||||||
|     public string? WorkingDirectoryName { get; } |     public string? WorkingDirectoryName { get; } | ||||||
|  |  | ||||||
| @ -211,12 +214,15 @@ public class AppSettings { | |||||||
|                 throw new ArgumentNullException("SSRSPassword environment variable not found"); |                 throw new ArgumentNullException("SSRSPassword environment variable not found"); | ||||||
|             string testEmailRecipients = ConfigurationManager.AppSettings["Test Email Recipients"] ?? |             string testEmailRecipients = ConfigurationManager.AppSettings["Test Email Recipients"] ?? | ||||||
|                 throw new ArgumentNullException("Test Email Recipients environment variable not found"); |                 throw new ArgumentNullException("Test Email Recipients environment variable not found"); | ||||||
|             string? apiBaseUrl = ConfigurationManager.AppSettings["FabApprovalApiBaseUrl"]?.ToString(); |             string apiBaseUrl = Environment.GetEnvironmentVariable("FabApprovalApiBaseUrl") ?? | ||||||
|  |                 throw new ArgumentNullException("FabApprovalApiBaseUrl environment variable not found"); | ||||||
|             string? attachmentUrl = ConfigurationManager.AppSettings["AttachmentUrl"]?.ToString(); |             string? attachmentUrl = ConfigurationManager.AppSettings["AttachmentUrl"]?.ToString(); | ||||||
|             string? company = ConfigurationManager.AppSettings["Company"]?.ToString(); |             string? company = ConfigurationManager.AppSettings["Company"]?.ToString(); | ||||||
|             string? smtpServer = ConfigurationManager.AppSettings["SMTP Server"]?.ToString(); |             string? smtpServer = ConfigurationManager.AppSettings["SMTP Server"]?.ToString(); | ||||||
|             string? urls = ConfigurationManager.AppSettings["URLs"]?.ToString(); |             string? urls = ConfigurationManager.AppSettings["URLs"]?.ToString(); | ||||||
|             string? workingDirectoryName = ConfigurationManager.AppSettings["WorkingDirectoryName"]?.ToString(); |             string? workingDirectoryName = ConfigurationManager.AppSettings["WorkingDirectoryName"]?.ToString(); | ||||||
|  |             string wasmClientUrl = Environment.GetEnvironmentVariable("FabApprovalWasmClientUrl") ?? | ||||||
|  |                 "https://localhost:7255"; | ||||||
|             result = new(adminNotificationRecepient: adminNotificationRecepient, |             result = new(adminNotificationRecepient: adminNotificationRecepient, | ||||||
|                          apiBaseUrl: apiBaseUrl, |                          apiBaseUrl: apiBaseUrl, | ||||||
|                          attachmentFolder: attachmentFolder, |                          attachmentFolder: attachmentFolder, | ||||||
| @ -256,6 +262,7 @@ public class AppSettings { | |||||||
|                          urls: urls, |                          urls: urls, | ||||||
|                          userId: userId, |                          userId: userId, | ||||||
|                          userIsAdmin: Misc.GlobalVars.USER_ISADMIN, |                          userIsAdmin: Misc.GlobalVars.USER_ISADMIN, | ||||||
|  |                          wasmClientUrl: wasmClientUrl, | ||||||
|                          wsr_URL: Misc.GlobalVars.WSR_URL, |                          wsr_URL: Misc.GlobalVars.WSR_URL, | ||||||
|                          workingDirectoryName: workingDirectoryName); |                          workingDirectoryName: workingDirectoryName); | ||||||
|             return result; |             return result; | ||||||
|  | |||||||
| @ -231,6 +231,7 @@ public class CorrectiveAction { | |||||||
|     public DateTime? NextDueDate { get; set; } |     public DateTime? NextDueDate { get; set; } | ||||||
|     public DateTime? FollowUpDate { get; set; } |     public DateTime? FollowUpDate { get; set; } | ||||||
|     public bool CASubmitted { get; set; } |     public bool CASubmitted { get; set; } | ||||||
|  |     public string CAStandardType { get; set; } | ||||||
|     public DateTime? ClosedDate { get; set; } |     public DateTime? ClosedDate { get; set; } | ||||||
|     public CorrectiveAction() { |     public CorrectiveAction() { | ||||||
|         TeamMemberIDs = new List<int>(); |         TeamMemberIDs = new List<int>(); | ||||||
|  | |||||||
| @ -380,6 +380,43 @@ | |||||||
|                             </div> |                             </div> | ||||||
|                         </div> |                         </div> | ||||||
|                     </div> |                     </div> | ||||||
|  |  | ||||||
|  |                     <div class="col-sm-3"> | ||||||
|  |                         <div class="row"> | ||||||
|  |                             <div class="col-sm-3"> | ||||||
|  |                                 <label class="control-label pull-right">CA Standard Type:</label> | ||||||
|  |                             </div> | ||||||
|  |                             <div class="col-sm-9"> | ||||||
|  |                                 @(Html.Kendo().DropDownList() | ||||||
|  |                                     .Name("CAStandardTypeList") | ||||||
|  |  | ||||||
|  |                                     .DataTextField("Text") | ||||||
|  |                                     .DataValueField("Value") | ||||||
|  |                                         .BindTo(new List<SelectListItem>() | ||||||
|  |                                         { | ||||||
|  |                                             new SelectListItem() | ||||||
|  |                                             { | ||||||
|  |                                                 Text = "IATF16949", | ||||||
|  |                                                 Value = "IATF16949" | ||||||
|  |                                             }, | ||||||
|  |                                             new SelectListItem() | ||||||
|  |                                             { | ||||||
|  |                                                 Text = "ISO14001", | ||||||
|  |                                                 Value = "ISO14001" | ||||||
|  |                                             }, | ||||||
|  |                                             new SelectListItem() | ||||||
|  |                                             { | ||||||
|  |                                                 Text = "ISO45001", | ||||||
|  |                                                 Value = "ISO45001" | ||||||
|  |                                             } | ||||||
|  |                                         } | ||||||
|  |                                     ) | ||||||
|  |                                     .OptionLabel("Select") | ||||||
|  |                                     .Value(Model.CAStandardType) | ||||||
|  |                                 ) | ||||||
|  |                             </div> | ||||||
|  |                         </div> | ||||||
|  |                     </div> | ||||||
|                 </div> |                 </div> | ||||||
|                 <div class="row"> |                 <div class="row"> | ||||||
|                     <div class="col-sm-3"> |                     <div class="col-sm-3"> | ||||||
| @ -2176,6 +2213,7 @@ | |||||||
|             $('#txtApprovedDate').attr("disabled", true); |             $('#txtApprovedDate').attr("disabled", true); | ||||||
|             $('#txtRelatedMRB').attr("disabled", true); |             $('#txtRelatedMRB').attr("disabled", true); | ||||||
|             $('#CATypeList').data("kendoDropDownList").enable(false); |             $('#CATypeList').data("kendoDropDownList").enable(false); | ||||||
|  |             $('#CAStandardTypeList').data("kendoDropDownList").enable(false); | ||||||
|             $('#d0Comments').attr("disabled", true); |             $('#d0Comments').attr("disabled", true); | ||||||
|         } |         } | ||||||
|  |  | ||||||
| @ -3689,6 +3727,7 @@ | |||||||
|             TeamCaptainID: $("#TeamCaptainList").data("kendoDropDownList").value(), |             TeamCaptainID: $("#TeamCaptainList").data("kendoDropDownList").value(), | ||||||
|             CASponsorID: $("#CASponsorList").data("kendoDropDownList").value(), |             CASponsorID: $("#CASponsorList").data("kendoDropDownList").value(), | ||||||
|             CASubmitted: isCASubmitted, |             CASubmitted: isCASubmitted, | ||||||
|  |             CAStandardType : $("#CAStandardTypeList").data("kendoDropDownList").value(), | ||||||
|  |  | ||||||
|             //D0 |             //D0 | ||||||
|             D0Comments : $("#d0Comments").val(), |             D0Comments : $("#d0Comments").val(), | ||||||
|  | |||||||
| @ -325,6 +325,16 @@ | |||||||
|                             </div> |                             </div> | ||||||
|                         </div> |                         </div> | ||||||
|                     </div> |                     </div> | ||||||
|  |                     <div class="col-sm-3"> | ||||||
|  |                         <div class="row"> | ||||||
|  |                             <div class="col-sm-3"> | ||||||
|  |                                 <label class="control-label pull-right">CA Standard Type:</label> | ||||||
|  |                             </div> | ||||||
|  |                             <div class="col-sm-9"> | ||||||
|  |                                 @Html.TextBoxFor(model => model.CAStandardType, new { id = "txtCAStandardType", @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" }) | ||||||
|  |                             </div> | ||||||
|  |                         </div> | ||||||
|  |                     </div> | ||||||
|                 </div> |                 </div> | ||||||
|                 <div class="row"> |                 <div class="row"> | ||||||
|                     <div class="col-sm-3"> |                     <div class="col-sm-3"> | ||||||
|  | |||||||
| @ -86,29 +86,47 @@ | |||||||
|  |  | ||||||
|                 if (Model.IsTECN && !Model.CancellationInProgress && !Model.CancellationApproved && !Model.ExpirationInProgress |                 if (Model.IsTECN && !Model.CancellationInProgress && !Model.CancellationApproved && !Model.ExpirationInProgress | ||||||
|                     && !Model.ExpirationProcessed && !Model.Converted |                     && !Model.ExpirationProcessed && !Model.Converted | ||||||
|                     && !Model.LockedForConversion |                     && !Model.LockedForConversion) | ||||||
|                     && (Model.ExpirationDate > DateTime.Today || Model.ExtensionDate > DateTime.Today)) |  | ||||||
|                 { |                 { | ||||||
|                     ViewBag.CanResubmit = "true"; |                     ViewBag.CanResubmit = "true"; | ||||||
|                     <input type="button" value="Change Type" class="btn btn-primary btn-xs" id="ReSubmitDocument" disabled="disabled" /> |                     <input type="button" value="Change Type" class="btn btn-primary btn-xs" id="ReSubmitDocument" disabled="disabled" /> | ||||||
|                     <input type="button" value="Cancel Document" class="btn btn-primary btn-xs" id="CancelDocument" /> |                     if (Model.ExpirationDate > DateTime.Today || Model.ExtensionDate > DateTime.Today) | ||||||
|  |                     { | ||||||
|  |                         <input type="button" value="Cancel Document" class="btn btn-primary btn-xs" id="CancelDocument" /> | ||||||
|  |                     } | ||||||
|  |                     else | ||||||
|  |                     { | ||||||
|  |                         <input type="button" value="Return to Process" class="btn btn-primary btn-xs" id="ReturnToProcessDocument" /> | ||||||
|  |                     } | ||||||
|                 } |                 } | ||||||
|  |  | ||||||
|                 else if (Model.IsTECN && !Model.CancellationInProgress && !Model.CancellationApproved && !Model.ExpirationInProgress |                 else if (Model.IsTECN && !Model.CancellationInProgress && !Model.CancellationApproved && !Model.ExpirationInProgress | ||||||
|                     && !Model.ExpirationProcessed |                     && !Model.ExpirationProcessed | ||||||
|                     && Model.ConversionApprovalInProgress == false |                     && Model.ConversionApprovalInProgress == false) | ||||||
|                     && (Model.ExpirationDate >= DateTime.Today || Model.ExtensionDate >= DateTime.Today)) |  | ||||||
|                 { |                 { | ||||||
|                     <input type="button" value="Cancel Document" class="btn btn-primary btn-xs" id="CancelDocument" /> |                     if (Model.ExpirationDate > DateTime.Today || Model.ExtensionDate > DateTime.Today) | ||||||
|  |                     { | ||||||
|  |                         <input type="button" value="Cancel Document" class="btn btn-primary btn-xs" id="CancelDocument" /> | ||||||
|  |                     } | ||||||
|  |                     else | ||||||
|  |                     { | ||||||
|  |                         <input type="button" value="Return to Process" class="btn btn-primary btn-xs" id="ReturnToProcessDocument" /> | ||||||
|  |                     } | ||||||
|                 } |                 } | ||||||
|  |  | ||||||
|                 else if (Model.IsEmergencyTECN && !Model.CancellationInProgress && !Model.CancellationApproved && !Model.ExpirationInProgress |                 else if (Model.IsEmergencyTECN && !Model.CancellationInProgress && !Model.CancellationApproved && !Model.ExpirationInProgress | ||||||
|                     && !Model.ExpirationProcessed && !Model.Converted |                     && !Model.ExpirationProcessed && !Model.Converted) | ||||||
|                         && (Model.ExpirationDate > DateTime.Today || Model.ExtensionDate > DateTime.Today)) |  | ||||||
|                 { |                 { | ||||||
|                     ViewBag.CanResubmit = "true"; |                     ViewBag.CanResubmit = "true"; | ||||||
|                     <input type="button" value="Change Type" class="btn btn-primary btn-xs" id="ReSubmitDocument" disabled="disabled" /> |                     <input type="button" value="Change Type" class="btn btn-primary btn-xs" id="ReSubmitDocument" disabled="disabled" /> | ||||||
|                     <input type="button" value="Cancel Document" class="btn btn-primary btn-xs" id="CancelDocument" /> |                     if (Model.ExpirationDate > DateTime.Today || Model.ExtensionDate > DateTime.Today) | ||||||
|  |                     { | ||||||
|  |                         <input type="button" value="Cancel Document" class="btn btn-primary btn-xs" id="CancelDocument" /> | ||||||
|  |                     } | ||||||
|  |                     else | ||||||
|  |                     { | ||||||
|  |                         <input type="button" value="Return to Process" class="btn btn-primary btn-xs" id="ReturnToProcessDocument" /> | ||||||
|  |                     } | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|  |  | ||||||
| @ -1251,6 +1269,9 @@ | |||||||
|     </div> |     </div> | ||||||
| </div> | </div> | ||||||
|  |  | ||||||
|  | @Html.Partial("_ECNCancel") | ||||||
|  | @Html.Partial("_ECNReturnToProcess") | ||||||
|  |  | ||||||
| @Html.Partial("_ECNReassignOriginator") | @Html.Partial("_ECNReassignOriginator") | ||||||
|  |  | ||||||
| <script type="text/javascript"> | <script type="text/javascript"> | ||||||
| @ -2188,40 +2209,6 @@ | |||||||
|         return false; |         return false; | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|     $('#CancelDocument').on('click', function () { |  | ||||||
|         docType = 5; |  | ||||||
|         if (confirm("Are you sure you want to Cancel this document?")) { |  | ||||||
|             $.ajax({ |  | ||||||
|                 url: "/ECN/CancelDocument", |  | ||||||
|                 type: "GET", |  | ||||||
|                 datatype: "json", |  | ||||||
|                 data: { |  | ||||||
|                     ecnNumber: $("#txtECNNumber").val(), |  | ||||||
|                     currentStep: 1, |  | ||||||
|                     documentType: docType, |  | ||||||
|                     ecnTypeString: ecnTypeString |  | ||||||
|                 }, |  | ||||||
|                 success: function (data) { |  | ||||||
|  |  | ||||||
|                     if (data == 'Redirect') { |  | ||||||
|                         var url = '@Url.Action("ReadOnly", "ECN", new { issueID = "__id__" })'; |  | ||||||
|                         url = url.replace('amp;', ''); |  | ||||||
|                         window.location.href = url.replace('__id__', $("#txtECNNumber").val()); |  | ||||||
|  |  | ||||||
|                     } |  | ||||||
|                     else { |  | ||||||
|                         // TODO alert an error message |  | ||||||
|                     } |  | ||||||
|                 }, |  | ||||||
|                 error: function (result) { |  | ||||||
|                     alert("Failed on Cancel" + result); |  | ||||||
|                 } |  | ||||||
|             }); |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         return false; |  | ||||||
|     }); |  | ||||||
|  |  | ||||||
|     var returnNoOfDays = function () { |     var returnNoOfDays = function () { | ||||||
|         //var start = new Date($('#txSubmitDate').val()); |         //var start = new Date($('#txSubmitDate').val()); | ||||||
|         var start = new Date(); |         var start = new Date(); | ||||||
|  | |||||||
							
								
								
									
										75
									
								
								Fab2ApprovalSystem/Views/ECN/_ECNCancel.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										75
									
								
								Fab2ApprovalSystem/Views/ECN/_ECNCancel.cshtml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,75 @@ | |||||||
|  | <div class="modal fade" id="Cancel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static"> | ||||||
|  |     <div class="modal-dialog"> | ||||||
|  |         <div class="modal-content"> | ||||||
|  |             <div class="modal-header"> | ||||||
|  |                 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | ||||||
|  |                 <h4 class="modal-title" id="myModalLabel"><center>Has the process returned to the original state?</center></h4> | ||||||
|  |  | ||||||
|  |             </div> | ||||||
|  |             <div class="modal-body"> | ||||||
|  |                 <div class="control-group"> | ||||||
|  |                     <div class="row"> | ||||||
|  |                         <div class="col-sm-13"> | ||||||
|  |                             <h4 class="modal-title">Comments (Required):</h4> | ||||||
|  |                             <textarea class="form-control" rows="5" id="comments" style="resize: none;"></textarea> | ||||||
|  |                         </div> | ||||||
|  |                     </div> | ||||||
|  |                 </div> | ||||||
|  |             </div> | ||||||
|  |             <div class="modal-footer"> | ||||||
|  |                 <button type="button" class="btn btn-default" data-dismiss="modal">No</button> | ||||||
|  |                 <button type="button" class="btn btn-primary" id="ConfirmCancel">Confirm Cancel (Yes)</button> | ||||||
|  |             </div> | ||||||
|  |         </div> | ||||||
|  |     </div> | ||||||
|  | </div> | ||||||
|  | <script language="javascript" type="text/javascript"> | ||||||
|  |  | ||||||
|  |     $(document).ready(function () { | ||||||
|  |  | ||||||
|  |         $("#CancelDocument").click(function (e) { | ||||||
|  |  | ||||||
|  |             $("#comments").val(""); | ||||||
|  |  | ||||||
|  |             $("#Cancel").modal('show'); | ||||||
|  |         }); | ||||||
|  |  | ||||||
|  |         $('#ConfirmCancel').on('click', function () { | ||||||
|  |  | ||||||
|  |             if ($("#comments").val() == "") { | ||||||
|  |                 alert("Comments are required"); | ||||||
|  |                 return; | ||||||
|  |             } | ||||||
|  |  | ||||||
|  |             $('#ConfirmCancel').attr("disabled", true); | ||||||
|  |  | ||||||
|  |             $.ajax({ | ||||||
|  |                 url: "/ECN/CancelDocument", | ||||||
|  |                 type: "GET", | ||||||
|  |                 datatype: "json", | ||||||
|  |                 data: { | ||||||
|  |                     ecnNumber: $("#txtECNNumber").val(), | ||||||
|  |                     currentStep: 1, | ||||||
|  |                     documentType: 5, | ||||||
|  |                     ecnTypeString: ecnTypeString, | ||||||
|  |                     comments: $("#comments").val(), | ||||||
|  |                 }, | ||||||
|  |                 success: function (data) { | ||||||
|  |  | ||||||
|  |                     $("#Cancel").modal('hide'); | ||||||
|  |  | ||||||
|  |                     var url = '@Url.Action("ReadOnly", "ECN", new { issueID = "__id__" })'; | ||||||
|  |                     url = url.replace('amp;', ''); | ||||||
|  |                     window.location.href = url.replace('__id__', $("#txtECNNumber").val()); | ||||||
|  |  | ||||||
|  |                 }, | ||||||
|  |                 error: function (result) { | ||||||
|  |                     $('#ConfirmCancel').attr("disabled", false); | ||||||
|  |                     alert("Server error while canceling document"); | ||||||
|  |                 } | ||||||
|  |             }); | ||||||
|  |  | ||||||
|  |         }); | ||||||
|  |  | ||||||
|  |     }); | ||||||
|  | </script> | ||||||
							
								
								
									
										75
									
								
								Fab2ApprovalSystem/Views/ECN/_ECNReturnToProcess.cshtml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										75
									
								
								Fab2ApprovalSystem/Views/ECN/_ECNReturnToProcess.cshtml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,75 @@ | |||||||
|  | <div class="modal fade" id="ReturnToProcess" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static"> | ||||||
|  |     <div class="modal-dialog"> | ||||||
|  |         <div class="modal-content"> | ||||||
|  |             <div class="modal-header"> | ||||||
|  |                 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | ||||||
|  |                 <h4 class="modal-title" id="myModalLabel"><center>Has the process returned to the original state?</center></h4> | ||||||
|  |  | ||||||
|  |             </div> | ||||||
|  |             <div class="modal-body"> | ||||||
|  |                 <div class="control-group"> | ||||||
|  |                     <div class="row"> | ||||||
|  |                         <div class="col-sm-13"> | ||||||
|  |                             <h4 class="modal-title">Comments (Required):</h4> | ||||||
|  |                             <textarea class="form-control" rows="5" id="ReturnToProcessComments" style="resize: none;"></textarea> | ||||||
|  |                         </div> | ||||||
|  |                     </div> | ||||||
|  |                 </div> | ||||||
|  |             </div> | ||||||
|  |             <div class="modal-footer"> | ||||||
|  |                 <button type="button" class="btn btn-default" data-dismiss="modal">No</button> | ||||||
|  |                 <button type="button" class="btn btn-primary" id="ConfirmReturnToProcess">Confirm Return to Process (Yes)</button> | ||||||
|  |             </div> | ||||||
|  |         </div> | ||||||
|  |     </div> | ||||||
|  | </div> | ||||||
|  | <script language="javascript" type="text/javascript"> | ||||||
|  |  | ||||||
|  |     $(document).ready(function () { | ||||||
|  |  | ||||||
|  |         $("#ReturnToProcessDocument").click(function (e) { | ||||||
|  |  | ||||||
|  |             $("#ReturnToProcessComments").val(""); | ||||||
|  |  | ||||||
|  |             $("#ReturnToProcess").modal('show'); | ||||||
|  |         }); | ||||||
|  |  | ||||||
|  |         $('#ConfirmReturnToProcess').on('click', function () { | ||||||
|  |  | ||||||
|  |             if ($("#ReturnToProcessComments").val() == "") { | ||||||
|  |                 alert("Comments are required"); | ||||||
|  |                 return; | ||||||
|  |             } | ||||||
|  |  | ||||||
|  |             $('#ConfirmReturnToProcess').attr("disabled", true); | ||||||
|  |  | ||||||
|  |             $.ajax({ | ||||||
|  |                 url: "/ECN/CancelDocument", | ||||||
|  |                 type: "GET", | ||||||
|  |                 datatype: "json", | ||||||
|  |                 data: { | ||||||
|  |                     ecnNumber: $("#txtECNNumber").val(), | ||||||
|  |                     currentStep: 1, | ||||||
|  |                     documentType: 5, | ||||||
|  |                     ecnTypeString: ecnTypeString, | ||||||
|  |                     comments: $("#ReturnToProcessComments").val(), | ||||||
|  |                 }, | ||||||
|  |                 success: function (data) { | ||||||
|  |  | ||||||
|  |                     $("#ReturnToProcess").modal('hide'); | ||||||
|  |  | ||||||
|  |                     var url = '@Url.Action("ReadOnly", "ECN", new { issueID = "__id__" })'; | ||||||
|  |                     url = url.replace('amp;', ''); | ||||||
|  |                     window.location.href = url.replace('__id__', $("#txtECNNumber").val()); | ||||||
|  |  | ||||||
|  |                 }, | ||||||
|  |                 error: function (result) { | ||||||
|  |                     $('#ConfirmReturnToProcess').attr("disabled", false); | ||||||
|  |                     alert("Server error while ReturnToProcessing document"); | ||||||
|  |                 } | ||||||
|  |             }); | ||||||
|  |  | ||||||
|  |         }); | ||||||
|  |  | ||||||
|  |     }); | ||||||
|  | </script> | ||||||
| @ -92,15 +92,15 @@ | |||||||
|                                 "https://localhost:7255"; |                                 "https://localhost:7255"; | ||||||
|                             string mrbUrl = wasmClientUrl + "/redirect?jwt=" + encodedJwt + "&refreshToken=" + encodedRefreshToken + "&redirectPath=/mrb/new"; |                             string mrbUrl = wasmClientUrl + "/redirect?jwt=" + encodedJwt + "&refreshToken=" + encodedRefreshToken + "&redirectPath=/mrb/new"; | ||||||
|                             <li><a href="@mrbUrl">Create MRB</a></li> |                             <li><a href="@mrbUrl">Create MRB</a></li> | ||||||
|                             @*string pcrbUrl = wasmClientUrl + "/redirect?jwt=" + encodedJwt + "&refreshToken=" + encodedRefreshToken + "&redirectPath=/pcrb/new"; |                             string pcrbUrl = wasmClientUrl + "/redirect?jwt=" + encodedJwt + "&refreshToken=" + encodedRefreshToken + "&redirectPath=/pcrb/new"; | ||||||
|                             <li><a href="@pcrbUrl">Create PCRB</a></li>*@ |                             <li><a href="@pcrbUrl">Create PCRB</a></li> | ||||||
|                         } else { |                         } else { | ||||||
|                             string wasmClientUrl = Environment.GetEnvironmentVariable("FabApprovalWasmClientUrl") ?? |                             string wasmClientUrl = Environment.GetEnvironmentVariable("FabApprovalWasmClientUrl") ?? | ||||||
|                                                         "https://localhost:7255"; |                                                         "https://localhost:7255"; | ||||||
|                             string mrbUrl = wasmClientUrl + "/redirect?redirectPath=/mrb/new"; |                             string mrbUrl = wasmClientUrl + "/redirect?redirectPath=/mrb/new"; | ||||||
|                             <li><a href="@mrbUrl">Create MRB</a></li> |                             <li><a href="@mrbUrl">Create MRB</a></li> | ||||||
|                             @*string pcrbUrl = wasmClientUrl + "/redirect?redirectPath=/pcrb/new"; |                             string pcrbUrl = wasmClientUrl + "/redirect?redirectPath=/pcrb/new"; | ||||||
|                             <li><a href="@pcrbUrl">Create PCRB</a></li>*@ |                             <li><a href="@pcrbUrl">Create PCRB</a></li> | ||||||
|                         } |                         } | ||||||
|                         @*<li><a href=@Url.Action("CreateWorkRequest", "LotTraveler")>Create Special Work Request</a></li>*@ |                         @*<li><a href=@Url.Action("CreateWorkRequest", "LotTraveler")>Create Special Work Request</a></li>*@ | ||||||
|                         @*<li><a href=@Url.Action("Create", "ChangeControl")>Create PCR</a></li>*@ |                         @*<li><a href=@Url.Action("Create", "ChangeControl")>Create PCR</a></li>*@ | ||||||
| @ -152,8 +152,8 @@ | |||||||
|                 "https://localhost:7255"; |                 "https://localhost:7255"; | ||||||
|             string mrbUrl = wasmClientUrl + "/redirect?jwt=" + encodedJwt + "&refreshToken=" + encodedRefreshToken + "&redirectPath=/mrb/all"; |             string mrbUrl = wasmClientUrl + "/redirect?jwt=" + encodedJwt + "&refreshToken=" + encodedRefreshToken + "&redirectPath=/mrb/all"; | ||||||
|             menu.Add().Text("MRB").Url(mrbUrl); |             menu.Add().Text("MRB").Url(mrbUrl); | ||||||
|             //string pcrbUrl = wasmClientUrl + "/redirect?jwt=" + encodedJwt + "&refreshToken=" + encodedRefreshToken + "&redirectPath=/pcrb/all"; |             string pcrbUrl = wasmClientUrl + "/redirect?jwt=" + encodedJwt + "&refreshToken=" + encodedRefreshToken + "&redirectPath=/pcrb/all"; | ||||||
|             //menu.Add().Text("PCRB").Url(pcrbUrl); |             menu.Add().Text("PCRB").Url(pcrbUrl); | ||||||
|             //menu.Add().Text("Special Work Requests").Action("SpecialWorkRequestList", "Home"); |             //menu.Add().Text("Special Work Requests").Action("SpecialWorkRequestList", "Home"); | ||||||
|             //menu.Add().Text("PCRB").Action("ChangeControlList", "Home"); |             //menu.Add().Text("PCRB").Action("ChangeControlList", "Home"); | ||||||
|             //menu.Add().Text("MRB").Action("MRBList", "Home"); |             //menu.Add().Text("MRB").Action("MRBList", "Home"); | ||||||
|  | |||||||
| @ -54,7 +54,7 @@ public class HomeControllerTests { | |||||||
|  |  | ||||||
|     private static void GetMyOpenActionItems(ILogger? logger, AppSettings appSettings) { |     private static void GetMyOpenActionItems(ILogger? logger, AppSettings appSettings) { | ||||||
|         SetGlobalVars(logger, appSettings); |         SetGlobalVars(logger, appSettings); | ||||||
|         LotDispositionDMO lotDispositionDMO = new(appSettings); |         LotDispositionDMO lotDispositionDMO = new(); | ||||||
|         OpenActionItemViewModel[] openActionItemViewModels = lotDispositionDMO.GetMyOpenActionItems(appSettings.UserId).ToArray(); |         OpenActionItemViewModel[] openActionItemViewModels = lotDispositionDMO.GetMyOpenActionItems(appSettings.UserId).ToArray(); | ||||||
|         if (openActionItemViewModels.Length == 0) { } |         if (openActionItemViewModels.Length == 0) { } | ||||||
|     } |     } | ||||||
| @ -76,7 +76,7 @@ public class HomeControllerTests { | |||||||
|  |  | ||||||
|     private static void GetTaskList(ILogger? logger, AppSettings appSettings) { |     private static void GetTaskList(ILogger? logger, AppSettings appSettings) { | ||||||
|         SetGlobalVars(logger, appSettings); |         SetGlobalVars(logger, appSettings); | ||||||
|         LotDispositionDMO lotDispositionDMO = new(appSettings); |         LotDispositionDMO lotDispositionDMO = new(); | ||||||
|         IssuesViewModel[] issuesViewModels = lotDispositionDMO.GetTaskList(appSettings.UserId).ToArray(); |         IssuesViewModel[] issuesViewModels = lotDispositionDMO.GetTaskList(appSettings.UserId).ToArray(); | ||||||
|         if (issuesViewModels.Length == 0) { } |         if (issuesViewModels.Length == 0) { } | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -56,8 +56,8 @@ public class AdminDMOTests { | |||||||
|         AdminDMO adminDMO = new(); |         AdminDMO adminDMO = new(); | ||||||
|         // void AddNewTrainingGroup(string groupName); |         // void AddNewTrainingGroup(string groupName); | ||||||
|         // void AddUserRoles(int subRole, string userids); |         // void AddUserRoles(int subRole, string userids); | ||||||
|         // void AddUserToGroup(int userId, int groupId); |         // void AddUserToGroup(appSettings.UserId, int groupId); | ||||||
|         // void DeleteFromGroup(int userId, int groupId); |         // void DeleteFromGroup(appSettings.UserId, int groupId); | ||||||
|         // void DeleteTrainingGroup(int groupID); |         // void DeleteTrainingGroup(int groupID); | ||||||
|         // adminDMO.DeleteUserFromAllTrainingGroups(appSettings.UserId); |         // adminDMO.DeleteUserFromAllTrainingGroups(appSettings.UserId); | ||||||
|         // void DeleteUserRoles(int subRole, string userids); |         // void DeleteUserRoles(int subRole, string userids); | ||||||
|  | |||||||
| @ -62,8 +62,8 @@ public class AuditDMOTests { | |||||||
|         // IEnumerable<int> GetAuditFindingCategoryIdsByFindingId(int auditFindingsID); |         // IEnumerable<int> GetAuditFindingCategoryIdsByFindingId(int auditFindingsID); | ||||||
|         // AuditFindings GetAuditFindingsByID(int auditFindingsID); |         // AuditFindings GetAuditFindingsByID(int auditFindingsID); | ||||||
|         // IEnumerable<AuditFindings> GetAuditFindingsList(int auditNo); |         // IEnumerable<AuditFindings> GetAuditFindingsList(int auditNo); | ||||||
|         // Audit GetAuditItem(int auditNo, int userID); |         // Audit GetAuditItem(int auditNo, appSettings.UserId); | ||||||
|         // Audit GetAuditItemReadOnly(int auditNo, int userID); |         // Audit GetAuditItemReadOnly(int auditNo, appSettings.UserId); | ||||||
|         Auditor[] auditors = auditDMO.GetAuditorList().ToArray(); |         Auditor[] auditors = auditDMO.GetAuditorList().ToArray(); | ||||||
|         // IEnumerable<AuditReportAttachment> GetAuditReportAttachments(int auditNo); |         // IEnumerable<AuditReportAttachment> GetAuditReportAttachments(int auditNo); | ||||||
|         // C_8DAuditedStandard[] c_8DAuditedStandards = auditDMO.GetAuditStandardList().ToArray(); |         // C_8DAuditedStandard[] c_8DAuditedStandards = auditDMO.GetAuditStandardList().ToArray(); | ||||||
| @ -78,8 +78,8 @@ public class AuditDMOTests { | |||||||
|         // void InsertAuditReportAttachment(AuditReportAttachment attach); |         // void InsertAuditReportAttachment(AuditReportAttachment attach); | ||||||
|         // void InsertCAFindings(CAFindings model); |         // void InsertCAFindings(CAFindings model); | ||||||
|         // int IsCAAssignedToAudit(int CANo, int auditNo); |         // int IsCAAssignedToAudit(int CANo, int auditNo); | ||||||
|         // void ReleaseLockOnDocument(int userID, int issueID); |         // void ReleaseLockOnDocument(appSettings.UserId, int issueID); | ||||||
|         // void UpdateAudit(Audit audit, int userID); |         // void UpdateAudit(Audit audit, appSettings.UserId); | ||||||
|         // void UpdateCAFindings(CAFindings model); |         // void UpdateCAFindings(CAFindings model); | ||||||
|         if (auditDMO is null) { } |         if (auditDMO is null) { } | ||||||
| #pragma warning restore IDE0059 | #pragma warning restore IDE0059 | ||||||
|  | |||||||
| @ -53,12 +53,12 @@ public class ChangeControlDMOTests { | |||||||
|     private static void ChangeControlDMO(ILogger? logger, AppSettings appSettings) { |     private static void ChangeControlDMO(ILogger? logger, AppSettings appSettings) { | ||||||
| #pragma warning disable IDE0059 | #pragma warning disable IDE0059 | ||||||
|         SetGlobalVars(logger, appSettings); |         SetGlobalVars(logger, appSettings); | ||||||
|         ChangeControlDMO changeControlDMO = new(appSettings); |         ChangeControlDMO changeControlDMO = new(); | ||||||
|         // IEnumerable<CCAttachment> GetCCAttachment(int planNumber); |         // IEnumerable<CCAttachment> GetCCAttachment(int planNumber); | ||||||
|         // IEnumerable<CCMeetingAttachment> GetMeetingAttachments(int meetingID); |         // IEnumerable<CCMeetingAttachment> GetMeetingAttachments(int meetingID); | ||||||
|         // IEnumerable<MeetingDecisionSummaryList> GetMeetingDecisionSummaryList(int planNumber); |         // IEnumerable<MeetingDecisionSummaryList> GetMeetingDecisionSummaryList(int planNumber); | ||||||
|         // IEnumerable<CCMeeting> GetMeetingList(int planNumber); |         // IEnumerable<CCMeeting> GetMeetingList(int planNumber); | ||||||
|         // void ReassignOwner(int planNumber, int newOwnerID, string comments, int userID); |         // void ReassignOwner(int planNumber, int newOwnerID, string comments, appSettings.UserId); | ||||||
|         if (changeControlDMO is null) { } |         if (changeControlDMO is null) { } | ||||||
| #pragma warning restore IDE0059 | #pragma warning restore IDE0059 | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -55,8 +55,8 @@ public class CorrectiveActionDMOTests { | |||||||
|     private static void CorrectiveActionDMO(ILogger? logger, AppSettings appSettings) { |     private static void CorrectiveActionDMO(ILogger? logger, AppSettings appSettings) { | ||||||
| #pragma warning disable IDE0059 | #pragma warning disable IDE0059 | ||||||
|         SetGlobalVars(logger, appSettings); |         SetGlobalVars(logger, appSettings); | ||||||
|         CorrectiveActionDMO correctiveActionDMO = new(appSettings); |         CorrectiveActionDMO correctiveActionDMO = new(); | ||||||
|         // void ApproveSection(int issueID, int userID, string DSection); |         // void ApproveSection(int issueID, appSettings.UserId, string DSection); | ||||||
|         // void DeleteCAAttachment(int attachmentID); |         // void DeleteCAAttachment(int attachmentID); | ||||||
|         // void DeleteD3ContainmentActionItem(int d3ContainmentActionID); |         // void DeleteD3ContainmentActionItem(int d3ContainmentActionID); | ||||||
|         // void DeleteD5D6CorrectivetAction(int d5d6CAID); |         // void DeleteD5D6CorrectivetAction(int d5d6CAID); | ||||||
| @ -67,8 +67,8 @@ public class CorrectiveActionDMOTests { | |||||||
|         // IEnumerable<CA_Attachment> GetCAAttachmentsList(int caNo, string section); |         // IEnumerable<CA_Attachment> GetCAAttachmentsList(int caNo, string section); | ||||||
|         CAD3D5D7Due[] cAD3D5D7Dues = correctiveActionDMO.GetCAD3D5D7Due().ToArray(); |         CAD3D5D7Due[] cAD3D5D7Dues = correctiveActionDMO.GetCAD3D5D7Due().ToArray(); | ||||||
|         // IEnumerable<CA_Attachment> GetCAFindingsItemAttachments(int caFindingsID); |         // IEnumerable<CA_Attachment> GetCAFindingsItemAttachments(int caFindingsID); | ||||||
|         // CorrectiveAction GetCAItem(int caNo, int userID); |         // CorrectiveAction GetCAItem(int caNo, appSettings.UserId); | ||||||
|         // CorrectiveAction GetCAItemReadOnly(int caNo, int userID); |         // CorrectiveAction GetCAItemReadOnly(int caNo, appSettings.UserId); | ||||||
|         // IEnumerable<CASectionApproval> GetCASectionApprovalLog(int caNo); |         // IEnumerable<CASectionApproval> GetCASectionApprovalLog(int caNo); | ||||||
|         CASource[] cASources = correctiveActionDMO.GetCASourceList().ToArray(); |         CASource[] cASources = correctiveActionDMO.GetCASourceList().ToArray(); | ||||||
|         // IEnumerable<D3ContainmentAction> GetD3ContainmentActions(int caNo); |         // IEnumerable<D3ContainmentAction> GetD3ContainmentActions(int caNo); | ||||||
| @ -89,17 +89,17 @@ public class CorrectiveActionDMOTests { | |||||||
|         // void InsertD3ContainmentAction(D3ContainmentAction model); |         // void InsertD3ContainmentAction(D3ContainmentAction model); | ||||||
|         // void InsertD5D6CorrectivetAction(D5D6CorrectivetAction model); |         // void InsertD5D6CorrectivetAction(D5D6CorrectivetAction model); | ||||||
|         // void InsertD7PreventiveAction(D7PreventiveAction model); |         // void InsertD7PreventiveAction(D7PreventiveAction model); | ||||||
|         // bool IsAIAssignee(int userId, int caId); |         // bool IsAIAssignee(appSettings.UserId, int caId); | ||||||
|         // bool IsLastSectionApprover(int caNo, string dSection); |         // bool IsLastSectionApprover(int caNo, string dSection); | ||||||
|         // bool IsUserSectionApprover(int issueId, int userId); |         // bool IsUserSectionApprover(int issueId, appSettings.UserId); | ||||||
|         // void RejectSection(int issueID, int userID, string DSection, string comments); |         // void RejectSection(int issueID, appSettings.UserId, string DSection, string comments); | ||||||
|         // void ReleaseLockOnDocument(int userID, int issueID); |         // void ReleaseLockOnDocument(appSettings.UserId, int issueID); | ||||||
|         // DateTime SetCAComplete(int issueID); |         // DateTime SetCAComplete(int issueID); | ||||||
|         // DateTime SetCAD3DueDate(int issueID); |         // DateTime SetCAD3DueDate(int issueID); | ||||||
|         // DateTime SetCAD5D7DueDate(int issueID); |         // DateTime SetCAD5D7DueDate(int issueID); | ||||||
|         // void SetD3D5D7NotificationDate(int caNo, string section); |         // void SetD3D5D7NotificationDate(int caNo, string section); | ||||||
|         // int StartApproval(int issueID, int userID, int worlflowNumber); |         // int StartApproval(int issueID, appSettings.UserId, int worlflowNumber); | ||||||
|         // void StartSectionApproval(int issueID, int userID, string DSection); |         // void StartSectionApproval(int issueID, appSettings.UserId, string DSection); | ||||||
|         // void UpdateCorrectiveAction(CorrectiveAction model); |         // void UpdateCorrectiveAction(CorrectiveAction model); | ||||||
|         // void UpdateD3ContainmentAction(D3ContainmentAction model); |         // void UpdateD3ContainmentAction(D3ContainmentAction model); | ||||||
|         // void UpdateD5D6CorrectivetAction(D5D6CorrectivetAction model); |         // void UpdateD5D6CorrectivetAction(D5D6CorrectivetAction model); | ||||||
|  | |||||||
| @ -58,30 +58,30 @@ public class EngChangeNoticeDMOTests { | |||||||
|         ECN_DMO ecnDMO = new(); |         ECN_DMO ecnDMO = new(); | ||||||
|         // void CancelECN(int? ecnNumber); |         // void CancelECN(int? ecnNumber); | ||||||
|         // bool CanSubmitECN(int ecnNumber); |         // bool CanSubmitECN(int ecnNumber); | ||||||
|         // void DeleteDocument(int ecnNumber, int userid, string ecnTypeString); |         // void DeleteDocument(int ecnNumber, appSettings.UserId, string ecnTypeString); | ||||||
|         // void DeleteECNAttachment(int attachmentID); |         // void DeleteECNAttachment(int attachmentID); | ||||||
|         // bool ECNApproveCancelled_ExpiredDocument(int issueID, byte step, string comments, out bool lastStep, int userID, int documentType); |         // bool ECNApproveCancelled_ExpiredDocument(int issueID, byte step, string comments, out bool lastStep, appSettings.UserId, int documentType); | ||||||
|         // void ECNResetTECNAtRejection(int ecnNumber, int userID, int docType); |         // void ECNResetTECNAtRejection(int ecnNumber, appSettings.UserId, int docType); | ||||||
|         IssuesViewModel[] issuesViewModels = ecnDMO.GetAllTECNs().ToArray(); |         IssuesViewModel[] issuesViewModels = ecnDMO.GetAllTECNs().ToArray(); | ||||||
|         // IEnumerable<ApprovalLogHistory> GetECNApprovalLogHistory(int ecnNumber); |         // IEnumerable<ApprovalLogHistory> GetECNApprovalLogHistory(int ecnNumber); | ||||||
|         // IEnumerable<ECNAttachment> GetECNAttachments(int ecnNumber); |         // IEnumerable<ECNAttachment> GetECNAttachments(int ecnNumber); | ||||||
|         IssuesViewModel[] issuesViewModelsB = ecnDMO.GetECN_TECNPendingApprovals(appSettings.UserId).ToArray(); |         IssuesViewModel[] issuesViewModelsB = ecnDMO.GetECN_TECNPendingApprovals(appSettings.UserId).ToArray(); | ||||||
|         // string GetFileName(string attachmentID); |         // string GetFileName(string attachmentID); | ||||||
|         // IEnumerable<IssuesViewModel> GetMyConvertedTECNsToECNs(int userID, int maxDays); |         // IEnumerable<IssuesViewModel> GetMyConvertedTECNsToECNs(appSettings.UserId, int maxDays); | ||||||
|         // IEnumerable<IssuesViewModel> GetMyExpiredTECNs(int userID, int maxDays); |         // IEnumerable<IssuesViewModel> GetMyExpiredTECNs(appSettings.UserId, int maxDays); | ||||||
|         // IEnumerable<IssuesViewModel> GetMyExpiringTECNs(int userID, int maxDays); |         // IEnumerable<IssuesViewModel> GetMyExpiringTECNs(appSettings.UserId, int maxDays); | ||||||
|         // List<string> GetRejectionOrginatorEmailList(int ecnNumber); |         // List<string> GetRejectionOrginatorEmailList(int ecnNumber); | ||||||
|         int[] ints = ecnDMO.GetTECNNotificationUsers().ToArray(); |         int[] ints = ecnDMO.GetTECNNotificationUsers().ToArray(); | ||||||
|         // void InsertECNAttachment(ECNAttachment attach); |         // void InsertECNAttachment(ECNAttachment attach); | ||||||
|         // int PCRBExists(int pcrb); |         // int PCRBExists(int pcrb); | ||||||
|         // void ReassignOriginatorECN(int ecnNumber, int newOriginatorID, string comments, int userID); |         // void ReassignOriginatorECN(int ecnNumber, int newOriginatorID, string comments, appSettings.UserId); | ||||||
|         // void ReleaseLockOnDocument(int userID, int issueID); |         // void ReleaseLockOnDocument(appSettings.UserId, int issueID); | ||||||
|         // int ReSubmitDocument(int issueID, int userID, int documentType, out int allowedITAR, string descriptionOfChange, string reasonForChange, string ecnTypeString, out int newECNNumber, int categoryId); |         // int ReSubmitDocument(int issueID, appSettings.UserId, int documentType, out int allowedITAR, string descriptionOfChange, string reasonForChange, string ecnTypeString, out int newECNNumber, int categoryId); | ||||||
|         // void SaveAfterSubmitByApprover(int ecnNumber, string implementationDetails); |         // void SaveAfterSubmitByApprover(int ecnNumber, string implementationDetails); | ||||||
|         // void SetToExecutionStep(int ecnNumber, int userid, int documentType, string ecnTypeString); |         // void SetToExecutionStep(int ecnNumber, appSettings.UserId, int documentType, string ecnTypeString); | ||||||
|         // int SubmitDocument(int issueID, int userID, int documentType, out int allowedITAR); |         // int SubmitDocument(int issueID, appSettings.UserId, int documentType, out int allowedITAR); | ||||||
|         // int SubmitForCancellation(int issueID, byte currentStep, int userID, int documentType, string ecnType, int TECNOperationType); |         // int SubmitForCancellation(int issueID, byte currentStep, appSettings.UserId, int documentType, string ecnType, int TECNOperationType); | ||||||
|         // int SubmitTECNExtensionDocument(int issueID, int userID, int documentType, DateTime extensionDate); |         // int SubmitTECNExtensionDocument(int issueID, appSettings.UserId, int documentType, DateTime extensionDate); | ||||||
|         // void TECNExtensionLog(int ecnNumber, DateTime extensionDate); |         // void TECNExtensionLog(int ecnNumber, DateTime extensionDate); | ||||||
|         // void UpdateECNType(int ecnNumber, string ecnType); |         // void UpdateECNType(int ecnNumber, string ecnType); | ||||||
|         if (ecnDMO is null) { } |         if (ecnDMO is null) { } | ||||||
|  | |||||||
							
								
								
									
										108
									
								
								Fab2ApprovalTests/DMO/EngineeringChangeNoticeDMOTests.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										108
									
								
								Fab2ApprovalTests/DMO/EngineeringChangeNoticeDMOTests.cs
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,108 @@ | |||||||
|  | using System; | ||||||
|  | using System.Linq; | ||||||
|  |  | ||||||
|  | using Fab2ApprovalSystem.DMO; | ||||||
|  | using Fab2ApprovalSystem.Models; | ||||||
|  | using Fab2ApprovalSystem.ViewModels; | ||||||
|  |  | ||||||
|  | using Microsoft.AspNetCore.Mvc.Testing; | ||||||
|  | using Microsoft.Extensions.DependencyInjection; | ||||||
|  | using Microsoft.Extensions.Logging; | ||||||
|  |  | ||||||
|  | namespace Fab2ApprovalTests.DMO; | ||||||
|  |  | ||||||
|  | [TestClass] | ||||||
|  | public class EngineeringChangeNoticeDMOTests { | ||||||
|  |  | ||||||
|  | #pragma warning disable CS8618 | ||||||
|  |  | ||||||
|  |     private static ILogger? _Logger; | ||||||
|  |     private static TestContext _TestContext; | ||||||
|  |     private static WebApplicationFactory<Fab2ApprovalMKLink.Program> _WebApplicationFactory; | ||||||
|  |  | ||||||
|  | #pragma warning restore | ||||||
|  |  | ||||||
|  |     public static void SetGlobalVars(ILogger? logger, AppSettings appSettings) { | ||||||
|  |         logger?.LogDebug("Starting to set Fab2ApprovalSystem.Misc.GlobalVars"); | ||||||
|  |         Fab2ApprovalSystem.Misc.GlobalVars.AppSettings = appSettings; | ||||||
|  |         Fab2ApprovalSystem.Misc.GlobalVars.AttachmentUrl = appSettings.AttachmentUrl is null ? string.Empty : appSettings.AttachmentUrl; | ||||||
|  |         Fab2ApprovalSystem.Misc.GlobalVars.CA_BlankFormsLocation = appSettings.CABlankFormsLocation; | ||||||
|  |         Fab2ApprovalSystem.Misc.GlobalVars.DBConnection = appSettings.DBConnection; | ||||||
|  |         Fab2ApprovalSystem.Misc.GlobalVars.DB_CONNECTION_STRING = appSettings.DBConnectionString; | ||||||
|  |         Fab2ApprovalSystem.Misc.GlobalVars.hostURL = appSettings.HostURL; | ||||||
|  |         Fab2ApprovalSystem.Misc.GlobalVars.IS_INFINEON_DOMAIN = appSettings.IsInfineonDomain; | ||||||
|  |         Fab2ApprovalSystem.Misc.GlobalVars.MesaTemplateFiles = appSettings.MesaTemplateFiles; | ||||||
|  |         Fab2ApprovalSystem.Misc.GlobalVars.NDriveURL = appSettings.NDriveURL; | ||||||
|  |         Fab2ApprovalSystem.Misc.GlobalVars.SENDER_EMAIL = appSettings.SenderEmail; | ||||||
|  |         Fab2ApprovalSystem.Misc.GlobalVars.USER_ID = appSettings.UserId; | ||||||
|  |         Fab2ApprovalSystem.Misc.GlobalVars.USER_ISADMIN = appSettings.UserIsAdmin; | ||||||
|  |         Fab2ApprovalSystem.Misc.GlobalVars.WSR_URL = appSettings.WSR_URL; | ||||||
|  |         logger?.LogDebug("Finished setting Fab2ApprovalSystem.Misc.GlobalVars"); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     [ClassInitialize] | ||||||
|  |     public static void ClassInitAsync(TestContext testContext) { | ||||||
|  |         _TestContext = testContext; | ||||||
|  |         _WebApplicationFactory = new WebApplicationFactory<Fab2ApprovalMKLink.Program>(); | ||||||
|  |         IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; | ||||||
|  |         _Logger = serviceProvider.GetRequiredService<ILogger<Fab2ApprovalMKLink.Program>>(); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     private static void NonThrowTryCatch() { | ||||||
|  |         try { throw new Exception(); } catch (Exception) { } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     private static void EngineeringChangeNoticeDMO(ILogger? logger, AppSettings appSettings, int maxDays, int ecnNumber) { | ||||||
|  | #pragma warning disable IDE0059 | ||||||
|  |         SetGlobalVars(logger, appSettings); | ||||||
|  |         ECN_DMO ecnDMO = new(); | ||||||
|  |         ECN ecn = ecnDMO.GetECN(ecnNumber); | ||||||
|  |         // void CancelECN(int? ecnNumber); | ||||||
|  |         bool canSubmitECN = ecnDMO.CanSubmitECN(ecnNumber); | ||||||
|  |         // void DeleteDocument(int ecnNumber, appSettings.UserId, string ecnTypeString); | ||||||
|  |         // void DeleteECNAttachment(int attachmentID); | ||||||
|  |         // bool ECNApproveCancelled_ExpiredDocument(int issueID, byte step, string comments, out bool lastStep, appSettings.UserId, int documentType); | ||||||
|  |         // void ECNResetTECNAtRejection(int ecnNumber, appSettings.UserId, int docType); | ||||||
|  |         IssuesViewModel[] issuesViewModels = ecnDMO.GetAllTECNs().ToArray(); | ||||||
|  |         ApprovalLogHistory[] approvalLogHistories = ecnDMO.GetECNApprovalLogHistory(ecnNumber).ToArray(); | ||||||
|  |         ECNAttachment[] eCNAttachments = ecnDMO.GetECNAttachments(ecnNumber).ToArray(); | ||||||
|  |         IssuesViewModel[] issuesViewModelsB = ecnDMO.GetECN_TECNPendingApprovals(appSettings.UserId).ToArray(); | ||||||
|  |         // string GetFileName(string attachmentID); | ||||||
|  |         IssuesViewModel[] issuesViewModelsC = ecnDMO.GetMyConvertedTECNsToECNs(appSettings.UserId, maxDays).ToArray(); | ||||||
|  |         IssuesViewModel[] issuesViewModelsD = ecnDMO.GetMyExpiredTECNs(appSettings.UserId, maxDays).ToArray(); | ||||||
|  |         IssuesViewModel[] issuesViewModelsE = ecnDMO.GetMyExpiringTECNs(appSettings.UserId, maxDays).ToArray(); | ||||||
|  |         // List<string> GetRejectionOrginatorEmailList(int ecnNumber); | ||||||
|  |         int[] ints = ecnDMO.GetTECNNotificationUsers().ToArray(); | ||||||
|  |         // void InsertECNAttachment(ECNAttachment attach); | ||||||
|  |         // int PCRBExists(int pcrb); | ||||||
|  |         // void ReassignOriginatorECN(int ecnNumber, int newOriginatorID, string comments, appSettings.UserId); | ||||||
|  |         // void ReleaseLockOnDocument(appSettings.UserId, int issueID); | ||||||
|  |         // int ReSubmitDocument(int issueID, appSettings.UserId, int documentType, out int allowedITAR, string descriptionOfChange, string reasonForChange, string ecnTypeString, out int newECNNumber, int categoryId); | ||||||
|  |         // void SaveAfterSubmitByApprover(int ecnNumber, string implementationDetails); | ||||||
|  |         // void SetToExecutionStep(int ecnNumber, appSettings.UserId, int documentType, string ecnTypeString); | ||||||
|  |         // int SubmitDocument(int issueID, appSettings.UserId, int documentType, out int allowedITAR); | ||||||
|  |         // int SubmitForCancellation(int issueID, byte currentStep, appSettings.UserId, int documentType, string ecnType, int TECNOperationType); | ||||||
|  |         // int SubmitTECNExtensionDocument(int issueID, appSettings.UserId, int documentType, DateTime extensionDate); | ||||||
|  |         // void TECNExtensionLog(int ecnNumber, DateTime extensionDate); | ||||||
|  |         // void UpdateECNType(int ecnNumber, string ecnType); | ||||||
|  |         if (ecnDMO is null) { } | ||||||
|  | #pragma warning restore IDE0059 | ||||||
|  |     } | ||||||
|  |  | ||||||
|  | #if Release | ||||||
|  |     [Ignore] | ||||||
|  | #endif | ||||||
|  |     [TestMethod] | ||||||
|  |     [DataRow(1, 82700)] | ||||||
|  |     public void EngineeringChangeNoticeIsAttachedOnlyDMO(int maxDays, int ecnNumber) { | ||||||
|  |         _Logger?.LogInformation("Starting Web Application"); | ||||||
|  |         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||||
|  |         AppSettings? appSettings = serviceProvider?.GetRequiredService<AppSettings>(); | ||||||
|  |         Assert.IsTrue(appSettings is not null); | ||||||
|  |         if (System.Diagnostics.Debugger.IsAttached) | ||||||
|  |             EngineeringChangeNoticeDMO(_Logger, appSettings, maxDays, ecnNumber); | ||||||
|  |         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||||
|  |         NonThrowTryCatch(); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  | } | ||||||
| @ -55,9 +55,9 @@ public class LotDispositionDMOTests { | |||||||
|     private static void LotDispositionDMO(ILogger? logger, AppSettings appSettings) { |     private static void LotDispositionDMO(ILogger? logger, AppSettings appSettings) { | ||||||
| #pragma warning disable IDE0059 | #pragma warning disable IDE0059 | ||||||
|         SetGlobalVars(logger, appSettings); |         SetGlobalVars(logger, appSettings); | ||||||
|         LotDispositionDMO lotDispositionDMO = new(appSettings); |         LotDispositionDMO lotDispositionDMO = new(); | ||||||
|         // void DeleteAllLotDispoLot(int issueID); |         // void DeleteAllLotDispoLot(int issueID); | ||||||
|         // void DeleteCADocument(int CANo, int userID, string caTypeString); |         // void DeleteCADocument(int CANo, appSettings.UserId, string caTypeString); | ||||||
|         // void DeleteLotDispoAttachment(int attachmentID); |         // void DeleteLotDispoAttachment(int attachmentID); | ||||||
|         // void DeleteLotDispoLot(int lotID); |         // void DeleteLotDispoLot(int lotID); | ||||||
|         AuditList[] auditLists = lotDispositionDMO.GetAuditList(appSettings.UserId).ToArray(); |         AuditList[] auditLists = lotDispositionDMO.GetAuditList(appSettings.UserId).ToArray(); | ||||||
| @ -68,8 +68,8 @@ public class LotDispositionDMOTests { | |||||||
|         IssuesViewModel[] issuesViewModelsB = lotDispositionDMO.GetECNList(appSettings.UserId).ToArray(); |         IssuesViewModel[] issuesViewModelsB = lotDispositionDMO.GetECNList(appSettings.UserId).ToArray(); | ||||||
|         // string GetFileName(string attachmentID); |         // string GetFileName(string attachmentID); | ||||||
|         // Attachment[] GetLotDispoAttachments(int issueID); |         // Attachment[] GetLotDispoAttachments(int issueID); | ||||||
|         // LotDisposition GetLotDispositionItem(int issueID, out int isITAR, int userID); |         // LotDisposition GetLotDispositionItem(int issueID, out int isITAR, appSettings.UserId); | ||||||
|         // LotDisposition GetLotDispositionItemForRead(int issueID, out int isITAR, int userID); |         // LotDisposition GetLotDispositionItemForRead(int issueID, out int isITAR, appSettings.UserId); | ||||||
|         IssuesViewModel[] issuesViewModelsC = lotDispositionDMO.GetLotDispositionList(appSettings.UserId).ToArray(); |         IssuesViewModel[] issuesViewModelsC = lotDispositionDMO.GetLotDispositionList(appSettings.UserId).ToArray(); | ||||||
|         // Lot[] GetLotDispositionLots(int issueID); |         // Lot[] GetLotDispositionLots(int issueID); | ||||||
|         // LotDispositionLotSummaryViewModel GetLotDispositionLotSummary(int issueID); |         // LotDispositionLotSummaryViewModel GetLotDispositionLotSummary(int issueID); | ||||||
| @ -91,9 +91,9 @@ public class LotDispositionDMOTests { | |||||||
|         // int InsertLot(Lot lot, bool getLotInfo); |         // int InsertLot(Lot lot, bool getLotInfo); | ||||||
|         // LotDisposition InsertLotDisposition(LotDisposition lotDispo); |         // LotDisposition InsertLotDisposition(LotDisposition lotDispo); | ||||||
|         // void InsertLotDispositionAttachment(Attachment attach); |         // void InsertLotDispositionAttachment(Attachment attach); | ||||||
|         // void ReleaseLockOnDocument(int userID, int issueID); |         // void ReleaseLockOnDocument(appSettings.UserId, int issueID); | ||||||
|         // Lot[] SearchLots(string searchText); |         // Lot[] SearchLots(string searchText); | ||||||
|         // int SubmitDocument(int issueID, bool peRequired, bool mrbRequired, int userID); |         // int SubmitDocument(int issueID, bool peRequired, bool mrbRequired, appSettings.UserId); | ||||||
|         // void UpdateLotDispoLot(Lot lot); |         // void UpdateLotDispoLot(Lot lot); | ||||||
|         // void UpdateLotDisposition(LotDisposition lotDispo); |         // void UpdateLotDisposition(LotDisposition lotDispo); | ||||||
|         // void UpdateLotScrapReleaseStatus(ScrapLot scrap); |         // void UpdateLotScrapReleaseStatus(ScrapLot scrap); | ||||||
|  | |||||||
| @ -53,17 +53,17 @@ public class LotTravelerDMOTests { | |||||||
|     private static void LotTravelerDMO(ILogger? logger, AppSettings appSettings) { |     private static void LotTravelerDMO(ILogger? logger, AppSettings appSettings) { | ||||||
| #pragma warning disable IDE0059 | #pragma warning disable IDE0059 | ||||||
|         SetGlobalVars(logger, appSettings); |         SetGlobalVars(logger, appSettings); | ||||||
|         LotTravelerDMO lotTravelerDMO = new(appSettings); |         LotTravelerDMO lotTravelerDMO = new(); | ||||||
|         // int CanAddLocationOperation(LTLotTravelerHoldSteps model); |         // int CanAddLocationOperation(LTLotTravelerHoldSteps model); | ||||||
|         // int CreateLotTravelerRevision(LTLotTravelerHoldSteps model, int userID); |         // int CreateLotTravelerRevision(LTLotTravelerHoldSteps model, appSettings.UserId); | ||||||
|         // void CreateTraveler(int ltLotID, int workRequestID, int UserID); |         // void CreateTraveler(int ltLotID, int workRequestID, appSettings.UserId); | ||||||
|         // int CreateWorkRequestRevision(LTWorkRequest data, int userID); |         // int CreateWorkRequestRevision(LTWorkRequest data, appSettings.UserId); | ||||||
|         // void DeleteLot(int ltLotID); |         // void DeleteLot(int ltLotID); | ||||||
|         // IEnumerable<LTLot> GetLotList(int workRequestID); |         // IEnumerable<LTLot> GetLotList(int workRequestID); | ||||||
|         // IEnumerable<LTLot> GetLotListBasedOnSWRNumber(int swrNumber); |         // IEnumerable<LTLot> GetLotListBasedOnSWRNumber(int swrNumber); | ||||||
|         // IEnumerable<LotWithTraveler> GetLotsWithTraveler(int workRequestID); |         // IEnumerable<LotWithTraveler> GetLotsWithTraveler(int workRequestID); | ||||||
|         // LTLotTravelerHeaderViewModel GetLotTravelerHeaderForReadOnly(int ltLotID, int revisionNumber); |         // LTLotTravelerHeaderViewModel GetLotTravelerHeaderForReadOnly(int ltLotID, int revisionNumber); | ||||||
|         // LTLotTravelerHeaderViewModel GetLotTravelerHeaderForUpdate(int ltLotID, int UserID); |         // LTLotTravelerHeaderViewModel GetLotTravelerHeaderForUpdate(int ltLotID, appSettings.UserId); | ||||||
|         // IEnumerable<LTLotTravelerHoldSteps> GetLotTravelerHolStepsByRevision(int ltLotID, int revisionNumber); |         // IEnumerable<LTLotTravelerHoldSteps> GetLotTravelerHolStepsByRevision(int ltLotID, int revisionNumber); | ||||||
|         // IEnumerable<RevisionHistory> GetLotTravelerRevisionHistory(int lotID); |         // IEnumerable<RevisionHistory> GetLotTravelerRevisionHistory(int lotID); | ||||||
|         // IEnumerable<LTLotTravelerHoldSteps> GetLotTravHoldSteps(int ltLotID); |         // IEnumerable<LTLotTravelerHoldSteps> GetLotTravHoldSteps(int ltLotID); | ||||||
| @ -76,15 +76,15 @@ public class LotTravelerDMOTests { | |||||||
|         // IEnumerable<RevisionHistory> GetWorkReqRevisionHistory(int swrNumber); |         // IEnumerable<RevisionHistory> GetWorkReqRevisionHistory(int swrNumber); | ||||||
|         // List<Revision> GetWorkReqRevisions(int swrNumber); |         // List<Revision> GetWorkReqRevisions(int swrNumber); | ||||||
|         // void InsertLot(LTLot lot); |         // void InsertLot(LTLot lot); | ||||||
|         // int InsertLotTravelerHoldStep(LTLotTravelerHoldSteps model, int userID); |         // int InsertLotTravelerHoldStep(LTLotTravelerHoldSteps model, appSettings.UserId); | ||||||
|         // void ReassignOriginator(int workRequestID, int newOriginatorID, string comments, int userID); |         // void ReassignOriginator(int workRequestID, int newOriginatorID, string comments, appSettings.UserId); | ||||||
|         // void ReleaseLockOnDocument(int userID, int workRequestID); |         // void ReleaseLockOnDocument(appSettings.UserId, int workRequestID); | ||||||
|         // void ReleaseLockOnLotTravelerUpdateDoc(int userID, int ltLotID); |         // void ReleaseLockOnLotTravelerUpdateDoc(appSettings.UserId, int ltLotID); | ||||||
|         // void RestoreLotTravToPrevRevision(int prevLotTravRevID, int newLotTravRevID); |         // void RestoreLotTravToPrevRevision(int prevLotTravRevID, int newLotTravRevID); | ||||||
|         // int SubmitDocument(int workRequestID, int userID, int documentType, out int allowedITAR); |         // int SubmitDocument(int workRequestID, appSettings.UserId, int documentType, out int allowedITAR); | ||||||
|         // int UpdateLotTravelerHoldStep(LTLotTravelerHoldSteps model, int userID); |         // int UpdateLotTravelerHoldStep(LTLotTravelerHoldSteps model, appSettings.UserId); | ||||||
|         // void UpdateLotTravlerExecution(int lotTravHoldStepID, string taskComments, bool CompletedFlag, int userID); |         // void UpdateLotTravlerExecution(int lotTravHoldStepID, string taskComments, bool CompletedFlag, appSettings.UserId); | ||||||
|         // int UpdateRevisedLotTravelerHoldStep(LTLotTravelerHoldSteps model, int userID); |         // int UpdateRevisedLotTravelerHoldStep(LTLotTravelerHoldSteps model, appSettings.UserId); | ||||||
|         if (lotTravelerDMO is null) { } |         if (lotTravelerDMO is null) { } | ||||||
| #pragma warning restore IDE0059 | #pragma warning restore IDE0059 | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -54,9 +54,9 @@ public class PartsRequestDMOTests { | |||||||
|     private static void PartsRequestDMO(ILogger? logger, AppSettings appSettings) { |     private static void PartsRequestDMO(ILogger? logger, AppSettings appSettings) { | ||||||
| #pragma warning disable IDE0059 | #pragma warning disable IDE0059 | ||||||
|         SetGlobalVars(logger, appSettings); |         SetGlobalVars(logger, appSettings); | ||||||
|         PartsRequestDMO partsRequestDMO = new(appSettings); |         PartsRequestDMO partsRequestDMO = new(); | ||||||
|         // void DeleteAttachment(int attachmentID); |         // void DeleteAttachment(int attachmentID); | ||||||
|         // void DeleteDocument(int prNumber, int userid); |         // void DeleteDocument(int prNumber, appSettings.UserId); | ||||||
|         // PartsRequest Get(int PRNumber); |         // PartsRequest Get(int PRNumber); | ||||||
|         // IEnumerable<ApprovalLogHistory> GetApprovalLogHistory(int prNumber); |         // IEnumerable<ApprovalLogHistory> GetApprovalLogHistory(int prNumber); | ||||||
|         // IEnumerable<PartsRequestAttachmentList> GetAttachments(int prNumber); |         // IEnumerable<PartsRequestAttachmentList> GetAttachments(int prNumber); | ||||||
| @ -65,7 +65,7 @@ public class PartsRequestDMOTests { | |||||||
|         PartsRequestList[] partsRequestLists = partsRequestDMO.GetPartsRequestList().ToArray(); |         PartsRequestList[] partsRequestLists = partsRequestDMO.GetPartsRequestList().ToArray(); | ||||||
|         // void Insert(PartsRequest pr); |         // void Insert(PartsRequest pr); | ||||||
|         // void InsertAttachment(PartsRequestAttachment attach); |         // void InsertAttachment(PartsRequestAttachment attach); | ||||||
|         // void Submit(int prNumber, int userID); |         // void Submit(int prNumber, appSettings.UserId); | ||||||
|         // void Update(PartsRequest pr); |         // void Update(PartsRequest pr); | ||||||
|         if (partsRequestDMO is null) { } |         if (partsRequestDMO is null) { } | ||||||
| #pragma warning restore IDE0059 | #pragma warning restore IDE0059 | ||||||
|  | |||||||
| @ -60,8 +60,8 @@ public class TrainingDMOTests { | |||||||
|         // bool CheckTrainingStatus(int trainingAssignmentID); |         // bool CheckTrainingStatus(int trainingAssignmentID); | ||||||
|         // bool CheckValidDocAck(int docAckId); |         // bool CheckValidDocAck(int docAckId); | ||||||
|         // int Create(int issueId); |         // int Create(int issueId); | ||||||
|         // int CreateAssignment(int trainingId, int userId); |         // int CreateAssignment(int trainingId, appSettings.UserId); | ||||||
|         // void DeleteAssignmentByUserId(int userId); |         // void DeleteAssignmentByUserId(appSettings.UserId); | ||||||
|         // void DeleteTraining(int trainingId); |         // void DeleteTraining(int trainingId); | ||||||
|         // void DeleteTrainingAssignment(int trainingAssignmentId); |         // void DeleteTrainingAssignment(int trainingAssignmentId); | ||||||
|         // void DeleteTrainingDocAck(int trainingAssignmentId); |         // void DeleteTrainingDocAck(int trainingAssignmentId); | ||||||
| @ -75,15 +75,15 @@ public class TrainingDMOTests { | |||||||
|         // List<int> GetTrainees(int groupId); |         // List<int> GetTrainees(int groupId); | ||||||
|         // Training GetTraining(int trainingId); |         // Training GetTraining(int trainingId); | ||||||
|         // List<TrainingAssignment> GetTrainingAssignments(int TrainingID); |         // List<TrainingAssignment> GetTrainingAssignments(int TrainingID); | ||||||
|         // List<TrainingAssignment> GetTrainingAssignmentsByUser(int TrainingID, int userID); |         // List<TrainingAssignment> GetTrainingAssignmentsByUser(int TrainingID, appSettings.UserId); | ||||||
|         // List<TrainingAssignment> GetTrainingAssignmentsByUserID(int userID); |         // List<TrainingAssignment> GetTrainingAssignmentsByUserID(appSettings.UserId); | ||||||
|         // TrainingGroup GetTrainingGroupByID(int groupId); |         // TrainingGroup GetTrainingGroupByID(int groupId); | ||||||
|         // TrainingGroup[] trainingGroups = trainingDMO.GetTrainingGroups().ToArray(); |         // TrainingGroup[] trainingGroups = trainingDMO.GetTrainingGroups().ToArray(); | ||||||
|         // int GetTrainingId(int issueId); |         // int GetTrainingId(int issueId); | ||||||
|         // int GetTrainingIdByAssignment(int trainingAssignmentID); |         // int GetTrainingIdByAssignment(int trainingAssignmentID); | ||||||
|         // Training[] trainingsC = trainingDMO.GetTrainings().ToArray(); |         // Training[] trainingsC = trainingDMO.GetTrainings().ToArray(); | ||||||
|         // bool IsUserAssigned(int userId, int trainingId); |         // bool IsUserAssigned(appSettings.UserId, int trainingId); | ||||||
|         // bool isUserTrainingMember(int groupId, int userId); |         // bool isUserTrainingMember(int groupId, appSettings.UserId); | ||||||
|         // void reOpenTraining(int trainingId); |         // void reOpenTraining(int trainingId); | ||||||
|         // void SetTrainingFlag(int ECNNumber); |         // void SetTrainingFlag(int ECNNumber); | ||||||
|         // void UpdateAssignmentStatus(int trainingAssignmentID); |         // void UpdateAssignmentStatus(int trainingAssignmentID); | ||||||
|  | |||||||
| @ -50,22 +50,25 @@ public class WorkflowDMOTests { | |||||||
|         try { throw new Exception(); } catch (Exception) { } |         try { throw new Exception(); } catch (Exception) { } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     private static void WorkflowDMO(ILogger? logger, AppSettings appSettings) { |     private static void WorkflowDMO(ILogger? logger, AppSettings appSettings, int issueID, string comments, int documentType) { | ||||||
| #pragma warning disable IDE0059 | #pragma warning disable IDE0059 | ||||||
|  |         bool isLastStep; | ||||||
|         SetGlobalVars(logger, appSettings); |         SetGlobalVars(logger, appSettings); | ||||||
|         WorkflowDMO workflowDMO = new(); |         ECN_DMO ecnDMO = new(); | ||||||
|  |         ECN ecn = ecnDMO.GetECN(issueID); | ||||||
|  |         WorkflowDMO workflowDMO = new();         | ||||||
|         // string AddAdditionalApproval(int issueID, string userIDs, byte step, int documentType); |         // string AddAdditionalApproval(int issueID, string userIDs, byte step, int documentType); | ||||||
|         // string AddEECNApproval(int ecnNumber, byte step, int documentType, string engUserIDs, string opUserIDs); |         // string AddEECNApproval(int ecnNumber, byte step, int documentType, string engUserIDs, string opUserIDs); | ||||||
|         // bool Approve(int issueID, byte step, string comments, out bool lastStep, int userID, int documentType, int workFlowNumber); |         bool check = workflowDMO.Approve(appSettings, issueID, ecn.CurrentStep, comments, out isLastStep, appSettings.UserId, documentType, ecn.WorkFlowNumber); | ||||||
|         // string DelegateDocumentApproval(int issueID, int delegateFromUser, int delegateToUser); |         // string DelegateDocumentApproval(int issueID, int delegateFromUser, int delegateToUser); | ||||||
|         // string GetApproversForCancelled_ExpiredTECNDocs(int ecnNumber); |         // string GetApproversForCancelled_ExpiredTECNDocs(int ecnNumber); | ||||||
|         // string GetSubRoleItems(int issueID, int docType); |         // string GetSubRoleItems(int issueID, int docType); | ||||||
|         // string GetSubRolesForPartsRequestNextStep(int prNumber); |         // string GetSubRolesForPartsRequestNextStep(int prNumber); | ||||||
|         // WorkflowSteps GetWorkflowStep(int docTypeID, int wfNumber, int stepNumber); |         // WorkflowSteps GetWorkflowStep(int docTypeID, int wfNumber, int stepNumber); | ||||||
|         // string ReAssignApproval(int issueID, int assignedFromUser, int assignedToUser, byte step, int docType); |         // string ReAssignApproval(int issueID, int assignedFromUser, int assignedToUser, byte step, int docType); | ||||||
|         // bool Recall(int issueID, byte step, string comments, int userID, int docType); |         // bool Recall(int issueID, byte step, string comments, appSettings.UserId, int docType); | ||||||
|         // bool Reject(int issueID, byte step, string comments, int userID, int docType); |         // bool Reject(int issueID, byte step, string comments, appSettings.UserId, int docType); | ||||||
|         // void RejectTECNExtension(int ecnNumber, byte step, string comments, int userID, int docType); |         // void RejectTECNExtension(int ecnNumber, byte step, string comments, appSettings.UserId, int docType); | ||||||
|         if (workflowDMO is null) { } |         if (workflowDMO is null) { } | ||||||
| #pragma warning restore IDE0059 | #pragma warning restore IDE0059 | ||||||
|     } |     } | ||||||
| @ -74,13 +77,14 @@ public class WorkflowDMOTests { | |||||||
|     [Ignore] |     [Ignore] | ||||||
| #endif | #endif | ||||||
|     [TestMethod] |     [TestMethod] | ||||||
|     public void WorkflowDMOIsAttachedOnly() { |     [DataRow(82700, "comment", 3)] | ||||||
|  |     public void WorkflowDMOIsAttachedOnly(int issueID, string comments, int documentType) { | ||||||
|         _Logger?.LogInformation("Starting Web Application"); |         _Logger?.LogInformation("Starting Web Application"); | ||||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; |         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||||
|         AppSettings? appSettings = serviceProvider?.GetRequiredService<AppSettings>(); |         AppSettings? appSettings = serviceProvider?.GetRequiredService<AppSettings>(); | ||||||
|         Assert.IsTrue(appSettings is not null); |         Assert.IsTrue(appSettings is not null); | ||||||
|         if (System.Diagnostics.Debugger.IsAttached) |         if (System.Diagnostics.Debugger.IsAttached) | ||||||
|             WorkflowDMO(_Logger, appSettings); |             WorkflowDMO(_Logger, appSettings, issueID, comments, documentType); | ||||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); |         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||||
|         NonThrowTryCatch(); |         NonThrowTryCatch(); | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -102,7 +102,7 @@ public class CorrectiveActionTests { | |||||||
|     internal static void TestCorrectiveAction(ILogger? logger, AppSettings appSettings, int caNo) { |     internal static void TestCorrectiveAction(ILogger? logger, AppSettings appSettings, int caNo) { | ||||||
|         SetGlobalVars(logger, appSettings); |         SetGlobalVars(logger, appSettings); | ||||||
|         CorrectiveAction ca; |         CorrectiveAction ca; | ||||||
|         CorrectiveActionDMO caDMO = new(appSettings); |         CorrectiveActionDMO caDMO = new(); | ||||||
|         ca = caDMO.GetCAItemReadOnly(caNo, appSettings.UserId); |         ca = caDMO.GetCAItemReadOnly(caNo, appSettings.UserId); | ||||||
|         if (ca is null) |         if (ca is null) | ||||||
|             throw new Exception($"{nameof(ca)}"); |             throw new Exception($"{nameof(ca)}"); | ||||||
|  | |||||||
| @ -30,4 +30,11 @@ | |||||||
|         <ProjectReference Include="..\MesaFabApproval.Shared\MesaFabApproval.Shared.csproj" /> |         <ProjectReference Include="..\MesaFabApproval.Shared\MesaFabApproval.Shared.csproj" /> | ||||||
|     </ItemGroup> |     </ItemGroup> | ||||||
|  |  | ||||||
|  |     <ItemGroup> | ||||||
|  |       <Content Update="wwwroot\appsettings.Development.json"> | ||||||
|  |         <ExcludeFromSingleFile>true</ExcludeFromSingleFile> | ||||||
|  |         <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> | ||||||
|  |       </Content> | ||||||
|  |     </ItemGroup> | ||||||
|  |  | ||||||
| </Project> | </Project> | ||||||
|  | |||||||
| @ -19,6 +19,7 @@ | |||||||
|                               @bind-Value="@document.DocNumbers" |                               @bind-Value="@document.DocNumbers" | ||||||
|                               @bind-Text="@document.DocNumbers" |                               @bind-Text="@document.DocNumbers" | ||||||
|                               Immediate |                               Immediate | ||||||
|  |                               Required | ||||||
|                               AutoGrow |                               AutoGrow | ||||||
|                               AutoFocus /> |                               AutoFocus /> | ||||||
|                 @if (DocNumberIsNA()) { |                 @if (DocNumberIsNA()) { | ||||||
| @ -49,8 +50,8 @@ | |||||||
|         </MudPaper> |         </MudPaper> | ||||||
|     </DialogContent> |     </DialogContent> | ||||||
|     <DialogActions> |     <DialogActions> | ||||||
|         @if ((DocNumberIsNA() && !string.IsNullOrWhiteSpace(document.Comment)) ||  |         @if (!string.IsNullOrWhiteSpace(document.DocNumbers) && ((DocNumberIsNA() && !string.IsNullOrWhiteSpace(document.Comment)) ||  | ||||||
|              (!DocNumberIsNA() && ecnNoIsValid)) { |              (!DocNumberIsNA() && ecnNoIsValid))) { | ||||||
|             <MudButton Variant="Variant.Filled" |             <MudButton Variant="Variant.Filled" | ||||||
|                        Color="Color.Tertiary" |                        Color="Color.Tertiary" | ||||||
|                        Class="m1-auto" |                        Class="m1-auto" | ||||||
| @ -111,6 +112,10 @@ | |||||||
|                 document.CompletedDate = DateTime.Now; |                 document.CompletedDate = DateTime.Now; | ||||||
|             } |             } | ||||||
|  |  | ||||||
|  |             if (string.IsNullOrWhiteSpace(document.DocNumbers)) { | ||||||
|  |                 throw new Exception("Document Numbers cannot be empty"); | ||||||
|  |             } | ||||||
|  |  | ||||||
|             if (!DocNumberIsNA() && !ecnNoIsValid)  |             if (!DocNumberIsNA() && !ecnNoIsValid)  | ||||||
|                 throw new Exception($"{document.ECNNumber} is not a valid ECN#"); |                 throw new Exception($"{document.ECNNumber} is not a valid ECN#"); | ||||||
|             if (DocNumberIsNA() && string.IsNullOrWhiteSpace(document.Comment)) |             if (DocNumberIsNA() && string.IsNullOrWhiteSpace(document.Comment)) | ||||||
| @ -135,7 +140,9 @@ | |||||||
|  |  | ||||||
|     private bool DocNumberIsNA() { |     private bool DocNumberIsNA() { | ||||||
|         if (document.DocNumbers.ToLower().Equals("na") || |         if (document.DocNumbers.ToLower().Equals("na") || | ||||||
|             document.DocNumbers.ToLower().Equals("n/a")) { |             document.DocNumbers.ToLower().Equals("n/a") || | ||||||
|  |             document.DocNumbers.ToLower().Equals("n a") || | ||||||
|  |             document.DocNumbers.ToLower().Equals("not applicable")) { | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|         return false; |         return false; | ||||||
|  | |||||||
| @ -236,13 +236,14 @@ | |||||||
|                 int currentStagePendingActionItemCount = currentStageActionItems.Where(a => a.ClosedStatus == false).Count(); |                 int currentStagePendingActionItemCount = currentStageActionItems.Where(a => a.ClosedStatus == false).Count(); | ||||||
|  |  | ||||||
|                 bool allActionItemsComplete = current_i < 3 || actionItems.Where(a => a.ClosedStatus == false).Count() == 0; |                 bool allActionItemsComplete = current_i < 3 || actionItems.Where(a => a.ClosedStatus == false).Count() == 0; | ||||||
|  |                 bool actionItemsAreComplete = actionItems.Where(a => a.ClosedStatus == false).Count() == 0; | ||||||
|  |  | ||||||
|                 bool attachmentsMissing = currentStageAttachments.Count() == 0; |                 bool attachmentsMissing = currentStageAttachments.Count() == 0; | ||||||
|                 bool actionItemsIncomplete = current_i < 3 && currentStagePendingActionItemCount > 0; |                 bool actionItemsIncomplete = current_i < 3 && currentStagePendingActionItemCount > 0; | ||||||
|                 bool affectedDocumentsIncomplete = current_i == 3 && pcr3Documents.Where(d => d.CompletedByID <= 0).Count() > 0; |                 bool affectedDocumentsIncomplete = current_i == 3 && pcr3Documents.Where(d => d.CompletedByID <= 0).Count() > 0; | ||||||
|                 bool approvalsIncomplete = currentStageApprovals.Count() > 0 && currentStagePendingApprovalsCount > 0; |                 bool approvalsIncomplete = currentStageApprovals.Count() > 0 && currentStagePendingApprovalsCount > 0; | ||||||
|  |  | ||||||
|                 <MudExpansionPanel Expanded="@(previousStageSubmitted && (attachmentsMissing || actionItemsIncomplete ||  |                 <MudExpansionPanel Class="m-2" Expanded="@(previousStageSubmitted && (attachmentsMissing || actionItemsIncomplete ||  | ||||||
|                                                 affectedDocumentsIncomplete || !currentStageSubmitted || approvalsIncomplete))"> |                                                 affectedDocumentsIncomplete || !currentStageSubmitted || approvalsIncomplete))"> | ||||||
|                     <TitleContent> |                     <TitleContent> | ||||||
|                         <MudText Typo="Typo.h4" Align="Align.Center">@($"PCR {current_i}")</MudText> |                         <MudText Typo="Typo.h4" Align="Align.Center">@($"PCR {current_i}")</MudText> | ||||||
| @ -495,7 +496,17 @@ | |||||||
|                                         <MudTd DataLabel="Document Type">@context.DocType</MudTd> |                                         <MudTd DataLabel="Document Type">@context.DocType</MudTd> | ||||||
|                                         <MudTd DataLabel="Document Numbers">@context.DocNumbers</MudTd> |                                         <MudTd DataLabel="Document Numbers">@context.DocNumbers</MudTd> | ||||||
|                                         <MudTd DataLabel="Comments">@context.Comment</MudTd> |                                         <MudTd DataLabel="Comments">@context.Comment</MudTd> | ||||||
|                                         <MudTd DataLabel="ECN#">@context.GetEcnNumberString()</MudTd> |                                         <MudTd DataLabel="ECN#"> | ||||||
|  |                                             @if (string.IsNullOrWhiteSpace(context.GetEcnNumberString())) { | ||||||
|  |                                                 context.GetEcnNumberString(); | ||||||
|  |                                             } else { | ||||||
|  |                                                 <MudLink  | ||||||
|  |                                                     Href=@($"{config["OldFabApprovalUrl"]}/ECN/Edit?IssueID={context.GetEcnNumberString()}") | ||||||
|  |                                                     Target="_blank"> | ||||||
|  |                                                     @context.GetEcnNumberString() | ||||||
|  |                                                 </MudLink> | ||||||
|  |                                             } | ||||||
|  |                                         </MudTd> | ||||||
|                                         <MudTd DataLabel="Closed Date">@(DateTimeUtilities.GetDateAsStringMaxDefault(context.CompletedDate))</MudTd> |                                         <MudTd DataLabel="Closed Date">@(DateTimeUtilities.GetDateAsStringMaxDefault(context.CompletedDate))</MudTd> | ||||||
|                                         <MudTd DataLabel="Closed By"> |                                         <MudTd DataLabel="Closed By"> | ||||||
|                                             @(context.CompletedBy is null ? string.Empty : context.CompletedBy.GetFullName()) |                                             @(context.CompletedBy is null ? string.Empty : context.CompletedBy.GetFullName()) | ||||||
| @ -568,6 +579,11 @@ | |||||||
|  |  | ||||||
|                             <MudDivider DividerType="DividerType.Middle" Class="my-1" /> |                             <MudDivider DividerType="DividerType.Middle" Class="my-1" /> | ||||||
|                             <MudText Typo="Typo.h5" Align="Align.Center">Approvers</MudText> |                             <MudText Typo="Typo.h5" Align="Align.Center">Approvers</MudText> | ||||||
|  |                             @if (!actionItemsAreComplete && current_i == 3) { | ||||||
|  |                                 <MudText Align="Align.Center" Color="Color.Secondary" Typo="Typo.subtitle1"> | ||||||
|  |                                     All actions must be completed before PCR3 is submitted for approval | ||||||
|  |                                 </MudText> | ||||||
|  |                             } | ||||||
|                             <MudTable Items="@approvals.Where(a => a.Step == current_i).OrderBy(a => a.CompletedDate)" |                             <MudTable Items="@approvals.Where(a => a.Step == current_i).OrderBy(a => a.CompletedDate)" | ||||||
|                                         Class="m-2" |                                         Class="m-2" | ||||||
|                                         Striped="true" |                                         Striped="true" | ||||||
|  | |||||||
| @ -0,0 +1,4 @@ | |||||||
|  | { | ||||||
|  |   "OldFabApprovalUrl": "https://mesaapproval-test.mes.infineon.com", | ||||||
|  |   "FabApprovalApiBaseUrl": "https://mesaapproval-test.mes.infineon.com:7114" | ||||||
|  | } | ||||||
| @ -1,4 +1,4 @@ | |||||||
| { | { | ||||||
|   "OldFabApprovalUrl": "https://mesaapproval-test.mes.infineon.com", |   "OldFabApprovalUrl": "https://mesaapproval.mes.infineon.com", | ||||||
|   "FabApprovalApiBaseUrl": "https://mesaapproval-test.mes.infineon.com:7114" |   "FabApprovalApiBaseUrl": "https://mesaapproval.mes.infineon.com:7114" | ||||||
| } | } | ||||||
| @ -6,7 +6,7 @@ public class PCR3Document { | |||||||
|     public int ID { get; set; } |     public int ID { get; set; } | ||||||
|     public required int PlanNumber { get; set; } |     public required int PlanNumber { get; set; } | ||||||
|     public required string DocType { get; set; } |     public required string DocType { get; set; } | ||||||
|     public string DocNumbers { get; set; } = "N/A"; |     public string DocNumbers { get; set; } = string.Empty; | ||||||
|     public DateTime CompletedDate { get; set; } = DateTimeUtilities.MAX_DT; |     public DateTime CompletedDate { get; set; } = DateTimeUtilities.MAX_DT; | ||||||
|     public int CompletedByID { get; set; } = 0; |     public int CompletedByID { get; set; } = 0; | ||||||
|     public User? CompletedBy { get; set; } |     public User? CompletedBy { get; set; } | ||||||
|  | |||||||
| @ -15,10 +15,11 @@ trigger: | |||||||
|  |  | ||||||
| variables: | variables: | ||||||
|   buildConfiguration: "Release" |   buildConfiguration: "Release" | ||||||
|   targetFrameworkVersion: 'v4.8' |   targetFrameworkVersion: "v4.8" | ||||||
|   coreVersion: 'na' |   coreVersion: "na" | ||||||
|   assemblyTitle: 'Fab2ApprovalSystem' |   assemblyTitle: "Fab2ApprovalSystem" | ||||||
|   architecture: 'x64' |   architecture: "x64" | ||||||
|  |   msBuild: "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" | ||||||
|  |  | ||||||
| stages: | stages: | ||||||
|   - stage: Development |   - stage: Development | ||||||
| @ -28,46 +29,18 @@ stages: | |||||||
|       demands: Fab2ApprovalSystem-Dev |       demands: Fab2ApprovalSystem-Dev | ||||||
|     variables: |     variables: | ||||||
|       ASPNETCORE_ENVIRONMENT: "Development" |       ASPNETCORE_ENVIRONMENT: "Development" | ||||||
|       configuration: 'Debug' |       configuration: "Debug" | ||||||
|     jobs: |     jobs: | ||||||
|     - job: Debug |       - job: Debug | ||||||
|       steps: |  | ||||||
|         - script: | |  | ||||||
|             echo BuildId: $(Build.BuildId) |  | ||||||
|             echo Build reason: $(Build.Reason) |  | ||||||
|             echo Repo Id: $(Build.Repository.Id) |  | ||||||
|             echo Repo name: $(Build.Repository.Name) |  | ||||||
|             echo Source version: $(Build.SourceVersion) |  | ||||||
|             echo Core version: $(CoreVersion) |  | ||||||
|             echo Build configuration: $(BuildConfiguration) |  | ||||||
|             echo Configuration: $(Configuration) |  | ||||||
|             echo Target Framework version: $(TargetFrameworkVersion) |  | ||||||
|             echo Assembly title: $(AssemblyTitle) |  | ||||||
|           displayName: "Echo Check" |  | ||||||
|  |  | ||||||
|          |  | ||||||
|         - script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Restore /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(BuildConfiguration);TargetFrameworkVersion=$(TargetFrameworkVersion) /p:RestoreSources=D:/nupkg $(AssemblyTitle).csproj' |  | ||||||
|           workingDirectory: Fab2ApprovalSystem |  | ||||||
|           displayName: "Framework Restore" |  | ||||||
|            |  | ||||||
|         - script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Build /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(BuildConfiguration);TargetFrameworkVersion=$(TargetFrameworkVersion) $(AssemblyTitle).csproj' |  | ||||||
|           workingDirectory: Fab2ApprovalSystem |  | ||||||
|           displayName: "Framework Build" |  | ||||||
|  |  | ||||||
|         - script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(Configuration);TargetFrameworkVersion=$(TargetFrameworkVersion) /p:DebugSymbols=false /p:DeleteExistingFiles=true /p:DeployOnBuild=true /p:EnableUpdateAble=true /p:ExcludeApp_Data=true /p:LastUsedBuildConfiguration=$(BuildConfiguration) /p:LastUsedPlatform="Any CPU" /p:LaunchSiteAfterPublish=true /p:OutputPath="D:\$(TargetFrameworkVersion)\$(Build.Repository.Name)\$(Build.BuildId)\$(Configuration)" /p:PreCompileBeforePublish=true /p:PublishProvider=FileSystem /p:PublishUrl="D:/PublishUrl" /p:SiteUrlToLaunchAfterPublish="" /p:WDPMergeOption=DoNotMerge /p:WebPublishMethod=FileSystem $(AssemblyTitle).csproj' |  | ||||||
|           workingDirectory: Fab2ApprovalSystem |  | ||||||
|           displayName: "Framework Pack" |  | ||||||
|   - stage: Production |  | ||||||
|     displayName: Production |  | ||||||
|     pool: |  | ||||||
|       name: Mesa-FabApproval |  | ||||||
|       demands: Fab2ApprovalSystem |  | ||||||
|     variables: |  | ||||||
|       configuration: 'Release' |  | ||||||
|       ASPNETCORE_ENVIRONMENT: "Production" |  | ||||||
|     jobs: |  | ||||||
|       - job: Release |  | ||||||
|         steps: |         steps: | ||||||
|  |           - script: | | ||||||
|  |               set gitCommit=$(Build.SourceVersion) | ||||||
|  |               set gitCommitSeven=%gitCommit:~0,7% | ||||||
|  |               echo %gitCommitSeven% | ||||||
|  |               echo ##vso[task.setvariable variable=GitCommitSeven;]%gitCommitSeven% | ||||||
|  |               echo $(GitCommitSeven) | ||||||
|  |             displayName: GitCommitSeven | ||||||
|  |  | ||||||
|           - script: | |           - script: | | ||||||
|               echo BuildId: $(Build.BuildId) |               echo BuildId: $(Build.BuildId) | ||||||
|               echo Build reason: $(Build.Reason) |               echo Build reason: $(Build.Reason) | ||||||
| @ -79,52 +52,63 @@ stages: | |||||||
|               echo Configuration: $(Configuration) |               echo Configuration: $(Configuration) | ||||||
|               echo Target Framework version: $(TargetFrameworkVersion) |               echo Target Framework version: $(TargetFrameworkVersion) | ||||||
|               echo Assembly title: $(AssemblyTitle) |               echo Assembly title: $(AssemblyTitle) | ||||||
|  |               echo MSBuild: $(msBuild) | ||||||
|             displayName: "Echo Check" |             displayName: "Echo Check" | ||||||
|  |  | ||||||
|           - script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Restore /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(BuildConfiguration);TargetFrameworkVersion=$(TargetFrameworkVersion) $(AssemblyTitle).csproj' |  | ||||||
|             workingDirectory: Fab2ApprovalSystem |  | ||||||
|             displayName: "Framework Restore" |  | ||||||
|  |  | ||||||
|           - script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Build /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(BuildConfiguration);TargetFrameworkVersion=$(TargetFrameworkVersion) $(AssemblyTitle).csproj' |  | ||||||
|             workingDirectory: Fab2ApprovalSystem |  | ||||||
|             displayName: "Framework Build" |  | ||||||
|  |  | ||||||
|           - script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(Configuration);TargetFrameworkVersion=$(TargetFrameworkVersion) /p:DebugSymbols=false /p:DeleteExistingFiles=true /p:DeployOnBuild=true /p:EnableUpdateAble=true /p:ExcludeApp_Data=true /p:LastUsedBuildConfiguration=$(BuildConfiguration) /p:LastUsedPlatform="Any CPU" /p:LaunchSiteAfterPublish=true /p:OutputPath="D:\$(TargetFrameworkVersion)\$(Build.Repository.Name)\$(Build.BuildId)\$(Configuration)" /p:PreCompileBeforePublish=true /p:PublishProvider=FileSystem /p:PublishUrl="D:/PublishUrl" /p:SiteUrlToLaunchAfterPublish="" /p:WDPMergeOption=DoNotMerge /p:WebPublishMethod=FileSystem $(AssemblyTitle).csproj' |  | ||||||
|             workingDirectory: Fab2ApprovalSystem |  | ||||||
|             displayName: "Framework Pack" |  | ||||||
|   - stage: Production_EC |  | ||||||
|     displayName: Production-EC |  | ||||||
|     pool: |  | ||||||
|       name: Mesa-FabApproval |  | ||||||
|       demands: Fab2ApprovalSystem-EC |  | ||||||
|     variables: |  | ||||||
|       ASPNETCORE_ENVIRONMENT: "Production" |  | ||||||
|       configuration: 'Release' |  | ||||||
|     jobs: |  | ||||||
|       - job: Release |  | ||||||
|         steps: |  | ||||||
|           - script: | |           - script: | | ||||||
|               echo BuildId: $(Build.BuildId) |               mklink /J ".vscode\.UserSecrets" "%AppData%\Microsoft\UserSecrets\f2da5035-aba9-4676-9f8d-d6689f84663d" | ||||||
|               echo Build reason: $(Build.Reason) |               mklink /J "DMO" "..\Fab2ApprovalSystem\DMO" | ||||||
|               echo Repo Id: $(Build.Repository.Id) |               mklink /J "Jobs" "..\Fab2ApprovalSystem\Jobs" | ||||||
|               echo Repo name: $(Build.Repository.Name) |               mklink /J "JobSchedules" "..\Fab2ApprovalSystem\JobSchedules" | ||||||
|               echo Source version: $(Build.SourceVersion) |               mklink /J "Misc" "..\Fab2ApprovalSystem\Misc" | ||||||
|               echo Core version: $(CoreVersion) |               mklink /J "Models" "..\Fab2ApprovalSystem\Models" | ||||||
|               echo Build configuration: $(BuildConfiguration) |               mklink /J "PdfGenerator" "..\Fab2ApprovalSystem\PdfGenerator" | ||||||
|               echo Configuration: $(Configuration) |               mklink /J "Utilities" "..\Fab2ApprovalSystem\Utilities" | ||||||
|               echo Target Framework version: $(TargetFrameworkVersion) |               mklink /J "ViewModels" "..\Fab2ApprovalSystem\ViewModels" | ||||||
|               echo Assembly title: $(AssemblyTitle) |             workingDirectory: Fab2ApprovalMKLink | ||||||
|             displayName: "Echo Check" |             displayName: "MKLink - Symbolic Link of Type Junction" | ||||||
|  |  | ||||||
|           - script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Restore /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(BuildConfiguration);TargetFrameworkVersion=$(TargetFrameworkVersion) $(AssemblyTitle).csproj' |           - script: | | ||||||
|             workingDirectory: Fab2ApprovalSystem |               dotnet user-secrets init | ||||||
|             displayName: "Framework Restore" |               dotnet user-secrets set BuildNumber $(Build.BuildId) | ||||||
|  |               dotnet user-secrets set GitCommitSeven $(GitCommitSeven) | ||||||
|  |               dotnet user-secrets list | ||||||
|  |             workingDirectory: Fab2ApprovalMKLink | ||||||
|  |             displayName: "MKLink - Safe storage of app secrets" | ||||||
|  |  | ||||||
|           - script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Build /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(BuildConfiguration);TargetFrameworkVersion=$(TargetFrameworkVersion) $(AssemblyTitle).csproj' |           - script: dotnet build --configuration $(buildConfiguration) | ||||||
|             workingDirectory: Fab2ApprovalSystem |             workingDirectory: Fab2ApprovalMKLink | ||||||
|             displayName: "Framework Build" |             displayName: "MKLink - Build" | ||||||
|  |  | ||||||
|           - script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(Configuration);TargetFrameworkVersion=$(TargetFrameworkVersion) /p:DebugSymbols=false /p:DeleteExistingFiles=true /p:DeployOnBuild=true /p:EnableUpdateAble=true /p:ExcludeApp_Data=true /p:LastUsedBuildConfiguration=$(BuildConfiguration) /p:LastUsedPlatform="Any CPU" /p:LaunchSiteAfterPublish=true /p:OutputPath="D:\$(TargetFrameworkVersion)\$(Build.Repository.Name)\$(Build.BuildId)\$(Configuration)" /p:PreCompileBeforePublish=true /p:PublishProvider=FileSystem /p:PublishUrl="D:/PublishUrl" /p:SiteUrlToLaunchAfterPublish="" /p:WDPMergeOption=DoNotMerge /p:WebPublishMethod=FileSystem $(AssemblyTitle).csproj' |           - script: dotnet build --configuration $(buildConfiguration) | ||||||
|  |             workingDirectory: Fab2ApprovalTests | ||||||
|  |             displayName: "Tests - Build" | ||||||
|  |  | ||||||
|  |           - script: dotnet test --configuration $(buildConfiguration) | ||||||
|  |             workingDirectory: Fab2ApprovalTests | ||||||
|  |             displayName: "Tests - Test" | ||||||
|  |  | ||||||
|  |           - script: dotnet clean --configuration $(buildConfiguration) | ||||||
|  |             workingDirectory: Fab2ApprovalTests | ||||||
|  |             displayName: "Tests - Clean" | ||||||
|  |  | ||||||
|  |           - script: dotnet clean --configuration $(buildConfiguration) | ||||||
|  |             workingDirectory: Fab2ApprovalMKLink | ||||||
|  |             displayName: "MKLink - Clean" | ||||||
|  |  | ||||||
|  |           - script: echo $(Build.SourceVersion)-$(Build.BuildId)>bin_x_x_\$(Configuration)\$(CoreVersion)\win-x64\$(Build.Repository.Name).txt | ||||||
|  |             workingDirectory: Fab2ApprovalMKLink | ||||||
|  |             displayName: "Force Fail" | ||||||
|  |             enabled: "false" | ||||||
|  |  | ||||||
|  |           - script: '"$(msBuild)" /target:Restore /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(BuildConfiguration);TargetFrameworkVersion=$(TargetFrameworkVersion) /p:RestoreSources=D:/nupkg $(AssemblyTitle).csproj' | ||||||
|             workingDirectory: Fab2ApprovalSystem |             workingDirectory: Fab2ApprovalSystem | ||||||
|             displayName: "Framework Pack" |             displayName: "Framework - Restore" | ||||||
|    |  | ||||||
|  |           - script: '"$(msBuild)" /target:Build /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(BuildConfiguration);TargetFrameworkVersion=$(TargetFrameworkVersion) $(AssemblyTitle).csproj' | ||||||
|  |             workingDirectory: Fab2ApprovalSystem | ||||||
|  |             displayName: "Framework - Build" | ||||||
|  |  | ||||||
|  |           - script: '"$(msBuild)" /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(Configuration);TargetFrameworkVersion=$(TargetFrameworkVersion) /p:DebugSymbols=false /p:DeleteExistingFiles=true /p:DeployOnBuild=true /p:EnableUpdateAble=true /p:ExcludeApp_Data=true /p:LastUsedBuildConfiguration=$(BuildConfiguration) /p:LastUsedPlatform="Any CPU" /p:LaunchSiteAfterPublish=true /p:OutputPath="D:\$(TargetFrameworkVersion)\$(Build.Repository.Name)\$(Build.BuildId)\$(Configuration)" /p:PreCompileBeforePublish=true /p:PublishProvider=FileSystem /p:PublishUrl="D:/PublishUrl" /p:SiteUrlToLaunchAfterPublish="" /p:WDPMergeOption=DoNotMerge /p:WebPublishMethod=FileSystem $(AssemblyTitle).csproj' | ||||||
|  |             workingDirectory: Fab2ApprovalSystem | ||||||
|  |             displayName: "Framework - Pack" | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	