Ready to publish

Added new Email Template and new Modal form for expired TECNs.
Updated Email Template and new Modal form for TECNs.
Added more margin on all modal dialogs
This commit is contained in:
2025-01-22 09:30:59 -07:00
parent e68a1a4c3b
commit e020ec8c01
9 changed files with 284 additions and 107 deletions

View File

@ -601,7 +601,7 @@ public class ECNController : PdfViewController {
try {
string emailSentList = "";
ECN ecn = ecnDMO.GetECN(ecnNumber);
emailSentList = ECNHelper.NotifySubmitter(_AppSettings, ecnNumber, ecnTypeString, ecn);
emailSentList = ECNHelper.NotifySubmitter(_AppSettings, ecnNumber, ecnTypeString, ecn);
try {
EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = ecnTypeString, OperationType = "Email", Comments = "Approvers for Step " + ":" + emailSentList });
} catch { }
@ -625,7 +625,7 @@ public class ECNController : PdfViewController {
ECN ecn = ecnDMO.GetECN(ecnNumber);
IEnumerable<int> ecnAdminIDs = MiscDMO.GetUserIDsBySubRoleID(383);
foreach (int id in ecnAdminIDs) {
emailSentList = ECNHelper.NotifyAdmin(_AppSettings, ecnNumber, ecnTypeString, ecn, id);
emailSentList = ECNHelper.NotifyAdmin(_AppSettings, ecnNumber, ecnTypeString, ecn, id);
try {
EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = ecnTypeString, OperationType = "Email", Comments = "Approvers for Step " + ":" + emailSentList });
} catch { }
@ -650,7 +650,7 @@ public class ECNController : PdfViewController {
string emailSentList = "";
ECN ecn = ecnDMO.GetECN(ecnNumber);
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 {
EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = ecnTypeString, OperationType = "Email", Comments = "Approvers for Step " + currentStep.ToString() + ":" + emailSentList });
} catch { }
@ -953,8 +953,7 @@ public class ECNController : PdfViewController {
} catch { }
}
public void NotifyApproversForCancellation(int ecnNumber, byte currentStep, int documentType, string ecnTypeString) {
ECN ecn = ecnDMO.GetECN(ecnNumber);
public void NotifyApproversForCancellation(int ecnNumber, ECN ecn, byte currentStep, int documentType, string ecnTypeString) {
string emailSentList = ECNHelper.NotifyApproversForCancellation(_AppSettings, ecnNumber, currentStep, documentType, ecnTypeString, ecn);
try {
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 { }
}
public void NotifyTECNCancellation(int ecnNumber, string ecnFolderPath) {
public void NotifyTECNCancellation(int ecnNumber, string ecnFolderPath, string comments) {
ECN ecn = ecnDMO.GetECN(ecnNumber);
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 {
EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = "E-TECN", OperationType = "Email", Comments = "Approvers for Cancellation :" + emailSentList });
} catch { }
@ -1157,22 +1156,24 @@ public class ECNController : PdfViewController {
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;
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);
if (appoverCount > 0) {
NotifyApproversForCancellation(ecnNumber, currentStep, documentType, ecnTypeString);
} else // TODO Automatically close the
{
lastApproverAndLastStep = ApproveCancellation(ecnNumber, currentStep, "", documentType, ecnTypeString);
NotifyApproversForCancellation(ecnNumber, ecn, currentStep, documentType, ecnTypeString);
} else { // TODO Automatically close the
lastApproverAndLastStep = ApproveCancellation(ecnNumber, currentStep, comments, documentType, ecnTypeString);
}
if (!lastApproverAndLastStep) {
try {
lastApproverAndLastStep = true;
ECNPdf ecn = new ECNPdf();
GenerateECNPdf(ecnNumber, out ecn);
ECNPdf ecnPDF = new ECNPdf();
GenerateECNPdf(ecnNumber, out ecnPDF);
string sourceDirectory = _AppSettings.AttachmentFolder + "ECN\\" + ecnNumber.ToString() + "\\";
string outputFullFilePath = "";
@ -1184,7 +1185,7 @@ public class ECNController : PdfViewController {
Zipper zip = new Zipper();
zip.CreateZip(outputFullFilePath, sourceDirectory);
NotifyTECNCancellation(ecnNumber, outputFullFilePath);
NotifyTECNCancellation(ecnNumber, outputFullFilePath, comments);
} catch (Exception ex) {
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) {
bool lastApproverAndLastStep = 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);
while (lastApprover && !lastStep) {
currentStep++;
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) {
try {
lastApproverAndLastStep = true;
ECNPdf ecn = new ECNPdf();
GenerateECNPdf(ecnNumber, out ecn);
ECNPdf ecnPDF = new ECNPdf();
GenerateECNPdf(ecnNumber, out ecnPDF);
string sourceDirectory = _AppSettings.AttachmentFolder + "ECN\\" + ecnNumber.ToString() + "\\";
string outputFullFilePath = "";
@ -1232,7 +1234,7 @@ public class ECNController : PdfViewController {
Zipper zip = new Zipper();
zip.CreateZip(outputFullFilePath, sourceDirectory);
NotifyTECNCancellation(ecnNumber, outputFullFilePath);
NotifyTECNCancellation(ecnNumber, outputFullFilePath, comments);
} catch (Exception ex) {
EventLogDMO.Add(new WinEventLog() { IssueID = ecnNumber, UserID = @User.Identity.Name, DocumentType = "TECN", OperationType = "Error", Comments = ex.Message });