Phares Mike (CSC FI SPS MESLEO) f110fba4cd Merged PR 13298: Added just one approval back in after removing the method call from bug 239935
Added just one approval back in after removing the method call from bug 239935

Added IExcelDataReader support into MK Project

Changed instructions below the ECN Title field to align with Windchill

Related work items: #225480, #244087
2025-03-19 21:19:06 +01:00

1544 lines
68 KiB
Plaintext

@model Fab2ApprovalSystem.Models.ECN
@{
ViewBag.Title = "Read Only";
}
@{
Layout = "_ECNLayout.cshtml";
}
<link rel="stylesheet" href="/Content/kendo/kendo.blueopal.min.css" />
<style>
.AffectedProductFamily {
width: 100%;
}
@@media (min-width: 768px) {
.col-sm-6 {
padding-left: 5px;
}
.col-sm-8 {
padding-left: 5px;
}
}
@@media (min-width: 1200px) {
.AffectedProductFamily {
width: 500px;
}
}
</style>
<body>
@using (Html.BeginForm())
{
ViewBag.CanResubmit = "false";
<input type="hidden" id="currentStep" value="@Model.CurrentStep" />
<input type="hidden" id="environment" value="@GlobalVars.DBConnection" />
<input type="hidden" id="tecnExtensionState" value="@Model.TECNExtensionState" />
<input type="hidden" id="hidCloseDate" value="@Model.CloseDate" />
<input type="hidden" id="hidOldECNType" value="" />
<input type="hidden" id="hidCancellationType" value="@Model.NotAFlowChange" />
<input type="hidden" id="hidExpirationType" value="@Model.ExpirationInProgress" />
@Html.AntiForgeryToken()
<div data-spy="affix">
@if (Model.Deleted == false)
{
<input type="button" value="PRINT PDF" class="btn btn-primary btn-xs" id="PrintPDF" />
}
else
{
<span class="btn" style="color: white; background-color: red; font-weight: bold;">THIS DOCUMENT IS DELETED</span>
}
<input type="button" value="Approval Log History" class="btn btn-primary btn-xs" id="ApprovalLogHistoryData" />
@if (Session[GlobalVars.IS_ADMIN] != null)
{
<input type="button" value="Unlock Document" class="btn btn-primary btn-xs" id="UnlockDocumentBtn" onclick="UnlockDocument()" />
}
</div>
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-body bg-warning">
<div class="row">
<div class="col-sm-4">
<div class="row">
<div class="col-sm-3">
</div>
<div class="col-sm-3">
</div>
<div class="col-sm-6">
</div>
</div>
</div>
<div class="col-sm-4 text-center">
<div class="row">
<div class="col-sm-12">
<font style="color: crimson; font-size:24px;font-weight: bolder">
Engineering Change Notice
</font>
</div>
</div>
</div>
<div class="col-sm-4 text-right">
<div class="row">
<div class="col-sm-12">
<font style="color:crimson">
@if (Model.RecordLockByName == null)
{
<h4>
<font style="color:red">
Mode: [Readonly]
</font>
</h4>
}
else
{
<h4>
<font style="color:red">
Mode: [Readonly] - Locked for Editing by <font style="color: green; font-weight:bold; font-style:italic">@Model.RecordLockByName</font>
</font>
</h4>
}
</font>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info">
<div class="panel-heading">
<h6 style="font-weight:600"></h6>
</div>
</div>
<div class="panel-body bg-warning">
<div class="form-horizontal col-sm-3">
<div class="form-group">
<label class="control-label col-sm-4">ECN #:</label>
<div class="col-sm-8">
@Html.TextBoxFor(model => model.ECNNumber, new { id = "txtECNNumber", @class = "k-textbox", disabled = "disabled", style = "background-color:lightblue" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Submit Date:</label>
<div class="col-sm-8">
@Html.TextBoxFor(model => model.SubmitedDate, new { id = "txSubmitDate", @class = "k-textbox", disabled = "disabled", style = "background-color:lightblue" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Originator Name:</label>
<div class="col-sm-8">
@Html.TextBoxFor(model => model.OriginatorName, new { id = "txtOriginatorName", @class = "k-textbox", disabled = "disabled", style = "background-color:lightblue" })
@if (Session[GlobalVars.IS_ADMIN] != null)
{
<a href="javascript:undefined" id="lnkReassignOriginator" class="linkbutton edit" title="Re-assign Originator"></a>
}
</div>
</div>
@if (Model.ConvertedFromNumber != null && Model.IsECN)
{
<div class="form-group">
<font style="color:red; font-size:12px; font-weight:bold">
<label class="control-label col-sm-4">Converted from TECN: </label>
<div class="col-sm-4 col-sm-4">
<a style="color:red" href="Edit?IssueID=@Model.ConvertedFromNumber">@Model.ConvertedFromNumber</a>
</div>
</font>
</div>
}
@if (Model.ConvertedFromNumber != null && Model.IsTECN)
{
<div class="form-group">
<font style="color:red; font-size:12px; font-weight:bold">
<label class="control-label col-sm-4">Converted from E-TECN: </label>
<div class="col-sm-4 col-sm-4">
<a style="color:red" href="Edit?IssueID=@Model.ConvertedFromNumber">@Model.ConvertedFromNumber</a>
</div>
</font>
</div>
}
@if (Model.ConvertedToNumber != null && Model.IsEmergencyTECN)
{
<div class="form-group">
<font style="color: red; font-size: 12px; font-weight: bold">
<label class="control-label col-sm-4">Converted to TECN: </label>
<div class="col-sm-4 col-sm-4">
<a style="color:red" href="Edit?IssueID=@Model.ConvertedToNumber">@Model.ConvertedToNumber</a>
</div>
</font>
</div>
}
@if (Model.ConvertedToNumber != null && Model.IsTECN)
{
<div class="form-group">
<font style="color: red; font-size: 12px; font-weight: bold">
<label class="control-label col-sm-4">Converted to ECN: </label>
<div class="col-sm-4 col-sm-4">
<a style="color:red" href="Edit?IssueID=@Model.ConvertedToNumber">@Model.ConvertedToNumber</a>
</div>
</font>
</div>
}
</div>
@*<div class="form-horizontal col-sm-3">
<div class="form-group">
<label class="control-label col-sm-4">Converted from TECN: <a href="Edit?IssueID=@Model.ConvertedFromNumber">@Model.ConvertedFromNumber</a></label>
</div>
</div>*@
<div class="form-horizontal col-sm-6">
<div class="form-group">
<label class="control-label col-sm-4">ECN Title:</label>
<div class="col-sm-6 col-sm-6">
@Html.TextBoxFor(model => model.Title, new { id = "txtTitle", @class = "k-textbox", style = "width:100%", disabled = "disabled" })
</div>
<div class="col-sm-6 col-sm-offset-4" style="color: red;">
* (DO NOT USE Rev I, O, S, X, and Z)
</div>
<div class="col-sm-6 col-sm-offset-4" style="color: red;">
Revision Y is followed by AA-AY, AY is followed by BA-BY etc. YY is followed by AAA
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Approvers:</label>
<div class="col-sm-6 col-sm-6">
@(Html.Kendo().MultiSelect()
.Name("DepartmentIDs")
.BindTo(new SelectList(ViewBag.Departments, "DepartmentID", "DepartmentName"))
.Value(ViewBag.Nothing)
.HtmlAttributes(new { disabled = "disabled" })
)
</div>
<div class="col-sm-6 col-sm-offset-4" style="color:red;">
ECN: Qualtiy and Dept. Specific<br />PCRB: Quality, Production, Engineering, Dept. Specific (scope of change)
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Affected Areas:</label>
<div class="col-sm-6 col-sm-6">
@(Html.Kendo().MultiSelect()
.Name("ModuleIDs")
.BindTo(new SelectList(ViewBag.AffectedModules, "ModuleID", "ModuleName"))
.Value(ViewBag.Nothing)
.HtmlAttributes(new { disabled = "disabled" })
)
</div>
</div>
</div>
<div class="form-horizontal col-sm-3">
<div class="form-group">
<label class="control-label col-sm-4">Category:</label>
<div class="col-sm-6 col-sm-6">
@(Html.Kendo().DropDownListFor(model => model.CategoryID)
.DataValueField("CategoryID")
.DataTextField("CategoryName")
.BindTo(ViewBag.Categories)
.HtmlAttributes(new { disabled = "disabled" }))
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">ITAR/EC:</label>
<div class="col-sm-6 col-sm-6">
@Html.CheckBoxFor(model => model.IsDocEC, new { disabled = "disabled" })
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info" style="font-size: 11px">
<div class="panel-heading">
<h5 style="font-weight:600">ECN/TECN Detail</h5>
</div>
</div>
<div class="panel-body bg-warning">
<div class="col-lg-4">
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-6">ECN:</label>
<div class="form-control-static col-sm-6">
@Html.CheckBoxFor(model => model.IsECN, new { disabled = "disabled" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-6">TECN:</label>
<div class="form-control-static col-sm-6">
@Html.CheckBoxFor(model => model.IsTECN, new { disabled = "disabled" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-6">Emergency:</label>
<div class="form-control-static col-sm-6">
@Html.CheckBoxFor(model => model.IsEmergencyTECN, new { disabled = "disabled" })
</div>
</div>
</div>
</div>
<div class="col-lg-8">
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-6">Expiration Date:</label>
<div class="col-sm-6">
@(Html.Kendo().DatePickerFor(model => model.ExpirationDate)
.Name("txtExpirationDate")
.HtmlAttributes(new { disabled = "disabled", @type = "", style = "width: 11em;" })
)
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-6">Extension Date:</label>
<div class="col-sm-6">
@(Html.Kendo().DatePickerFor(model => model.ExtensionDate)
.Name("txtExtensionDate")
.HtmlAttributes(new { disabled = "disabled", @type = "", style = "width: 11em;" })
.Format("MM/dd/yyyy")
)
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-6">Cancelled Date:</label>
<div class="col-sm-6">
@Html.TextBoxFor(model => model.CancellationApprovalDate, "{0:MM/dd/yyyy}", new { id = "txtCancellationApprovalDate", @class = "k-textbox",
style = "width: 8em;", disabled = "disabled" })
</div>
</div>
</div>
</div>
</div>
<div class="panel-body bg-warning">
<div class="col-lg-4">
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-6" style="padding-left: 0px"># lots affected:</label>
<div class="form-control-static col-sm-6">
@(Html.Kendo().DropDownList()
.Name("NumberOfLotsAffected")
.Items(i =>
{
i.Add().Text("").Value("");
i.Add().Text("NA").Value("NA");
i.Add().Text("< 10").Value("< 10");
i.Add().Text("> 10").Value("> 10");
})
.HtmlAttributes(new { style = "width: 5em;", disabled = "disabled" })
)
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-6">Recipe Change?</label>
<div class="form-control-static col-sm-6">
@(Html.Kendo().DropDownList()
.Name("RecipeChange")
.Items(i =>
{
i.Add().Text("").Value("");
i.Add().Text("No").Value("False");
i.Add().Text("Yes").Value("True");
})
.HtmlAttributes(new { style = "width: 5em;", disabled = "disabled" })
)
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
</div>
</div>
<div class="col-lg-8">
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-6">Affected Customers:</label>
<div class="form-control-static col-sm-6">
@(Html.Kendo().MultiSelect()
.Name("ProductFamilyIDs")
.BindTo(new SelectList(ViewBag.ProductFamilies, "ProductFamilyID", "ProductFamily"))
.HtmlAttributes(new { disabled = "disabled", @class = "AffectedProductFamily" })
.Value(Model.ProductFamilyIDs)
)
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
</div>
<div class="form-horizontal col-sm-4">
</div>
</div>
</div>
<div class="panel-body bg-warning">
<div class="form-group">
<label class="control-label">Affected Documents:</label>
<div>
@if (
(Model.CloseDate != null && Model.IsECN)
|| ((Model.IsEmergencyTECN || Model.IsTECN) && (DateTime.Today > Model.ExpirationDate && DateTime.Today > Model.ExtensionDate))
)
{
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.ECNAttachment>()
.Name("Attachments")
.Columns(columns =>
{
columns.Bound(a => a.AttachmentID).Visible(false);
columns.Bound(a => a.ECNNumber).Visible(false);
columns.Bound(a => a.FileName).Template(@<text> @Html.ActionLink(@item.FileName.ToString(), null)</text>);
//.ClientTemplate("<a href='' target='_blank' onclick='return AttachmentMessage()'>#=FileName#</a>");
columns.Bound(a => a.FullName);
columns.Bound(a => a.UploadDate).Format("{0:MM/dd/yy hh:mm:ss}");
columns.Command(command => command.Custom("View").Click("DownloadAttachment"));
})
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:157px; width:100%; font-size: 10px" })
.DataSource(dataSource => dataSource
.Ajax()
//.Batch(false)
.ServerOperation(false)
//.Events(events => events.Error("error_handler"))
.Model(model =>
{
model.Id(p => p.AttachmentID);
})
.PageSize(50)
.Read(read => read.Action("Attachment_Read", "ECN", new { ecnNumber = Model.ECNNumber }))
)
)
}
else
{
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.ECNAttachment>()
.Name("Attachments")
.Columns(columns =>
{
columns.Bound(a => a.AttachmentID).Visible(false);
columns.Bound(a => a.ECNNumber).Visible(false);
columns.Bound(a => a.FileName).Template(@<text> @Html.ActionLink(@item.FileName.ToString(), null)</text>);
//.ClientTemplate("<a href='" + GlobalVars.AttachmentUrl + "ECN/#=ECNNumber#/#=FileName#' target='_blank'>#=FileName#</a>");
columns.Bound(a => a.FullName);
columns.Bound(a => a.UploadDate).Format("{0:MM/dd/yy hh:mm:ss}");
columns.Command(command => command.Custom("View").Click("DownloadAttachment"));
})
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:157px; width:100%; font-size: 10px" })
.DataSource(dataSource => dataSource
.Ajax()
//.Batch(false)
.ServerOperation(false)
//.Events(events => events.Error("error_handler"))
.Model(model =>
{
model.Id(p => p.AttachmentID);
})
.PageSize(50)
.Read(read => read.Action("Attachment_Read", "ECN", new { ecnNumber = Model.ECNNumber }))
)
)
}
</div>
</div>
</div>
</div>
<table class="table-condensed" style="width:100%">
<tbody>
<tr>
<td>
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info" style="font-size: 11px">
<div class="panel-heading">
<table>
<tr>
<td>
<h5 style="font-weight:600">Description of Change &nbsp;&nbsp;&nbsp;</h5>
</td>
</tr>
</table>
</div>
</div>
<div class="panel-body bg-warning">
<div class="form-horizontal col-sm-12">
@Html.TextAreaFor(model => model.DescriptionOfChange, 15, 30, new { id = "txtDescriptionOfChange", @class = "form-control", style = "font-size: 11px;width: 100%;", disabled = "disabled" })
</div>
</div>
</div>
</td>
<td>
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info" style="font-size: 11px">
<div class="panel-heading">
<table>
<tr>
<td>
<h5 style="font-weight:600">Reason For Change&nbsp;&nbsp;&nbsp;</h5>
</td>
</tr>
</table>
</div>
</div>
<div class="panel-body bg-warning">
<div class="form-horizontal col-sm-12">
@Html.TextAreaFor(model => model.ReasonForChange, 15, 30, new { id = "txtReasonForChange", @class = "form-control", style = "font-size: 11px;width: 100%;", disabled = "disabled" })
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
@*<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info">
<div class="panel-heading">
<h5 style="font-weight:600">Acknowledgment</h5>
</div>
</div>
<div class="panel-body bg-warning">
<div class="form-horizontal col-sm-2">
@*<div class="form-group">
<label class="control-label col-sm-4">Acknowledgment:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.AcknowledgementRequired, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Training:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.TrainingRequired, new { disabled = "disabled" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-3">
@*<div class="form-group">
<label class="control-label col-sm-6">Acknowledgement Notification to:</label>
<div class="col-sm-8 col-sm-6">
@(Html.Kendo().MultiSelect()
.Name("AcknowledgementByIDs")
.BindTo(new SelectList(ViewBag.AcknowledgementTrainingByIDs, "AcknowledgementTrainingByID", "AcknowledgementTrainingBy"))
.Value(ViewBag.Nothing)
.HtmlAttributes(new { disabled = "disabled" })
)
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-6">Training Notification to:</label>
<div class="col-sm-8 col-sm-6">
@(Html.Kendo().MultiSelect()
.Name("TrainingByIDs")
.BindTo(new SelectList(ViewBag.AcknowledgementTrainingByIDs, "AcknowledgementTrainingByID", "AcknowledgementTrainingBy"))
.Value(ViewBag.Nothing)
.HtmlAttributes(new { disabled = "disabled" })
)
</div>
</div>
</div>
@*<div class="form-horizontal col-sm-3">
<div class="form-group">
<label class="control-label col-sm-4">Area:</label>
<div class="col-sm-8 col-sm-6">
@(Html.Kendo().MultiSelect()
.Name("AreaIDs")
.BindTo(new SelectList(ViewBag.AffectedAreas, "AreaID", "Area"))
.Value(ViewBag.Nothing)
.HtmlAttributes(new { disabled = "disabled" })
)
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-4">Unit Process:</label>
<div class="col-sm-8 col-sm-8">
@(Html.Kendo().MultiSelect()
.Name("TechnologyIDs")
.BindTo(new SelectList(ViewBag.AffectedTechnologies, "TechnologyID", "Technology"))
.Value(ViewBag.Nothing)
.HtmlAttributes(new { disabled = "disabled" })
)
</div>
</div>
</div>
</div>
</div>*@
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info">
<div class="panel-heading">
<h5 style="font-weight:600">Systems</h5>
</div>
</div>
<div class="panel-body bg-warning">
<div class="col-lg-4">
<div class="form-horizontal col-sm-6 col-lg-5">
<div class="form-group">
<label class="control-label col-sm-6">PCRB Required:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.PCRBRequired, new { disabled = "disabled" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-6 col-lg-7">
<div class="form-group">
<label class="control-label col-sm-6">PCRB#:</label>
<div class="form-control-static col-sm-6">
@Html.TextBoxFor(model => model.PCRBNumber, new { id = "txtPCRBNumber", @class = "k-textbox", disabled = "disabled", @style = "max-width: 100%;" })
@*<button id="GetPCRB" onclick="RedirectToPCRB" style="max-width:100%;">Go To PCRB</button>*@
</div>
</div>
</div>
</div>
<div class="col-lg-3">
@*<div class="form-horizontal col-sm-6">
<div class="form-group">
<label class="control-label col-sm-6">Test Program Change:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.TestProgramChangeRequired, new { disabled = "disabled" })
</div>
</div>
</div>*@
<div class="form-horizontal col-sm-6">
<div class="form-group">
<label class="control-label col-sm-6">Metrology Change:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.MetrologyChangeRequired, new { disabled = "disabled" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-6">
<div class="form-group">
<label class="control-label col-sm-6">SPC Change:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.SPCChangeRequired, new { disabled = "disabled" })
</div>
</div>
</div>
</div>
<div class="col-lg-3">
@*<div class="form-horizontal col-sm-6">
<div class="form-group">
<label class="control-label col-sm-6">New Part Flow:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.NewPartFlowRequired, new { disabled = "disabled" })
</div>
</div>
</div>*@
<div class="form-horizontal col-sm-6">
<div class="form-group">
<label class="control-label col-sm-6">FI Change:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.FIChangeRequired, new { disabled = "disabled" })
</div>
</div>
</div>
</div>
<div class="col-lg-2">
<div class="form-horizontal col-sm-6 col-lg-10">
<div class="form-group" style="display:none;">
<label class="control-label col-sm-6">OI Change:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.SPNChangeRequired, new { disabled = "disabled" })
</div>
</div>
</div>
</div>
</div>
</div>
@*<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info" style="font-size: 11px">
<div class="panel-heading">
<h5 style="font-weight:600">Implementation Details</h5>
</div>
</div>
<div class="panel-body bg-warning">
<div class="form-horizontal col-sm-12">
<div class="form-group">
<label class="control-label">Implementation Details:</label>
@if (ViewBag.IsApprover == "true" && Model.CloseDate == null)
{
<div>
@Html.TextAreaFor(model => model.ImplementationDetails, 15, 30, new { id = "txtImplementationDetails", @class = "form-control", style = "font-size: 11px;width: 100%;" })
</div>
}
else
{
<div>
@Html.TextAreaFor(model => model.ImplementationDetails, 15, 30, new { id = "txtImplementationDetails", @class = "form-control", style = "font-size: 11px;width: 100%;", disabled = "disabled" })
</div>
}
</div>
</div>
</div>
</div>*@
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info" style="font-size: 11px">
<div class="panel-heading">
<h5 style="font-weight:600">Change Impact</h5>
</div>
</div>
<div class="panel-body bg-warning">
<div class="form-horizontal col-sm-3">
<div class="form-group">
<label style="font-weight:bolder; font-size:small">Impact On ESH:</label>
</div>
<div class="form-group">
<label class="control-label col-sm-3">Positive:</label>
<div class="form-control-static col-sm-2">
@Html.RadioButtonFor(model => model.ImpactOnEnvironment, 1, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">Negative:</label>
<div class="form-control-static col-sm-2">
@Html.RadioButtonFor(model => model.ImpactOnEnvironment, 2, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">N/A:</label>
<div class="form-control-static col-sm-2">
@Html.RadioButtonFor(model => model.ImpactOnEnvironment, 3, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<div class="col-sm-10">
@Html.TextAreaFor(model => model.ImpactOnEnvironmentDescription, 5, 30, new { id = "txtImpactOnEnvironmentDescription", @class = "form-control", style = "font-size: 11px;width: 100%;", disabled = "disabled" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-3">
<div class="form-group">
<label style="font-weight:bolder; font-size:small">Impact On Capacity:</label>
</div>
<div class="form-group">
<label class="control-label col-sm-3">Yes:</label>
<div class="form-control-static col-sm-2">
@Html.RadioButtonFor(model => model.ImpactOnCapacity, 1, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">No:</label>
<div class="form-control-static col-sm-2">
@Html.RadioButtonFor(model => model.ImpactOnCapacity, 0, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="col-sm-12 pull-left">If yes, what is the impact?</label>
<div class="col-sm-10">
@Html.TextAreaFor(model => model.ImpactOnCapacityDescription, 5, 30, new { id = "txtImpactOnCapacityDescription", @class = "form-control", style = "font-size: 11px;width: 100%;", disabled = "disabled" })
</div>
</div>
</div>
@*<div class="form-horizontal col-sm-3">
<div class="form-group">
<label style="font-weight:bolder; font-size:small">Affected Parts:</label>
</div>
<div class="form-group">
<label class="control-label col-sm-3">MA:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.IsMA, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">RH(ITAR):</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.IsRH, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">AU:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.IsAU, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">Industrial:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.IsIndustrial, new { disabled = "disabled" })
</div>
</div>
</div>*@
<div class="form-horizontal col-sm-3">
<div class="form-group">
<label style="font-weight:bolder; font-size:small">Material Consumption Change:</label>
</div>
<div class="form-group">
<label class="control-label col-sm-3">Yes:</label>
<div class="form-control-static col-sm-2">
@Html.RadioButtonFor(model => model.MaterialConsumptionChangeRequired, 1, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">No:</label>
<div class="form-control-static col-sm-2">
@Html.RadioButtonFor(model => model.MaterialConsumptionChangeRequired, 0, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="col-sm-3">Description</label>
<div class="col-sm-10">
@Html.TextAreaFor(model => model.MaterialConsumptionChangeDescription, 5, 30, new { id = "txtMaterialConsumptionChangeDescription", @class = "form-control", style = "font-size: 11px;width: 100%;", disabled = "disabled" })
</div>
</div>
</div>
</div>
</div>
@*<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info" style="font-size: 11px">
<div class="panel-heading" >
<h5 style="font-weight:600">Description Of Change</h5>
</div>
</div>
<div class="panel-body bg-warning">
<div class="form-horizontal col-sm-6">
<div class="form-group">
<div class="col-sm-10">
@Html.TextAreaFor(model => model.DescriptionOfChange, 5, 30, new { id = "txtDescriptionOfChange", @class = "form-control", style = "font-size: 11px;width: 100%;" })
</div>
</div>
</div>
</div>
</div>*@
@*<div class="panel panel-default" style="font-size: 10px">
<div class="panel-info" style="font-size: 11px">
<div class="panel-heading">
<h5 style="font-weight:600">Implementation</h5>
</div>
</div>
<div class="panel-body bg-warning">
<div class="form-horizontal col-sm-6">
<div class="form-group">
<label style="font-weight:bolder; font-size:small">How will the change be implemented?One box must be checked:</label>
</div>
<div class="form-group">
<label class="control-label col-sm-3">Not a flow change:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.NotAFlowChange, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">Attach ECN/TECNs to Lots:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.AttachECN_TECNToLots, new { disabled = "disabled" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-6">
<div class="form-group">
<label style="font-weight:bolder; font-size:small">SPN Changes are applied to all lots in process</label>
</div>
<div class="form-group">
<label class="control-label col-sm-3">SPN flow change at Single Step</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.SPNFlowChangeAtSingleStep, new { disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3">SPN flow change at Multiple Step:</label>
<div class="form-control-static col-sm-2">
@Html.CheckBoxFor(model => model.SPNFlowChangeAtMultipleSteps, new { disabled = "disabled" })
</div>
</div>
</div>
</div>
</div>*@
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-body bg-warning">
<div class="col-sm-offset-0">
@if (Session[GlobalVars.IS_ADMIN] != null)
{
if ((bool)Session[GlobalVars.IS_ADMIN] && (Request.IsAuthenticated))
{
@(Html.Kendo().Grid<Fab2ApprovalSystem.ViewModels.ApproversListViewModel>()
.Name("ApproversList")
.Columns(columns =>
{
columns.Bound(a => a.UserID).Visible(false);
columns.Bound(a => a.ApprovalID).Visible(false);
columns.Bound(a => a.FullName);
columns.Bound(a => a.RoleName);
columns.Bound(a => a.SubRoleName);
columns.Bound(a => a.Status);
columns.Bound(a => a.AssignedDate).Format("{0:MM/dd/yy hh:mm:ss}"); ;
columns.Bound(a => a.CompletedDate).Format("{0:MM/dd/yy hh:mm:ss}"); ;
columns.Bound(a => a.Comments);
columns.Command(command => command.Custom("Re-Assign").Click("showReAssignRole")).Width("100px");
})
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:200px; width:100%; font-size: 10px" })
.DataSource(dataSource => dataSource
.Ajax()
//.Batch(false)
.ServerOperation(false)
.Model(model =>
{
model.Id(p => p.ApprovalID);
})
.PageSize(20)
.Read(read => read.Action("GetApproversList", "ECN", new { issueID = Model.ECNNumber, step = Model.CurrentStep, isTECN = Model.IsTECN, isEmergrncyTECN = Model.IsEmergencyTECN }))
)
.Resizable(resize => resize.Columns(true))
)
}
else
{
@(Html.Kendo().Grid<Fab2ApprovalSystem.ViewModels.ApproversListViewModel>()
.Name("ApproversList")
.Columns(columns =>
{
columns.Bound(a => a.UserID).Visible(false);
columns.Bound(a => a.ApprovalID).Visible(false);
columns.Bound(a => a.FullName);
columns.Bound(a => a.RoleName);
columns.Bound(a => a.SubRoleName);
columns.Bound(a => a.Status);
columns.Bound(a => a.AssignedDate).Format("{0:MM/dd/yy hh:mm:ss}"); ;
columns.Bound(a => a.CompletedDate).Format("{0:MM/dd/yy hh:mm:ss}"); ;
columns.Bound(a => a.Comments);
//columns.Command(command => command.Custom("Re-Assign").Click("showReAssignRole")).Width("100px");
})
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:200px; width:100%; font-size: 10px" })
.DataSource(dataSource => dataSource
.Ajax()
//.Batch(false)
.ServerOperation(false)
.Model(model =>
{
model.Id(p => p.ApprovalID);
})
.PageSize(20)
.Read(read => read.Action("GetApproversList", "ECN", new { issueID = Model.ECNNumber, step = Model.CurrentStep, isTECN = Model.IsTECN, isEmergrncyTECN = Model.IsEmergencyTECN }))
)
.Resizable(resize => resize.Columns(true))
)
}
}
</div>
</div>
</div>
}
</body>
<div class="modal fade" id="ApprovalLogHistoryWin" 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">
<h4 class="modal-title" id="myModalLabel">Approval Log History</h4>
</div>
<div class="modal-body">
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.ApprovalLogHistory>()
.Name("ApprovalLogHistory")
.Columns(columns =>
{
columns.Bound(a => a.ApprovalLogID).Visible(false);
columns.Bound(a => a.FullName);
columns.Bound(a => a.SubRole);
columns.Bound(a => a.Operation);
columns.Bound(a => a.OperationTime).Format("{0:MM/dd/yy hh:mm:ss}");
columns.Bound(a => a.Comments);
})
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:300px; width:100%; font-size: 12px" })
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.Model(model =>
{
model.Id(p => p.ApprovalLogID);
})
.PageSize(50)
.Read(read => read.Action("ApprovalLogHistory_Read", "ECN", new { ecnNumber = Model.ECNNumber }))
)
)
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="ReAssignApproval" 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">&times;</button>
<h4 class="modal-title" id="myModalLabel">Re-Assign for Approval From: <label class="bg-danger" id="ReAssignApproverFromLabel">Me</label></h4>
</div>
<div class="modal-body">
<div class="control-group">
<div class="controls">
<h4 class="modal-title" id="myModalLabel">Re-Assign for Approval to:</h4>
<div id='lstReAssignApproval'>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="ConfirmReAssignment">Confirm Re-assignment</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="AdditionalApproval" 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">&times;</button>
<h4 class="modal-title" id="myModalLabel">Add New Approvers:</h4>
</div>
<div class="modal-body">
<div class="control-group">
<div class="controls">
<div id='lstAdditionalApproval'>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="additionalApproval">Confirm Additional Approver</button>
</div>
</div>
</div>
</div>
@Html.Partial("_ECNReassignOriginator")
<script type="text/javascript">
var docType;
var ecnTypeString = '';
var enumDocumentType = {
ECN: 3,
EECN: 4,
TECNCancExp: 5
}
$(document).ready(function () {
var cancelledDoc = "false";
var expiredDoc = "false";
// on load ============================================
if ("@Model.CancellationInProgress" == "True")
cancelledDoc = "true";
else if ("@Model.ExpirationInProgress" == "True")
expiredDoc = "true";
if ($('#IsEmergencyTECN').is(":checked")) {
ecnTypeString = "E-TECN"
docType = 4; //document type = Emergency TECN
}
else if ($('#IsECN').is(":checked")) {
ecnTypeString = "ECN"
docType = 3; //document type = ECN
}
else if ($('#IsTECN').is(":checked")) {
ecnTypeString = "TECN"
docType = 3; //document type = TECN
}
if (cancelledDoc == "true" || expiredDoc == "true") {
docType = 5; //document type = TECNCancelledExpired
}
})
$('#ApprovalLogHistoryData').on('click', function () {
$("#ApprovalLogHistoryWin").modal('show');
return false;
})
function AttachmentMessage() {
alert("The documents can only be viewed from Documetum");
return false;
}
function showReAssignRole(e) {
e.preventDefault();
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
$('#ReAssignApproverFromLabel').text(dataItem.FullName);
var issueID = $("#txtECNNumber").val();
reAssignFromUserid = dataItem.UserID;
if (dataItem.Status.indexOf("Pending") < 0)
alert("Cannot ReAssign, because it is not in a Pending state");
else {
var searchText = ($("#txtSearch").val());
var url = "/ECN/GetAllUsersList";
var source =
{
datatype: "json",
datafields: [
{ name: 'UserID' },
{ name: 'FullName' }
],
id: 'id',
url: url,
};
var dataAdapter = new $.jqx.dataAdapter(source);
// Create a jqxListBox
$("#lstReAssignApproval").jqxListBox({
multipleextended: false, theme: "arctic", source: dataAdapter, displayMember: "FullName", valueMember: "UserID", width: 200, height: 250
});
$("#ReAssignApproval").modal('show');
return false;
//alert(dataItem.FullName);
}
}
var ReAssignApprovalByAdmin = function (userids) {
var urlString = '/ECN/ReAssignApproverByAdmin';
//if (arrayOfValues.length == 0)
// return false;
//var isRH;
//if ($('#IsRH').is(':checked'))
// isRH = 1;
//else
// isRH = 0;
//var ecnTypeString = '';
//if ($('#IsECN').is(':checked'))
// ecnTypeString = "ECN"
//else if ($('#IsTECN').is(':checked'))
// ecnTypeString = "TECN"
//else if ($('#IsEmergencyTECN').is(':checked'))
// ecnTypeString = "E-TECN"
alert("issueID:" + $("#txtECNNumber").val()
+ "reAssignApproverFrom:" + reAssignFromUserid
+ "reAssignApproverTo:" + userids
+ "step:" + $("#currentStep").val()
+ "docType:" + docType
+ "ecnTypeString:" + ecnTypeString);
$.ajax({
type: "Post",
url: urlString,
data: {
issueID: $("#txtECNNumber").val(),
reAssignApproverFrom: reAssignFromUserid,
reAssignApproverTo: userids,
step: $("#currentStep").val(),
docType: docType,
ecnTypeString: ecnTypeString
},
success: function (result) {
//var grid = $("#ApproversList").data("kendoGrid");
//grid.dataSource.read($('#txtECNNumber').val(), $("#currentStep").val());
var url = '@Url.Action("ReadOnly", "ECN", new { issueID = "__id__" })';
url = url.replace('amp;', '');
window.location.href = url.replace('__id__', $("#txtECNNumber").val());
},
error: function(result)
{
alert('Failed');
}
});
};
//Region Additional Aprovers
$('#additionalApprovers').on('click', function () {
var searchText = ($("#txtSearch").val());
var url = "/ECN/GetAllUsersList";
var source =
{
datatype: "json",
datafields: [
{ name: 'UserID' },
{ name: 'FullName' }
],
id: 'id',
url: url,
};
var dataAdapter = new $.jqx.dataAdapter(source);
// Create a jqxListBox
$("#lstAdditionalApproval").jqxListBox({
multipleextended: true, theme: "arctic", source: dataAdapter, displayMember: "FullName", valueMember: "UserID", width: 200, height: 250
});
$("#AdditionalApproval").modal('show');
return false;
})
$('#additionalApproval').on('click', function () {
// get selected items.
var bfound = false;
var userids;
var itemsToAdd = $('#lstAdditionalApproval').jqxListBox('getSelectedItems');
if (itemsToAdd.length > 0) {
for (var i = 0; i < itemsToAdd.length; i++) {
if (itemsToAdd[i].label != undefined) {
var tempvalue = itemsToAdd[i].value;
var templabel = itemsToAdd[i].label;
if (userids == null)
userids = tempvalue;
else
userids += "~" + tempvalue;
}
};
if (userids != null) {
AssignAdditionalApproval(userids);
}
$("#AdditionalApproval").modal('hide');
return false;
}
});
var AssignAdditionalApproval = function (userids) {
//var ecnTypeString = '';
//if ($('#IsECN').is(':checked'))
// ecnTypeString = "ECN"
//else if ($('#IsTECN').is(':checked'))
// ecnTypeString = "TECN"
//else if ($('#IsEmergencyTECN').is(':checked'))
// ecnTypeString = "E-TECN"
var urlString = '/ECN/AddAdditionalApproval';
$.ajax({
type: "Post",
url: urlString,
data: {
userIDs: userids,
issueID: $("#txtECNNumber").val(),
step: $("#currentStep").val(),
docType: docType,
ecnTypeString: ecnTypeString
},
success: function (result) {
var grid = $("#ApproversList").data("kendoGrid");
grid.dataSource.read($('#txtECNNumber').val(), $("#currentStep").val());
},
error: function (result) {
alert("Failed " + result);
}
});
};
// Region Re-ASssign Approvers
$('#reAssignApprovers').on('click', function () {
// reset this variable to indicate that the current Approver of the document is the person Re-Assigning it to someone else.
reAssignFromUserid = "";
var url = "/ECN/GetAllUsersList";
var source =
{
datatype: "json",
datafields: [
{ name: 'UserID' },
{ name: 'FullName' }
],
id: 'id',
url: url,
};
var dataAdapter = new $.jqx.dataAdapter(source);
// Create a jqxListBox
$("#lstReAssignApproval").jqxListBox({
multipleextended: false, theme: "arctic", source: dataAdapter, displayMember: "FullName", valueMember: "UserID", width: 200, height: 250
});
$("#ReAssignApproval").modal('show');
return false;
})
$('#ConfirmReAssignment').on('click', function () {
// get selected items.
var bfound = false;
var userids;
var itemsToAdd = $('#lstReAssignApproval').jqxListBox('getSelectedItems');
if (itemsToAdd.length > 0) {
for (var i = 0; i < itemsToAdd.length; i++) {
if (itemsToAdd[i].label != undefined) {
var tempvalue = itemsToAdd[i].value;
var templabel = itemsToAdd[i].label;
if (userids == null)
userids = tempvalue;
else
userids += "~" + tempvalue;
}
};
//
if (userids != null) {
//alert(reAssignFromUserid);
if (reAssignFromUserid != '') {
ReAssignApprovalByAdmin(userids);
}
else {
ReAssignApproval(userids);
}
}
$("#ReAssignApproval").modal('hide');
return false;
}
});
var ReAssignApproval = function (userids) {
var urlString = '/ECN/ReAssignApproval';
$.ajax({
type: "Post",
url: urlString,
data: {
userIDs: userids,
issueID: $("#txtECNNumber").val(),
step: $("#currentStep").val(),
docType: docType,
ecnTypeString: ecnTypeString
},
success: function (result) {
//var grid = $("#ApproversList").data("kendoGrid");
//grid.dataSource.read($('#txtIssueID').val(), $("#currentStep").val());
var url = '@Url.Action("ReadOnly", "ECN", new { issueID = "__id__" })';
url = url.replace('amp;', '');
window.location.href = url.replace('__id__', $("#txtECNNumber").val());
},
error: function (result) {
alert("Failed " + result);
}
});
};
function error_handler(e) {
if (e.errors) {
var message = "Errors:\n";
$.each(e.errors, function (key, value) {
if ('errors' in value) {
$.each(value.errors, function () {
message += this + "\n";
});
}
});
alert(message);
}
}
var calculate90DaysExpiration = function () {
var start = new Date();
var end = new Date($('#txtExpirationDate').val());
var diff = new Date(end - start);
// get days
var days = diff / 1000 / 60 / 60 / 24;
alert(days);
}
function DownloadAttachment(e) {
e.preventDefault();
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
var fileName = dataItem.FileName;
var attachmentID = dataItem.AttachmentID;
window.open('/ECN/DownloadFile?attachmentID=' + attachmentID + '&ecnNumber=' + "@Model.ECNNumber", '_blank');
}
$("#GetPCRB").on('click', function RedirectToPCRB() {
var pcrb = $("#txtPCRBNumber").val()
if (pcrb.indexOf('P', 0) >= 0) {
pcrb = pcrb.substring(1, pcrb.length);
}
pcrb = parseInt(pcrb);
$.ajax({
type: "Post",
url: "/ECN/PCRBExists",
data: {
pcrb: pcrb
},
success: function (result) {
if (result == "1") {
var pcrb = $("#txtPCRBNumber").val()
if (pcrb.indexOf('P', 0) >= 0) {
pcrb = pcrb.substring(1, pcrb.length);
}
window.location = '/ChangeControl/Edit?issueID=' + parseInt(pcrb);
}
else
alert("PCRB does does not exist in the system")
}
});
})
// PrintPDF
$('#PrintPDF').on('click', function () {
$.ajax({
url: "/ECN/SaveAfterSubmitByApprover",
type: "GET",
datatype: "json",
data: {
ecnNumber: $("#txtECNNumber").val(),
implementationDetails: $("#txtImplementationDetails").val()
},
success: function (data) {
var isETECN = "@Model.IsEmergencyTECN";
if (isETECN == "True" && $("#hidCloseDate").val() == "")
{
alert("E-TECN cannot be printed until approved.");
return;
}
var url = '@Url.Action("PrintECNPdf", "ECN", new { ecnNumber = "__id__" })';
//window.location.href = url.replace('__id__', $("#txtECNNumber").val());
url = url.replace('amp;', '');
window.open(url.replace('__id__', $("#txtECNNumber").val(), '_blank'));
}
});
return false;
})
function UnlockDocument() {
$.ajax({
url: "/ECN/ReleaseLockOnDocumentAdmin",
type: "GET",
datatype: "json",
data: {
issueID: ("@Model.ECNNumber")
},
success: function () {
alert('Document Unlocked!');
var url = '@Url.Action("ReadOnly", "ECN", new { issueID = "__id__" })';
url = url.replace('amp;', '');
window.location.href = url.replace('__id__', $("#txtECNNumber").val());
},
error: function (result) {
alert("ReleaseLockOnDocument - Failed " + result);
}
});
}
var returnNoOfDays = function () {
var start = new Date($('#txSubmitDate').val());
var end = new Date($('#txtExtensionDate').val());
var diff = new Date(end - start);
// get days
var days = diff / 1000 / 60 / 60 / 24;
//alert(days);
return days
}
</script>