Compare commits
	
		
			1 Commits
		
	
	
		
			65a433e9ab
			...
			feature-13
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| e020ec8c01 | 
| @ -13,6 +13,7 @@ | ||||
|         padding: 0 2px; | ||||
|     } | ||||
| } | ||||
|  | ||||
| body { | ||||
|     padding-top: 50px; | ||||
|     padding-bottom: 20px; | ||||
| @ -101,6 +102,17 @@ input[type="checkbox"].input-validation-error { | ||||
|     border: 0; | ||||
|     vertical-align: middle; | ||||
| } | ||||
|  | ||||
| .linkbutton.edit { | ||||
|     background: url('/Content/icons/edit.gif'); | ||||
| } | ||||
|  | ||||
| .modal-dialog { | ||||
|     margin-top: 80px; | ||||
| } | ||||
|  | ||||
| .affix { | ||||
|   position: fixed; | ||||
|   top: 55px; | ||||
|   left: 25px; | ||||
| } | ||||
| @ -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 }); | ||||
|  | ||||
| @ -6,6 +6,8 @@ Please review the cancelled 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/> | ||||
|  | ||||
							
								
								
									
										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> | ||||
| @ -388,8 +388,10 @@ | ||||
|     <Content Include="Views\CorrectiveAction\_D7PAAttachment.cshtml" /> | ||||
|     <Content Include="Views\CorrectiveAction\Edit.cshtml" /> | ||||
|     <Content Include="Views\CorrectiveAction\ReadOnlyCA.cshtml" /> | ||||
|     <Content Include="Views\ECN\_ECNCancel.cshtml" /> | ||||
|     <Content Include="Views\ECN\_ECNLayout.cshtml" /> | ||||
|     <Content Include="Views\ECN\_ECNReassignOriginator.cshtml" /> | ||||
|     <Content Include="Views\ECN\_ECNReturnToProcess.cshtml" /> | ||||
|     <Content Include="Views\ECN\Acknowledge.cshtml" /> | ||||
|     <Content Include="Views\ECN\ECNApprovalPdf.cshtml" /> | ||||
|     <Content Include="Views\ECN\ECNPdf.cshtml" /> | ||||
| @ -514,6 +516,7 @@ | ||||
|     <Content Include="EmailTemplates\TECNExpirationApproval.txt" /> | ||||
|     <Content Include="EmailTemplates\TECNExpired.txt" /> | ||||
|     <Content Include="EmailTemplates\TECNExtensionReject.txt" /> | ||||
|     <Content Include="EmailTemplates\TECNReturnedToProcess.txt" /> | ||||
|     <Content Include="EmailTemplates\WorkRequestApproval.txt" /> | ||||
|     <Content Include="EmailTemplates\WorkRequestAssigned.txt" /> | ||||
|     <Content Include="EmailTemplates\WorkRequestReAssigned.txt" /> | ||||
|  | ||||
| @ -126,7 +126,7 @@ public class ECNHelper { | ||||
|         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 = ""; | ||||
|         List<string> emailIst = MiscDMO.GetTECNCancelledApprovalNotifyList(ecnNumber).Distinct().ToList(); | ||||
|         foreach (int userId in notificationUserList) { | ||||
| @ -135,23 +135,27 @@ public class ECNHelper { | ||||
|                 emailIst.Add(email); | ||||
|         } | ||||
|  | ||||
|         string subject = string.Empty; | ||||
|         string userEmail = string.Empty; | ||||
|         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 subject; | ||||
|         string emailTemplate; | ||||
|         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); | ||||
|         string[] emailparams = new string[5]; | ||||
|         string[] emailparams = new string[6]; | ||||
|         emailparams[0] = ecnNumber.ToString(); | ||||
|         emailparams[1] = ecnNumber.ToString(); | ||||
|         emailparams[2] = GlobalVars.hostURL; | ||||
|         emailparams[3] = "TECN"; | ||||
|         emailparams[4] = DateTime.Now.ToString(); | ||||
|         emailparams[5] = comments; | ||||
|  | ||||
| #if (DEBUG) | ||||
|         userEmail = GlobalVars.SENDER_EMAIL; | ||||
|  | ||||
| @ -86,30 +86,48 @@ | ||||
|  | ||||
|                 if (Model.IsTECN && !Model.CancellationInProgress && !Model.CancellationApproved && !Model.ExpirationInProgress | ||||
|                     && !Model.ExpirationProcessed && !Model.Converted | ||||
|                     && !Model.LockedForConversion | ||||
|                     && (Model.ExpirationDate > DateTime.Today || Model.ExtensionDate > DateTime.Today)) | ||||
|                     && !Model.LockedForConversion) | ||||
|                 { | ||||
|                     ViewBag.CanResubmit = "true"; | ||||
|                     <input type="button" value="Change Type" class="btn btn-primary btn-xs" id="ReSubmitDocument" disabled="disabled" /> | ||||
|                     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 | ||||
|                     && !Model.ExpirationProcessed | ||||
|                     && Model.ConversionApprovalInProgress == false | ||||
|                     && (Model.ExpirationDate >= DateTime.Today || Model.ExtensionDate >= DateTime.Today)) | ||||
|                     && Model.ConversionApprovalInProgress == false) | ||||
|                 { | ||||
|                     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 | ||||
|                     && !Model.ExpirationProcessed && !Model.Converted | ||||
|                         && (Model.ExpirationDate > DateTime.Today || Model.ExtensionDate > DateTime.Today)) | ||||
|                     && !Model.ExpirationProcessed && !Model.Converted) | ||||
|                 { | ||||
|                     ViewBag.CanResubmit = "true"; | ||||
|                     <input type="button" value="Change Type" class="btn btn-primary btn-xs" id="ReSubmitDocument" disabled="disabled" /> | ||||
|                     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" /> | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             <input type="button" value="PRINT PDF" class="btn btn-primary btn-xs" id="PrintPDF" /> | ||||
| @ -1251,6 +1269,9 @@ | ||||
|     </div> | ||||
| </div> | ||||
|  | ||||
| @Html.Partial("_ECNCancel") | ||||
| @Html.Partial("_ECNReturnToProcess") | ||||
|  | ||||
| @Html.Partial("_ECNReassignOriginator") | ||||
|  | ||||
| <script type="text/javascript"> | ||||
| @ -2188,40 +2209,6 @@ | ||||
|         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 start = new Date($('#txSubmitDate').val()); | ||||
|         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> | ||||
		Reference in New Issue
	
	Block a user