2025-05-28 13:34:48 -07:00

2587 lines
111 KiB
Plaintext

@model Fab2ApprovalSystem.Models.MRB
@{
ViewBag.Title = "Edit";
}
@{
Layout = "_MRBLayout.cshtml";
}
<link rel="stylesheet" href="/Content/kendo/kendo.blueopal.min.css" />
<link rel="stylesheet" href="~/Content/kendogridcustom.css" />
<style>
.k-grid .k-grid-header .k-header .k-link {
height: auto;
}
.k-grid .k-grid-header .k-header {
white-space: normal;
}
.k-grid .k-edit-cell input {
width: 100%;
}
@*InLine Edit Mode*@
.k-grid-edit-row input {
width: 100%;
}
.progress-bar-black {
background-color: black;
}
.progress-bar-yellow {
background-color: yellow;
}
.progress-bar-primary {
background-color: yellow;
}
.progress-striped .progress-bar-primary {
background-image: linear-gradient(45deg, rgba(255, 255, 255, .75) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .75) 50%, rgba(255, 255, 255, .75) 75%, transparent 75%, transparent);
}
.modal-vertical-centered {
transform: translate(0, 50%) !important;
-ms-transform: translate(0, 50%) !important; /* IE 9 */
-webkit-transform: translate(0, 50%) !important; /* Safari and Chrome */
}
.k-upload .k-dropzone {
padding: 1px;
height: 2.5em;
}
.k-upload .k-upload-button {
float: right;
margin-top: 1px;
padding-bottom: 1px;
}
.k-upload .k-upload-status {
position: relative;
padding-left: 8px;
line-height: 2.5em;
right: 0px;
top: 0px;
}
.k-dropzone > em {
float: right;
padding-right: 20px;
line-height: 2.5em;
}
</style>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<input type="hidden" id="currentStep" value="@Model.CurrentStep" />
<input type="hidden" id="environment" value="@GlobalVars.DBConnection" />
if (ViewBag.Status == "Approved" && ViewBag.IsApprover == "true")
{
<input type="submit" value="Save" class="btn btn-primary btn-xs" />
<input type="button" value="Close" class="btn btn-primary btn-xs" id="CloseDocument" />
}
else if (ViewBag.Status == "Pending" && ViewBag.IsApprover == "true")
{
<div data-spy="affix">
<input type="submit" value="Save" class="btn btn-primary btn-xs" />
<input type="button" value="Approve" class="btn btn-success btn-xs" id="ApproveDocument" />
</div>
}
else if (ViewBag.Status == "Pending")
{
<div data-spy="affix">
<input type="submit" value="Save" class="btn btn-primary btn-xs" />
</div>
}
<div class="panel panel-default" style="font-size: 11px">
<div class="panel-body bg-warning">
<div class="form-horizontal col-sm-3">
<fieldset disabled>
<div class="form-group">
<label class="control-label col-sm-4">MRB #</label>
<div class="col-sm-4 col-sm-4">
@Html.TextBoxFor(model => model.MRBNumber, new { id = "txtMRBNumber", @class = "k-textbox", disabled = "disabled", style = "background-color:lightblue" })
</div>
</div>
</fieldset>
<div class="form-group">
<fieldset disabled>
<label class="control-label col-sm-4">MRB Raised Date:</label>
<div class="col-sm-8 col-sm-6">
@Html.TextBoxFor(model => model.MRBRaisedDate, new { id = "txtMRBRaisedDate", @class = "k-textbox", disabled = "disabled", style = "background-color:lightblue" })
</div>
</fieldset>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Approval Status:</label>
<div class="col-sm-8 col-sm-4">
@Html.TextBoxFor(model => model.ApprovalStatusString, new { id = "txtApprovalStatus", @class = "k-textbox", disabled = "disabled", style = "background-color:lightblue" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Approval Date:</label>
<div class="col-sm-4 col-sm-4">
@Html.TextBoxFor(model => model.ApprovalDate, new { id = "txtApprovalDate", @class = "k-textbox", disabled = "disabled", style = "background-color:lightblue" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-3">
<div class="form-group">
<label class="control-label col-sm-4">Owner:</label>
<div class="col-sm-8 col-sm-8">
@(Html.Kendo().DropDownList()
.Name("OwnerID")
.BindTo(new SelectList(ViewBag.Owners, "UserID", "FullName"))
.Value(Model.Owner.ToString())
)
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Module:</label>
<div class="col-sm-8 col-sm-8">
@(Html.Kendo().MultiSelect()
.Name("ModuleIds")
.BindTo(new SelectList(ViewBag.Modules, "ModuleID", "ModuleName"))
.Value(ViewBag.Nothing)
)
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">MRB Raised Area:</label>
<div class="col-sm-8 col-sm-8">
@(Html.Kendo().DropDownList()
.Name("MRBRaisedAreaID")
.BindTo(new SelectList(ViewBag.Modules, "ModuleID", "ModuleName"))
.Value(Model.MRBRaisedAreaID.ToString())
)
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">P/Ns Affected:</label>
<div class="col-sm-8 col-sm-8">
@(Html.Kendo().MultiSelect()
.Name("PartGroupIDs")
.BindTo(new SelectList(ViewBag.PartGroups, "PartGroupID", "PartGroupName"))
.Value(ViewBag.Nothing)
)
</div>
</div>
</div>
<div class="form-horizontal col-sm-3">
<div class="form-group">
<label class="control-label col-sm-4">Title:</label>
<div class="col-sm-8 col-sm-8">
@Html.TextBoxFor(model => model.Title, new { id = "txtTitle", @class = "k-textbox", style = "width: 100%" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Tool(s):</label>
<div class="col-sm-8 col-sm-8">
@(Html.Kendo().MultiSelect()
.Name("ToolCSV")
.DataSource(ds => ds.Read(read => read.Action("GetTools", "MRB")))
.Value((Model.ToolCSV != null ? Model.ToolCSV.Split(',') : null))
)
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Tool comments:</label>
<div class="col-sm-8 col-sm-4">
@Html.TextBoxFor(model => model.Tool, new { id = "txtTool", @class = "k-textbox" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Process:</label>
<div class="col-sm-8 col-sm-6">
@Html.TextBoxFor(model => model.Process, new { id = "txtProcess", @class = "k-textbox" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">CA#</label>
<div class="col-sm-8 col-sm-6">
@Html.TextBoxFor(model => model.CANo, new { @class = "k-textbox" })
<a href='/CorrectiveAction/Edit?IssueID=@Model.CANo' target='_blank'>View CA</a>
</div>
</div>
</div>
<div class="form-horizontal col-sm-3">
<div class="form-group">
<label class="control-label col-sm-4"># Of Lots Affected:</label>
<div class="col-sm-8 col-sm-4">
@Html.TextBoxFor(model => model.NumberOfLotsAffected, new { id = "txtNumberOfLotsAffected", @class = "k-textbox" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4"># Of Wafers Affected:</label>
<div class="col-sm-8 col-sm-4">
@Html.TextBoxFor(model => model.NumberOfWafersAffected, new { id = "txtNumberOfWafersAffected", @class = "k-textbox" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4"># Of Dies Affected:</label>
<div class="col-sm-8 col-sm-4">
@Html.TextBoxFor(model => model.NumberOfDiesAffected, new { id = "txtNumberOfDiesAffected", @class = "k-textbox" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Details Folder</label>
<div class="col-sm-8 col-sm-4">
@Html.TextBoxFor(model => model.DetailsFolder, new { id = "txtDetailsFolder", @class = "k-textbox", style = "width: 100%" })
<input type="button" value="Click here for Details" class="btn btn-primary btn-xs" id="btnDetailFolder" />
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default" style="font-size: 11px">
<div class="panel-body bg-warning">
<div class=" col-sm-6">
<div class="form-group">
<label class="control-label">Issue Description:</label>
<div>
@Html.TextAreaFor(model => model.IssueDescription, 12, 60, new { id = "txtIssueDescription", @class = "form-control", style = "font-size: 11px" })
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<div class="row">
<div class="col-sm-6"><label class="control-label">Attachment:</label></div>
<div class="col-sm-6 pull-right">
@(Html.Kendo().Upload()
.Name("files")
.Async(a => a
.Save("AttachSave", "MRB", new { mrbNumber = Model.MRBNumber })
.AutoUpload(true)
)
.ShowFileList(false)
.Events(events => events
.Success("onFileUploadSuccess")
.Upload("checkFileType")
)
)
</div>
</div>
<div>
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.MRBAttachment>()
.Name("Attachments")
.Columns(columns =>
{
columns.Bound(a => a.AttachmentID).Visible(false);
columns.Bound(a => a.MRBNumber).Visible(false);
columns.Bound(a => a.FileName).Template(@<text> @Html.ActionLink(@item.FileName.ToString(), null)</text>).Width("100px");
//.ClientTemplate("<a href='" + GlobalVars.AttachmentUrl + "MRB/#=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("Delete").Click("DeleteAttachment"));
columns.Command(command => command.Custom("View").Click("DownloadAttachment"));
})
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:180px; width:100%; font-size: 10px" })
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.Model(model =>
{
model.Id(p => p.AttachmentID);
})
.PageSize(10)
.Read(read => read.Action("Attachment_Read", "MRB", new { mrbNumber = Model.MRBNumber }))
)
)
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default" style="font-size: 11px">
<div class="panel-body bg-warning">
<div class="col-sm-3">
<div class="form-group">
<label class="control-label">Issue Detected Date:</label>
<div>
@*@Html.TextBoxFor(model => model.IssueDetectedDate, new { id = "txtIssueDetectedDate", @class = "k-textbox" })*@
@(Html.Kendo().DateTimePickerFor(model => model.IssueDetectedDate)
.Name("txtIssueDetectedDate")
//.Value()
)
</div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<label class="control-label">Issue Start Date/Time:</label>
<div>
@(Html.Kendo().DateTimePickerFor(model => model.IssueStartDate)
.Name("txtIssueStartDate")
.Events(e => e.Change("IssueStartTimeChangeAlert"))
)
</div>
</div>
</div>
<div class="col-sm-3">
<div>
<label class="control-label">Issue End Date/Time:</label>
<div>
@(Html.Kendo().DateTimePickerFor(model => model.IssueEndDate)
.Name("txtIssueEndDate")
.Events(e => e.Change("IssueEndTimeChangeAlert"))
)
</div>
</div>
</div>
<div class="form-horizontal col-sm-3">
<div class="form-group">
<label class="control-label col-sm-5">Customer Impacted?:</label>
<div class="form-control-static col-sm-5">
@Html.EditorFor(model => model.CustomerImpacted)
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default" style="font-size: 11px">
<div class="panel-body bg-warning">
<div class="col-sm-6">
<div class="form-group">
<label class="control-label">Risk Assessments:</label>
<div>
@(Html.Kendo().MultiSelect()
.Name("RiskAssessmentIDs")
.BindTo(new SelectList(ViewBag.RiskAssessments, "RiskAssessmentID", "RiskAssessmentName"))
.Value(ViewBag.Nothing)
)
</div>
</div>
</div>
<div class=" col-sm-12">
<div class="form-group">
<label class="control-label">Notes:</label>
<div>
@Html.TextAreaFor(model => model.Notes, 12, 50, new { id = "txtNotes", @class = "form-control", style = "font-size: 11px" })
</div>
</div>
</div>
</div>
</div>
<div class="panel-body bg-warning">
<div>
<input type="button" id="AddContainmentActionItem" value="Add Containment Action" class="btn btn-primary btn-xs" />
</div>
<div id="containmentAction" class="k-content">
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.ContainmentActionObj>()
.Name("ContainmentActions")
.Columns(columns =>
{
columns.Bound(l => l.ContainmentActionID).Visible(false);
columns.Bound(l => l.ResponsibilityOwnerID).Visible(false);
columns.Bound(l => l.CurrentResponsibilityOwnerID).Visible(false);
columns.Bound(l => l.ContainmentAction);
columns.Bound(l => l.ResponsibilityOwner).Width("150px"); ; ;
columns.Bound(l => l.ECD).Format("{0:d}").Width("150px"); ;
columns.Bound(l => l.ImplementedDate).Format("{0:d}").Width("150px");
columns.Command(c => c.Custom("Edit").Click("EditContainmentActionItem")).Width("90px");
// columns.Template(t => { }).HeaderTemplate("").ClientTemplate(@"
// <a href='javascript: void(0)' class='abutton edit' onclick='editContainmentRow(this)' title='button edit'>button edit</a>
// <a href='javascript: void(0)' class='abutton delete' onclick='deleteContainmentRow(this)' title='button delete'>button delete</a>").Width("150px");
columns.Template(t => { }).HeaderTemplate("").ClientTemplate(@"
<a href='javascript: void(0)' class='abutton delete' onclick='deleteContainmentRow(this)' title='button delete'>button delete</a>").Width("150px");
})
//.ToolBar(toolbar => toolbar.Create().Text("Add Contianment Action"))
.Editable(editable => editable.Mode(GridEditMode.InLine))
.HtmlAttributes(new { style = "width:100%; font-size: 12px" })
.Scrollable()
.Sortable()
.Filterable()
//.Events(e => e.Edit("onContainmentEdit"))
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5)
)
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(l => l.ContainmentActionID);
model.Field(p => p.ContainmentActionID).Editable(false);
model.Field(p => p.MRBNumber).DefaultValue(Model.MRBNumber);// Set the MRB Number as a default value for grid model field
})
.PageSize(50)
.Read(read => read.Action("GetContainmentActions", "MRB", new { mrbNumber = Model.MRBNumber }))
//.Create(create => create.Action("InsertContainmentAction", "MRB"))
//.Update(update => update.Action("UpdateContainmentAction", "MRB"))
.Destroy(destroy => destroy.Action("DeleteContainmentAction", "MRB"))
)
)
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" style="padding-top: 5px; font-size: 12px;">
<table cellspacing="50" cellpadding="50" border="0" width="100%">
<tr>
<td width="33%">
<a class="k-button k-button-icontext k-grid-add" href="javascript: void(0)" id="AddDisposition" style="padding-left: 10px;">
<span class="k-icon k-add"></span>
Add Disposition
</a>
</td>
<td width="33%">
<div class="text-center">
@if (GlobalVars.IsAdmin(Session) && (Request.IsAuthenticated))
{
<a class="k-button" href="javascript: void(0)" id="addMRBFlagAndHoldToSPN" style="padding-left: 10px;">
Add MRB Flag/Hold to SPN
</a>
}
</div>
</td>
<td>
<table class="pull-right" border="0" cellspacing="5">
<tr>
<td valign="middle">
<ul style="padding-right: 10px; list-style-type: none;">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="font-size: 12px">MRB Flag/Hold Reports<b class="caret"></b></a>
<ul class="dropdown-menu" style="font-size: 11px">
<li><a href="#" id="mrbReport">Not implemented yet.</a></li>
</ul>
</li>
</ul>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div id="dispositionsID" class="k-content">
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.Disposition>()
.Name("Dispositions")
.Columns(columns =>
{
columns.Bound(l => l.DispositionID).Visible(false);
columns.Bound(l => l.MRBNumber).Visible(false);
columns.Bound(l => l.DispositionType).Width("70px");
columns.Bound(l => l.DispositionName).Width("150px"); ;
//columns.Bound(l => l.CloseToQDBOption).ClientTemplate("#=CloseToQDBOption.CloseToQDBOption#").Width("120px");
columns.Bound(l => l.CloseToQDBOptionString).Width("120px");
columns.Bound(l => l.DispositionNotes);
columns.Command(command => {
command.Custom("Edit").Click("EditDisposition").HtmlAttributes(new { style = "font-size: 8px" });
command.Custom("Delete").Click("DeleteDisposition").HtmlAttributes(new { style = "font-size: 8px" }); ; }
).Width("150px");
//columns.Template(t => { }).HeaderTemplate("").ClientTemplate(@"
//<a href='javascript: void(0)' class='abutton edit' onclick='editDispositionRow(this)' title='button edit'>button edit</a>
//<a href='javascript: void(0)' class='abutton delete' onclick='deleteDispositionRow(this)' title='button delete'>button delete</a>").Width("100px");
})
//.ToolBar(toolbar => toolbar.Create().Text("Add Disposition Notes"))
//.Editable(editable => editable.Mode(GridEditMode.InLine))
.HtmlAttributes(new { style = "height: 360px; width:100%; font-size: 10px" })
.Scrollable()
.Sortable()
.Filterable()
//.Events(e => e.Edit("onDispositionEdit"))
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(l => l.DispositionID);
model.Field(p => p.MRBNumber).DefaultValue(Model.MRBNumber);// Set the MRB Number as a default value for grid model field
//model.Field(l => l.CloseToQDBOption).DefaultValue(new Fab2ApprovalSystem.ViewModels.CloseToQDBOptionViewModel()
//{
// CloseToQDBOptionID = 0,
// CloseToQDBOption = "No"
//});
//model.Field(l => l.DispositionType).Editable(false);
//model.Field(l => l.DispositionName).Editable(false);
})
.PageSize(50)
.Read(read => read.Action("GetDispostions", "MRB", new { mrbNumber = Model.MRBNumber }))
//.Create(create => create.Action("InsertDisposition", "MRB"))
//.Update(update => update.Action("UpdateDisposition", "MRB")) //.Events(e => e.RequestEnd("DispositionOnUpdate"))
//.Destroy(destroy => destroy.Action("DeleteDisposition", "MRB"))
)
)
</div>
</div>
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-heading" style="padding-top: 5px;">
<table cellspacing="50" cellpadding="50" border="0" width="100%">
<tr>
<td>
<table class="pull-left" border="0" cellspacing="5">
<tr>
<td valign="middle">
<ul>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="font-size: 12px">Lot Options<b class="caret"></b></a>
<ul class="dropdown-menu" style="font-size: 11px">
<li><a href="#" id="showLotSearchFormButton">Search Lots</a></li>
<!--<li><a href="#" id="lotAddFormButton">Add Lot</a></li>-->
<li><a href="#" id="yieldParamTrend">Yield Params Trend</a></li>
<li><a href="#" id="lotExport">Export Lots</a></li>
<li><a href="#" id="lotDeleteAllButton">Delete All Lots</a></li>
<li><a href="#" id="ExportMRBHoldFlagReport">Export MRBHoldFlag Report</a></li>
<li><a href="#" id="PreviewMRBHoldFlagTobeSentToSPN">Preview MRBHoldFlag To be sent to SPN</a></li>
</ul>
</li>
</ul>
</td>
@*<td>
<button class="k-textbox" data-toggle="modal" id="showLotSearchFormButton">
Search Lots
</button>
</td>
<td>&nbsp;</td>
<td>
<button class="k-textbox" data-toggle="modal" id="lotAddFormButton">
Add Lot
</button>
</td>
<td>&nbsp;</td>
<td>
<button class="k-textbox" id="yieldParamTrend">
Yield Params Trend
</button>
</td>*@
</tr>
</table>
</td>
<td>
<table class="pull-right" cellspacing="50" cellpadding="50" border="0">
<tr>
<td>
@(Html.Kendo().Upload()
.Name("Lotfile")
.Messages(m => m.Select("Import Lots using an Excel file"))
.Async(a => a.Save("ExcelLotOpen", "MRB", new { mrbNumber = Model.MRBNumber }).AutoUpload(true))
.ShowFileList(false)
.Events(events => events.Success("onLotFileUploadSuccess").Error("onLotUploadError").Upload("onLotUpload"))
)
</td>
<td>
@if (ViewBag.IsApprover == "true")
{
@*<input type="buttodn" value="Send MRB Hold Flag to SPN" class="btn btn-danger btn-xs" id="SendMRBSPNFlag" />*@
}
</td>
<td>&nbsp;</td>
<td>
<label class="control-label">Set All Lots to Dispo Type:</label>
</td>
<td>&nbsp;</td>
<td>
@(Html.Kendo().DropDownList()
.Name("DispoTypes")
.BindTo(new SelectList(ViewBag.DispoTypes, "DispositionType", "DispositionType"))
.Value("1")
)
</td>
<td>&nbsp;</td>
<td>
<input type="button" value="Go" class="btn btn-primary btn-xs" id="setDispoType" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class="panel-body bg-warning">
<div class="col-sm-offset-0">
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.Lot>()
.Name("Lots")
.Columns(columns =>
{
columns.Bound(l => l.LotID).Visible(false);
columns.Bound(l => l.LotNumber);
columns.Bound(l => l.DieLotNumber);
columns.Bound(l => l.WipPartNo);
columns.Bound(l => l.DispoType).Width("50px"); ;
columns.Bound(l => l.WaferCount);
columns.Bound(l => l.DiePartNo);
columns.Bound(l => l.DieCount);
columns.Bound(l => l.SourceLot);
columns.Bound(l => l.TotalCost);
columns.Bound(l => l.ProductFamily).Width("50px");
columns.Bound(l => l.Gen).Width("50px");
columns.Bound(l => l.Hexsize).Width("50px");
columns.Bound(l => l.Voltage).Width("50px");
columns.Bound(l => l.Location).Width("50px");
columns.Bound(l => l.Status).Width("50px");
columns.Bound(l => l.QualityCode).Width("50px");
columns.Bound(l => l.LotID).Template(@<text> @Html.ActionLink(@item.LotNumber.ToString(), null)</text>)
.ClientTemplate("<a href='http://" + GlobalVars.WSR_URL + "/user/wsr2/wsr_lot.php?lot=#=LotNumber#' target='_blank'>View</a>").Title("History").Width("50px");
columns.Bound(l => l.LotID).Template(@<text> @Html.ActionLink(@item.LotNumber.ToString(), null)</text>)
.ClientTemplate("<a href='http://" + GlobalVars.WSR_URL + "/user/probe/wafyld.php?lot=#=LotNumber#' target='_blank'>View</a>").Title("Probe Results").Width("50px");
columns.Bound(l => l.LotID).Template(@<text> @Html.ActionLink(@item.LotNumber.ToString(), null)</text>)
.ClientTemplate("<a href='http://" + GlobalVars.WSR_URL + "/user/probe/allmaps.php?lot=#=LotNumber#' target='_blank'>View</a>").Title("Wafer Maps").Width("50px");
columns.Bound(l => l.LotID).Template(@<text> @Html.ActionLink(@item.LotNumber.ToString(), null)</text>)
.ClientTemplate("<a href='file://///temirwfp001/AVIArchive/NSX/import/current/lot/#=LotNumber#' + lot' target='_blank'>Show</a>").Title("AVI").Width("50px");
columns.Bound(l => l.LotID).Template(@<text> @Html.ActionLink(@item.LotNumber.ToString(), null)</text>)
.ClientTemplate("<a href='file:////" + GlobalVars.NDriveURL + "/FAB_Engineering/01_Other/FabLotDispositionLotInfo/#=ParentLotNumber#' + ' target='_blank'>Show</a>").Title("Lot Data").Width("50px");
columns.Bound(p => p.OtherMRBs).ClientTemplate("#=buildMRBLinks(OtherMRBs)#");
//columns.Bound(l => l.LotDispositionsLinkedToLot).Width("100px");
columns.Bound(p => p.LotDispositionsLinkedToLot).ClientTemplate("#=buildLDLinks(LotDispositionsLinkedToLot)#");
//columns.Command(command => { command.Edit(); command.Destroy(); }).Width("200px");
columns.Template(t => { }).HeaderTemplate("").ClientTemplate(@"
<a href='javascript: void(0)' class='abutton edit' onclick='editRow(this)' title='button edit'>button edit</a>
<a href='javascript: void(0)' class='abutton delete' onclick='deleteRow(this)' title='button delete'>button delete</a>");
})
//.ToolBar(toolbar => toolbar.Create().Text("Add Lot"))
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Sortable()
.Scrollable()
//.Filterable()
.HtmlAttributes(new { style = "height:325px; width:100%; font-size: 10px" })
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.Events(e => e.RequestEnd("UpdateLotWaferDieCount"))
.Model(model =>
{
model.Id(p => p.LotID);
model.Field(p => p.LotID).Editable(false);
model.Field(p => p.LotNumber).Editable(false);
model.Field(p => p.DieLotNumber).Editable(false);
model.Field(p => p.WipPartNo).Editable(false);
model.Field(p => p.WaferCount).Editable(false);
model.Field(p => p.DiePartNo).Editable(false);
model.Field(p => p.DieCount).Editable(false);
model.Field(p => p.SourceLot).Editable(false);
model.Field(p => p.TotalCost).Editable(false);
model.Field(p => p.ProductFamily).Editable(false);
model.Field(p => p.Gen).Editable(false);
model.Field(p => p.Hexsize).Editable(false);
model.Field(p => p.Voltage).Editable(false);
model.Field(p => p.Location).Editable(false);
model.Field(p => p.Status).Editable(false);
model.Field(p => p.QualityCode).Editable(false);
model.Field(p => p.OtherMRBs).Editable(false);
model.Field(p => p.LotDispositionsLinkedToLot).Editable(false);
}
)
.PageSize(50)
.Read(read => read.Action("GetMRBLots", "MRB", new { mrbNumber = Model.MRBNumber }))
.Update(update => update.Action("UpdateMRBLot", "MRB"))
.Destroy(destroy => destroy.Action("DeleteMRBLot", "MRB"))
.Events(e => e.Error("UpdateMRBLotError"))
//.Create(create => create.Action("CreateLots", "MRB"))
)
.Resizable(resize => resize.Columns(true))
.Events(e => e.Edit("onEdit"))
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
)
</div>
</div>
</div>
<div class="panel panel-default" style="font-size: 11px">
<div class="panel-body bg-warning">
@if (ViewBag.IsApprover == "true")
{
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-4">Module Owner Approver:</label>
<div class="col-sm-8 col-sm-8">
@Html.TextBoxFor(model => model.OwnerApprover, new { id = "OwnerApprover", @class = "k-textbox", style = "width:100%" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Product Engineering Approver/s:</label>
<div class="col-sm-8 col-sm-8">
@Html.TextBoxFor(model => model.PEApprover, new { id = "PEApprover", @class = "k-textbox", style = "width:100%" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-4">Mfg Engineering Approver/s:</label>
<div class="col-sm-8 col-sm-8">
@Html.TextBoxFor(model => model.MfgEngineeringAppover, new { id = "MfgEngineeringAppover", @class = "k-textbox", style = "width:100%" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Other Approver/s:</label>
<div class="col-sm-8 col-sm-8">
@Html.TextBoxFor(model => model.OtherApprovers, new { id = "OtherApprovers", @class = "k-textbox", style = "width:100%" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-4">Yield Engineering Approver/s:</label>
<div class="col-sm-8 col-sm-8">
@Html.TextBoxFor(model => model.YEApprover, new { id = "YEApprover", @class = "k-textbox", style = "width:100%" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Quality Approver/s:</label>
<div class="col-sm-8 col-sm-8">
@Html.TextBoxFor(model => model.QualityApprovers, new { id = "QualityApprovers", @class = "k-textbox", style = "width:100%" })
</div>
</div>
</div>
}
else
{
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-4">Module Owner Approver:</label>
<div class="col-sm-8 col-sm-8">
@Html.TextBoxFor(model => model.OwnerApprover, new { id = "OwnerApprover", @class = "k-textbox", style = "width:100%", disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Product Engineering Approver/s:</label>
<div class="col-sm-8 col-sm-8">
@Html.TextBoxFor(model => model.PEApprover, new { id = "PEApprover", @class = "k-textbox", style = "width:100%", disabled = "disabled" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-4">Mfg Engineering Approver/s:</label>
<div class="col-sm-8 col-sm-8">
@Html.TextBoxFor(model => model.MfgEngineeringAppover, new { id = "MfgEngineeringAppover", @class = "k-textbox", style = "width:100%", disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Other Approver/s:</label>
<div class="col-sm-8 col-sm-8">
@Html.TextBoxFor(model => model.OtherApprovers, new { id = "OtherApprovers", @class = "k-textbox", style = "width:100%", disabled = "disabled" })
</div>
</div>
</div>
<div class="form-horizontal col-sm-4">
<div class="form-group">
<label class="control-label col-sm-4">Yield Engineering Approver/s:</label>
<div class="col-sm-8 col-sm-8">
@Html.TextBoxFor(model => model.YEApprover, new { id = "YEApprover", @class = "k-textbox", style = "width:100%", disabled = "disabled" })
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4">Quality Approver/s:</label>
<div class="col-sm-8 col-sm-8">
@Html.TextBoxFor(model => model.QualityApprovers, new { id = "QualityApprovers", @class = "k-textbox", style = "width:100%", disabled = "disabled" })
</div>
</div>
</div>
}
</div>
</div>
@*<div class="panel panel-default" style="font-size: 11px">
<div class="panel-body bg-warning">
</div>
</div>*@
}
<!-- Button trigger modal -->
<!-- Modal -->
<div class="modal fade" id="LotSearchForm" tabindex="0" 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">Lot Search</h4>
</div>
<div class="modal-body ">
<div class="row">
<div class="col-sm-12">
<div class="controls">
<label for="Category">Search By:</label>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="control-group">
<div class="controls">
<div id="Criteria" class="k-content">
@(Html.Kendo().DropDownList()
.Name("LotCriteria")
.DataTextField("Text")
.DataValueField("Value")
//.Events(e => e.Change("change"))
.BindTo(new List<SelectListItem>() {
new SelectListItem() {
Text = "Lot/DieLotNumber",
Value = "LotNo"
},
new SelectListItem() {
Text = "Location",
Value = "Location"
}
//,new SelectListItem() {
// Text = "Gen",
// Value = "Gen"
//}
})
.Value("1")
)
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="control-group">
<div class="controls">
@Html.TextBox("txtSearch", null, new { @class = "k-textbox" })
</div>
</div>
</div>
<div class="col-sm-4">
<div class="control-group">
<div class="controls">
@*<input style="margin-top: 5px;" type="button" id='jqxButtonSearchLots' value="Search Lots" class="k-textbox" />*@
<button type="button" class="k-textbox" id='jqxButtonSearchLots'>Search Lots</button>
</div>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-sm-5">
<div class="control-group">
<div class="controls">
<select multiple id="jiraVersion" style="height: 250px; width: 200px; font-family: Tahoma; border-color: lightgrey" class="jqx-combobox-multi-item"></select>
@*<div id='lstSearchedLots'>
</div>*@
<br />
<div>
@*<input style="margin-top: 20px;" type="button" id='jqxButtonAddLots' value="Add Lots" class="k-textbox" />*@
<button type="button" class="k-textbox" id='jqxButtonAddLots'>Add Lots</button>
</div>
</div>
</div>
</div>
<div class="col-sm-7">
<div class="control-group">
<div class="controls">
<div id='lstSelectedLots'>
</div>
<br />
<div>
@*<input style="margin-top: 20px;" type="button" id='jqxButtonRemoveLots' value="Remove Lots" class="k-textbox" />*@
<button type="button" class="k-textbox" id='jqxButtonRemoveLots'>Remove Lots</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="k-textbox" data-dismiss="modal">Close</button>
<button type="button" class="k-textbox" id="submitSelectLot">Save changes</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="ApprovalComments" 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">Enter Approval Comments:</h4>
</div>
<div class="modal-body">
<textarea class="form-control" rows="3" id="approvalComments"></textarea>
</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="submitApprovalComments">Confirm Approval</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="LotAddForm" 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">Enter Lot Information:</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-4">
<div class="control-group">
<label for="LotNumber">Wafer Lot#:</label>
<div class="controls">
<input type="text" class="form-control" id="LotNumber" placeholder="LotNumber">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="control-group">
<label for="LotDescription">Lot Description:</label>
<div class="controls">
<input type="text" class="form-control" id="LotDescription" placeholder="LotDescription">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="control-group">
<label for="NewPartNo">New Part#:</label>
<div class="controls">
<input type="text" class="form-control" id="NewPartNo" placeholder="NewPartNo">
</div>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-sm-4">
<div class="control-group">
<label for="WipPartNo">WIP Part No:</label>
<div class="controls">
<input type="text" class="form-control" id="WipPartNo" placeholder="WipPartNo">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="control-group">
<label for="DiePartNo">DiePart#:</label>
<div class="controls">
<input type="text" class="form-control" id="DiePartNo" placeholder="DiePartNo">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="control-group">
<label for="ProductFamily">Product Family:</label>
<div class="controls">
<input type="text" class="form-control" id="ProductFamily" placeholder="ProductFamily">
</div>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-sm-4">
<div class="control-group">
<label for="Gen">Gen:</label>
<div class="controls">
<input type="number" class="form-control" id="Gen" placeholder="Gen">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="control-group">
<label for="Channel">Channel:</label>
<div class="controls">
<input type="text" class="form-control" id="Channel" placeholder="Channel">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="control-group">
<label for="Hexsize">Hexsize:</label>
<div class="controls">
<input type="number" class="form-control" id="Hexsize" placeholder="Hexsize">
</div>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-sm-4">
<div class="control-group">
<label for="Location">Location:</label>
<div class="controls">
<input type="text" class="form-control" id="Location" placeholder="Location">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="control-group">
<label for="WaferCount">Wafer Count:</label>
<div class="controls">
<input type="number" class="form-control" id="WaferCount" placeholder="WaferCount">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="control-group">
<label for="DieCount">Die Count:</label>
<div class="controls">
<input type="number" class="form-control" id="DieCount" placeholder="DieCount">
</div>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-sm-4">
<div class="control-group">
<label for="Voltage">Voltage:</label>
<div class="controls">
<input type="number" class="form-control" id="Voltage" placeholder="Voltage">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="control-group">
<label for="TotalCost">Total Cost:</label>
<div class="controls">
<input type="number" class="form-control" id="TotalCost" placeholder="TotalCost">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="control-group">
<label for="DieLotNumber">Die Lot#:</label>
<div class="controls">
<input type="number" class="form-control" id="DieLotNumber" placeholder="DieLotNumber">
</div>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-sm-4">
<div class="control-group">
<label for="Dispo Type">Dispo Type:</label>
<div class="controls">
<input type="text" class="form-control" id="DispoType" placeholder="DispoType">
</div>
</div>
</div>
<div class="col-sm-4">
<div class="control-group">
<label for="Status">Status:</label>
<div class="controls">
<input type="text" class="form-control" id="Status" placeholder="Status">
</div>
</div>
</div>
</div>
<br />
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="submitLotAdd">Save changes</button>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade modal-vertical-centered" id="pleaseWaitDialog" tabindex="-1" role="progressbar" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog " style="width: 500px; height: 200px">
<div class="modal-content">
<div class="modal-header">
<h5>Please wait while data is being set to SPN...</h5>
</div>
<div class="progress progress-striped active">
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
<span class="sr-only">100% Complete</span>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="ContainmentActionForm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content" style="width: 600px">
<div class="modal-header" style="background-color: #e4daa1; font-size: 15px;">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">Containment Action:</h4>
</div>
<div class="modal-body" style="background-color: #75adc6; font-size: 12px;">
<table width="100%">
<tr>
<td width="100%">
<table class="table-condensed" border="0" width="100%">
<tr>
<td width="25%">
<label for="txtContainmentAction">Containment Action:</label>
</td>
<td width="75%">
@Html.TextArea("txtContainmentAction", "", 5, 20, new { @class = "k-textbox", style = "width:100%" })
</td>
</tr>
<tr>
<td width="25%">
<label for="ResponsibilityOwner">Responsibility Owner:</label>
</td>
<td width="75%">
@(Html.Kendo().DropDownList()
.Name("ResponsibilityOwnerIds")
.BindTo(new SelectList(ViewBag.UserList, "UserID", "UserName"))
.Value(ViewBag.Nothing)
.OptionLabel("Select")
)
</td>
</tr>
<tr>
<td width="25%">
<label for="txtECD">ECD:</label>
</td>
<td width="75%">
@(Html.Kendo().DatePicker()
.Name("txtECD")
)
</td>
</tr>
<tr>
<td width="25%">
<label for="txtImplementedDate">Implemented Date:</label>
</td>
<td width="75%">
@(Html.Kendo().DatePicker()
.Name("txtImplementedDate")
)
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class="modal-footer" style="background-color: #e4daa1; font-size: 15px;">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" id="SaveContainmentAction">OK</button>
</div>
</div>
</div>
</div>
@Html.Partial("_DispositionType")
<script type="text/javascript">
var isDirty = 'false';
var connection = $("#environment").val();
var containmentActionOperation = '';
var containmentActionItemID;
$(document).ready(function () {
$("#OwnerID").on('change', function () { isDirty = 'true'; });
$("#txtTool").on('change', function () { isDirty = 'true'; });
$("#ToolCSV").on('change', function () { isDirty = 'true'; });
$("#txtNumberOfLotsAffected").on('change', function () { isDirty = 'true'; });
$("#txtIssueDescription").on('change', function () { isDirty = 'true'; });
$("#DepartmentIDs").on('change', function () { isDirty = 'true'; });
$("#MRBRaisedDate").on('change', function () { isDirty = 'true'; });
$("#ModuleIds").on('change', function () { isDirty = 'true'; });
$("#txtProcess").on('change', function () { isDirty = 'true'; });
$("#MRBRaisedAreaID").on('change', function () { isDirty = 'true'; });
$("#PartGroupIDs").on('change', function () { isDirty = 'true'; });
$("#txtIssueDetectedDate").on('change', function () { isDirty = 'true'; });
$("#txtIssueStartDate").on('change', function () { isDirty = 'true'; });
$("#txtIssueEndDate").on('change', function () { isDirty = 'true'; });
$("#RiskAssessmentIDs").on('change', function () { isDirty = 'true'; });
$('form').submit(function (e) {
e.preventDefault();
SaveData();
return false;
});
$('#yieldParamTrend').on('click', function (e) {
window.open('http://@GlobalVars.WSR_URL/user/yieldchart/form.php', '_blank');
});
var SaveData = function () {
isDirty = 'false';
var mrbNumber = $("#txtMRBNumber").val();
var title = $("#txtTitle").val();
var mrbRaisedAreaID = $("#MRBRaisedAreaID").data("kendoDropDownList").value();
var owner = $("#OwnerID").data("kendoDropDownList").value();
var tool = $("#txtTool").val();
var toolCSV = $("#ToolCSV").data("kendoMultiSelect").value().join(",");
var numberOfLotsAffected = $("#txtNumberOfLotsAffected").val();
var moduleIDs = $("#ModuleIds").data("kendoMultiSelect").value();
var process = $("#txtProcess").val();
var CANo = $("#CANo").val();
var partGroupIDs = $("#PartGroupIDs").data("kendoMultiSelect").value();
var numberOfWafersAffected = $("#txtNumberOfWafersAffected").val();
var numberOfDiesAffected = $("#txtNumberOfDiesAffected").val();
var issueDescription = $("#txtIssueDescription").val();
var notes = $("#txtNotes").val();
var issueDetectedDate = $("#txtIssueDetectedDate").val();
var issueStartDate = $("#txtIssueStartDate").val();
var issueEndDate = $("#txtIssueEndDate").val();
var riskAssessmentIDs = $("#RiskAssessmentIDs").data("kendoMultiSelect").value();
//var dispositionIDs = $("#DispositionIDs").data("kendoMultiSelect").value();
var ownerApprover = $("#OwnerApprover").val();
var peApprover = $("#PEApprover").val();
var mfgEngineeringAppover = $("#MfgEngineeringAppover").val();
var otherApprovers = $("#OtherApprovers").val();
var yeApprover = $("#YEApprover").val();
var qualityApprovers = $("#QualityApprovers").val();
var detailsFolder = $("#txtDetailsFolder").val();
var customerImpacted;
if ($('#CustomerImpacted').is(':checked'))
customerImpacted = 1;
else
customerImpacted = 0;
$.ajax({
url: '/MRB/Edit',
type: "POST",
//dataType: "text",
contentType: "application/json; charset=utf-8",
data: JSON.stringify(
{
MRBNumber: mrbNumber,
MRBRaisedAreaID: mrbRaisedAreaID,
Owner: owner,
Title: title,
Tool: tool,
NumberOfLotsAffected: numberOfLotsAffected,
ModuleIDs: moduleIDs,
Process: process,
CANo: CANo,
PartGroupIDs: partGroupIDs,
NumberOfWafersAffected: numberOfWafersAffected,
NumberOfDiesAffected: numberOfDiesAffected,
IssueDescription: issueDescription,
Notes: notes,
IssueDetectedDate: issueDetectedDate,
IssueStartDate: issueStartDate,
IssueEndDate: issueEndDate,
RiskAssessmentIDs: riskAssessmentIDs,
//DispositionIDs: dispositionIDs,
OwnerApprover: ownerApprover,
PEApprover: peApprover,
MfgEngineeringAppover: mfgEngineeringAppover,
OtherApprovers: otherApprovers,
YEApprover: yeApprover,
QualityApprovers: qualityApprovers,
DetailsFolder: detailsFolder,
CustomerImpacted: customerImpacted,
ToolCSV: toolCSV
}),
success: function (result) {
alert("Data Saved");
},
error: function (jqXHR, textStatus, errorThrown) {
alert("Failed " + jqXHR.responseText);
}
});
}
$('#CloseDocument').on('click', function () {
//if (isDirty == 'true') {
// isDirty = 'false';
// SaveData();
//}
SaveData();
$.ajax({
url: "/MRB/CloseDocument",
type: "GET",
datatype: "json",
data: {
mrb: $("#txtMRBNumber").val()
},
success: function (data) {
alert("Document successfully closed!!!")
var url = '@Url.Action("Edit", "MRB", new { issueID = "__id__" })';
url = url.replace('amp;', '');
window.location.href = url.replace('__id__', $("#txtMRBNumber").val());
}
});
})
}); // end of document.ready function
//
displayEmptySelectedLotsList();
//
//displayEmptySearchedLotsList();
function onFileUploadSuccess(e) {
if (e && e.response && e.response.errors) {
if (e.response.errors.length > 0) {
var msg = "There were errors while attaching files:\r\n";
e.response.errors.forEach(function (val, idx, ary) {
msg = msg + val + "\r\n";
});
alert(msg);
}
}
var grid = $("#Attachments").data("kendoGrid");
grid.dataSource.read($('#txtMRBNumber').val());
}
function checkFileType(e) {
var attachmentGrid = $("#Attachments").data("kendoGrid");
var files = e.files;
$.each(files, function () {
if (!this.extension.toLowerCase().match(/^(.doc|.docx|.ppt|.pptx|.xls|.xlsx|.pdf|.gif|.jpeg|.jpg|.bmp|.png|.txt)$/)) {
alert("Only Word/PowerPoint/Excel/PDF/Image/Text files can be uploaded!")
e.preventDefault();
}
var i;
for (i = 0; i < attachmentGrid.dataSource.total(); i++) {
var item = attachmentGrid.dataSource.at(i);
if (item.FileName == this.name) {
if (confirm("Are you sure you want to overwrite file: " + this.name) == false) {
e.preventDefault();
alert("File upload aborted");
}
}
}
});
}
function onLotFileUploadSuccess(e) {
var grid = $("#Lots").data("kendoGrid");
grid.dataSource.read($('#txtMRBNumber').val());
UpdateLotWaferDieCount();
}
function ConfirmLotExcelImport(e) {
if (confirm("No tool info for lot genealogy tracing, please validate to ensure all & only MRB affected child lots uploaded ")) {
e.preventDefault();
}
}
function UpdateLotWaferDieCount()
{
$.ajax({
url: "/MRB/GetLotWaferDieCount",
type: "POST",
datatype: "json",
data: {
mrbNumber: $('#txtMRBNumber').val()
},
success: function (result) {
//var obj = JSON.parse(data);
var arrdata = result.split('~');
$('#txtNumberOfLotsAffected').val(arrdata[0]);
$('#txtNumberOfWafersAffected').val(arrdata[1]);
$('#txtNumberOfDiesAffected').val(arrdata[2]);
},
error: function (result) {
alert("Failed " + result);
}
});
}
$("#Lotfile").click(function (e) {
var Tools = $("#ToolCSV").data("kendoMultiSelect").value();
if (Tools == "NA") {
if (confirm("No Tool was selected for Lot Genealogy Tracing\n Please validate to ensure all & only MRB affected child lots uploaded\n Do you wish to proceed?")) {
var msg = CanAddLots();
if (msg != null) {
alert(msg);
return false;
}
return true;
}
else
return false;
}
else {
var msg = CanAddLots();
if (msg != null) {
alert(msg);
return false;
}
return true;
}
});
function onLotUploadError(e) {
// note that this event will fire if there are warnings returned by the server
var msg = '';
var doSuccessActions = false;
if (e.XMLHttpRequest != null) {
msg = e.XMLHttpRequest.responseText;
// if it's just a warning, set flag to run success event
if (e.XMLHttpRequest.status == 200)
doSuccessActions = true;
}
if (doSuccessActions) {
onLotFileUploadSuccess(e);
alert(msg);
} else {
alert('Error processing excel upload:\n' + msg);
}
}
function CanAddLots() {
var issueStartDate = $("#txtIssueStartDate").val();
var issueEndDate = $("#txtIssueEndDate").val();
if ((issueStartDate == "") || (issueEndDate == "")) {
return "Issue start and end date must be filled in.";
}
var toolIDs = $("#ToolCSV").data("kendoMultiSelect").value();
if ((toolIDs == null) || (toolIDs.length == 0)) {
return "At least one tool must be selected.";
}
return null;
}
function onLotUpload(e) {
/*var msg = CanAddLots();
if (msg != null) {
alert(msg);
e.preventDefault();
}*/
var files = e.files;
$.each(files, function () {
if (this.extension.toLowerCase() != ".xls" && this.extension.toLowerCase() != ".xlsx") {
alert("Only an excel file can be used to import Lots!")
e.preventDefault();
}
})
}
function DeleteAttachment(e) {
e.preventDefault();
if (confirm("Are you sure you want to delete this request?")) {
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
var fileName = dataItem.FileName;
var attachmentID = dataItem.AttachmentID;
$.ajax({
url: "/MRB/DeleteAttachment",
type: "POST",
datatype: "json",
data: {
attachmentID: attachmentID,
fileName: fileName
},
success: function (data) {
var grid = $("#Attachments").data("kendoGrid");
grid.dataSource.read($('#txtMRBNumber').val());
},
error: function (result) {
alert("Failed " + result);
}
});
}
}
// Region Search Lot
$("#showLotSearchFormButton").on('click', function () {
/* var msg = CanAddLots();
if (msg != null) {
alert(msg);
return false;
}
*/
//$("#lstSearchedLots").jqxListBox('clear');
if (confirm("Lot genealogy not traced, please manually select and validate all MRB affected child lots"))
{
clearSourceLotsListBox();
$("#lstSelectedLots").jqxListBox('clear');
$('#txtSearch').val('');
$("#LotSearchForm").modal('show');
}
return false;
})
function displayEmptySelectedLotsList() {
var source =
{
datatype: "json",
datafields: [
{ name: 'LotNo' }
],
id: 'id'
};
var dataAdapter = new $.jqx.dataAdapter(source);
// Create a jqxListBox
$("#lstSelectedLots").jqxListBox({
multipleextended: true, theme: "arctic", source: dataAdapter, displayMember: "LotNo", valueMember: "LotNo", width: 200, height: 250
});
}
//function displayEmptySearchedLotsList() {
// var source =
// {
// datatype: "json",
// datafields: [
// { name: 'LotNo' }
// ],
// id: 'id'
// };
// var dataAdapter = new $.jqx.dataAdapter(source);
// // Create a jqxListBox
// $("#lstSearchedLots").jqxListBox({
// multipleextended: true, theme: "arctic", source: dataAdapter, displayMember: "LotNo", valueMember: "LotNo", width: 200, height: 250
// });
//}
$("#jqxButtonSearchLots").on('click', function displayLots() {
var searchText = ($("#txtSearch").val());
var searchBy = $("#LotCriteria").data("kendoDropDownList").value();
var url = "/MRB/SearchLots";
$.ajax({
url: url,
type: "GET",
datatype: "json",
data: {
searchText: searchText,
searchBy: searchBy
},
success: function (data) {
clearSourceLotsListBox();
$.each(data, function (index, value) {
$('#jiraVersion').append($('<option>').text(value).val(index));
});
},
error: function (result) {
alert("Failed " + result);
}
});
});
var clearSourceLotsListBox = function () {
$('#jiraVersion').each(function () {
this.options.length = 0;
$(this)[0].options.length = 0;
});
}
$('#jqxButtonAddLots').on('click', function () {
// get selected items.
var bfound = false;
var lots;
var selected = $('#jiraVersion option:selected');
var selectedIndices = []; // create an empty array
$.each($('#jiraVersion option:selected'), function (index, value) { // loop over each option
//selectedIndices.push(index); // add the index to the array
//alert(value.text);
var tempvalue = value.text;
var templabel = value.text;
var itemsAdded = $("#lstSelectedLots").jqxListBox('getItems');
if (itemsAdded != undefined) {
for (var x = 0; x < itemsAdded.length; x++) {
if (itemsAdded[x].label == templabel) {
bfound = true;
break;
};
};
if (!bfound) {
$("#lstSelectedLots").jqxListBox('addItem', { label: tempvalue, value: tempvalue });
if (lots == null)
lots = tempvalue;
else
lots += "~" + tempvalue;
}
bfound = false;
}
else {
$("#lstSelectedLots").jqxListBox('addItem', { label: tempvalue, value: tempvalue });
}
});
});
//$('#jqxButtonAddLots').on('click', function () {
// // get selected items.
// var bfound = false;
// var lots;
// var itemsToAdd = $('#lstSearchedLots').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 (i < itemsToAdd.length - 1)
// //{
// // check if the item exists in the seleced lots list
// var itemsAdded = $("#lstSelectedLots").jqxListBox('getItems');
// if (itemsAdded != undefined) {
// for (var x = 0; x < itemsAdded.length; x++) {
// if (itemsAdded[x].label == templabel) {
// bfound = true;
// break;
// };
// };
// if (!bfound) {
// $("#lstSelectedLots").jqxListBox('addItem', { label: templabel, value: tempvalue });
// if (lots == null)
// lots = tempvalue;
// else
// lots += "~" + tempvalue;
// }
// bfound = false;
// }
// else {
// $("#lstSelectedLots").jqxListBox('addItem', { label: templabel, value: tempvalue });
// }
// }
// };
// }
// // unselect all the selected items
// $("#lstSearchedLots").jqxListBox({ selectedIndex: -1 });
//});
$('#jqxButtonRemoveLots').on('click', function () {
// get items.
var userids;
var items = $("#lstSelectedLots").jqxListBox('getSelectedItems');
if (items != undefined) {
for (var i = items.length - 1; i >= 0; i--) {
$("#lstSelectedLots").jqxListBox('removeItem', items[i].value);
};
}
});
$("#submitSelectLot").on('click', function () {
var lots;
var items = $("#lstSelectedLots").jqxListBox('getItems');
if (items != undefined) {
for (var x = 0; x < items.length; x++) {
if (lots == undefined)
lots = items[x].value;
else
lots += "~" + items[x].value;
};
$.ajax({
url: "/MRB/AddLots",
type: "GET",
datatype: "json",
data: {
mrbNumber: $('#txtMRBNumber').val(),
lotNumbers: lots
},
success: function (data) {
var grid = $("#Lots").data("kendoGrid");
grid.dataSource.read($('#txtMRBNumber').val());
$("#LotSearchForm").modal('hide');
//if (data != null && data != '')
//alert(data);
},
error: function (result) {
alert("Failed " + result);
}
});
}
return false;
});
// EndRegion Search Lot =============================================================
$('#SubmitDocument').on('click', function () {
})
function onEdit(e) {
//on row edit replace the Delete and Edit buttons with Update and Cancel
$(e.container).find("td:last").html("<a href='javascript: void(0)' class='abutton update' onclick='updateRow()' title='button update'>button update</a> " +
"<a href='javascript: void(0)' class='abutton cancel' onclick='cancelRow()' title='button cancel'>button cancel</a>");
}
function cancelRow() {
grid = $("#Lots").data("kendoGrid");
grid.cancelRow();
}
function editRow(element) {
grid = $("#Lots").data("kendoGrid");
grid.editRow($(element).closest("tr"));
}
function updateRow() {
grid = $("#Lots").data("kendoGrid");
grid.saveRow();
}
function deleteRow(element) {
grid = $("#Lots").data("kendoGrid");
grid.removeRow($(element).closest("tr"));
}
//function createRow() {
// grid = $("#Lots").data("kendoGrid");
// grid.addRow();
//}
function onContainmentEdit(e) {
//on row edit replace the Delete and Edit buttons with Update and Cancel
$(e.container).find("td:last").html("<a href='javascript: void(0)' class='abutton update' onclick='updateContainmentRow()' title='button update'>button update</a> " +
"<a href='javascript: void(0)' class='abutton cancel' onclick='cancelContainmentRow()' title='button cancel'>button cancel</a>");
}
function cancelContainmentRow() {
grid = $("#ContainmentActions").data("kendoGrid");
grid.cancelRow();
}
function editContainmentRow(element) {
grid = $("#ContainmentActions").data("kendoGrid");
grid.editRow($(element).closest("tr"));
}
function updateContainmentRow() {
grid = $("#ContainmentActions").data("kendoGrid");
grid.saveRow();
}
function deleteContainmentRow(element) {
grid = $("#ContainmentActions").data("kendoGrid");
grid.removeRow($(element).closest("tr"));
}
//function createContainmentRow() {
// grid = $("#Lots").data("kendoGrid");
// grid.addRow();
//}
// RegionDispositionType
function onDispositionEdit(e) {
//on row edit replace the Delete and Edit buttons with Update and Cancel
$(e.container).find("td:last").html("<a href='javascript: void(0)' class='abutton update' onclick='updateDispositionRow()' title='button update'>button update</a> " +
"<a href='javascript: void(0)' class='abutton cancel' onclick='cancelDispositionRow()' title='button cancel'>button cancel</a>");
}
$('#addDispositionNotes').click(function (e) {
grid = $("#Dispositions").data("kendoGrid");
grid.addRow();
});
function cancelDispositionRow() {
grid = $("#Dispositions").data("kendoGrid");
grid.cancelRow();
}
function editDispositionRow(element) {
//alert(element.DispoistionType);
//var x = e.container.find("input[name=DispositionType]").data("kendoNumericTextBox").value()
//alert(x);
//return false;
grid = $("#Dispositions").data("kendoGrid");
grid.editRow($(element).closest("tr"));
}
function updateDispositionRow() {
grid = $("#Dispositions").data("kendoGrid");
grid.saveRow();
}
function deleteDispositionRow(element) {
grid = $("#Dispositions").data("kendoGrid");
}
$('#addMRBFlagAndHoldToSPN').click(function (e) {
//alert("Not implemented yet.")
if (confirm('Are you sure you want to send the MRB Flag to SPN')) {
$('#pleaseWaitDialog').modal('show');
$.ajax({
url: "/MRB/SendMRBHoldFlagToSPN",
type: "GET",
datatype: "json",
data: {
mrbNumber: $("#txtMRBNumber").val()
},
success: function (data) {
$('#pleaseWaitDialog').modal('hide');
if (data.Error) {
alert(data.Message);
}
},
error: function (data) {
alert("Failed ");
$('#pleaseWaitDialog').modal('hide');
}
});
}
return false
});
$("#ApproveDocument").on('click', function () {
$('#ApproveDocument').attr("disabled", true);
var message = '';
var mrbNumber = $("#txtMRBNumber").val();
var mrbRaisedAreaID = $("#MRBRaisedAreaID").data("kendoDropDownList").value();
var owner = $("#OwnerID").data("kendoDropDownList").value();
var tool = $("#txtTool").val();
var toolCSV = $("#ToolCSV").data("kendoMultiSelect").value().join(",");
var numberOfLotsAffected = $("#txtNumberOfLotsAffected").val();
var moduleIDs = $("#ModuleIds").data("kendoMultiSelect").value();
var process = $("#txtProcess").val();
var CANo = $("#CANo").val();
var partGroupIDs = $("#PartGroupIDs").data("kendoMultiSelect").value();
var numberOfWafersAffected = $("#txtNumberOfWafersAffected").val();
var numberOfDiesAffected = $("#txtNumberOfDiesAffected").val();
var issueDescription = $("#txtIssueDescription").val();
var notes = $("#txtNotes").val();
var issueDetectedDate = $("#txtIssueDetectedDate").val();
var issueStartDate = $("#txtIssueStartDate").val();
var issueEndDate = $("#txtIssueEndDate").val();
var riskAssessmentIDs = $("#RiskAssessmentIDs").data("kendoMultiSelect").value();
//var dispositionIDs = $("#DispositionIDs").data("kendoMultiSelect").value();
var ownerApprover = $("#OwnerApprover").val();
var peApprover = $("#PEApprover").val();
var mfgEngineeringAppover = $("#MfgEngineeringAppover").val();
var otherApprovers = $("#OtherApprovers").val();
var yeApprover = $("#YEApprover").val();
var qualityApprovers = $("#QualityApprovers").val();
var detailsFolder = $("#txtDetailsFolder").val();
var title = $("#txtTitle").val();
if (tool.length <= 0)
message += 'Tool, ';
if (numberOfLotsAffected.length <= 0)
message += 'Number of Lots Affected, ';
if (issueDescription.length <= 0)
message += 'Issue Description, ';
//if (mrbRaisedDate.length <= 0)
// message += 'MRB RaisedDate, ';
if (moduleIDs.length <= 0)
message += 'Module, ';
if (process.length <= 0)
message += 'Process, ';
if (mrbRaisedAreaID.length <= 0)
message += 'MRB Raised Area, ';
if (partGroupIDs.length <= 0)
message += 'Part Groups Affected, ';
if (issueDetectedDate.length <= 0)
message += 'Issue Detected Date, ';
if (issueStartDate.length <= 0)
message += 'Issue Started Date, ';
if (riskAssessmentIDs.length <= 0)
message += 'Risk Assessment, '
var customerImpacted;
if ($('#CustomerImpacted').is(':checked'))
customerImpacted = 1;
else
customerImpacted = 0;
//if (message != '') {
// alert(message + 'needs to be entered before submitting the document ');
// $('#SubmitDocument').attr("disabled", false);
// return false;
//}
var vgrid = $("#Lots").data("kendoGrid");
//Getting grid items
var items = vgrid.dataSource.data();
if (items.length == 0) {
alert('There are no lots for this MRB, Please enter at least one lot before Approval');
$('#ApproveDocument').attr("disabled", false);
return false;
}
if (message != '') {
alert(message + 'needs to be entered before approving the document');
$('#ApproveDocument').attr("disabled", false);
return false;
}
else { // save the form if anything was changed
$.ajax({
url: '/MRB/Edit',
type: "POST",
//dataType: "text",
contentType: "application/json; charset=utf-8",
data: JSON.stringify(
{
MRBNumber: mrbNumber,
MRBRaisedAreaID: mrbRaisedAreaID,
Owner: owner,
Tool: tool,
NumberOfLotsAffected: numberOfLotsAffected,
ModuleIDs: moduleIDs,
Process: process,
CANo: CANo,
PartGroupIDs: partGroupIDs,
NumberOfWafersAffected: numberOfWafersAffected,
NumberOfDiesAffected: numberOfDiesAffected,
IssueDescription: issueDescription,
Notes: notes,
IssueDetectedDate: issueDetectedDate,
IssueStartDate: issueStartDate,
IssueEndDate: issueEndDate,
RiskAssessmentIDs: riskAssessmentIDs,
//DispositionIDs: dispositionIDs,
OwnerApprover: ownerApprover,
PEApprover: peApprover,
MfgEngineeringAppover: mfgEngineeringAppover,
OtherApprovers: otherApprovers,
YEApprover: yeApprover,
QualityApprovers: qualityApprovers,
Title: title,
DetailsFolder: detailsFolder,
CustomerImpacted: customerImpacted,
ToolCSV: toolCSV
}),
success: function (result) {
$("#ApprovalComments").modal('show');
},
error: function (jqXHR, textStatus, errorThrown) {
alert("Save Failed " + jqXHR.responseText);
}
});
}
})
//var submitForApproval = function () {
// $("#ApprovalComments").modal('show');
// return false;
//}
$('#submitApprovalComments').on('click', function () {
$('#submitApprovalComments').attr("disabled", true);
$.ajax({
url: "/MRB/Approve",
type: "GET",
datatype: "json",
data: {
issueID: $("#txtMRBNumber").val(),
currentStep: $("#currentStep").val(),
comments: $("#approvalComments").val()
},
success: function (data) {
$("#ApprovalComments").modal('hide');
var url = '@Url.Action("Edit", "MRB", new { issueID = "__id__" })';
url = url.replace('amp;', '');
window.location.href = url.replace('__id__', $("#txtMRBNumber").val());
}
});
});
$('#setDispoType').on('click', function () {
if (confirm("Are you sure you want to set all the lots to this Dispo Type?")) {
var dispo = $("#DispoTypes").data("kendoDropDownList").value();
$.ajax({
url: "/MRB/SetDispositionTypeForAllLots",
type: "GET",
datatype: "json",
data: {
mrb: $("#txtMRBNumber").val(),
dispoType: dispo
},
success: function (data) {
var grid = $("#Lots").data("kendoGrid");
grid.dataSource.read($('#txtMRBNumber').val());
}
});
}
})
$("#btnDetailFolder").on('click', function (e) {
e.preventDefault();
var title = $("#txtTitle").val();
var detailsfolder = $("#txtDetailsFolder").val();
window.open("file:////temsdv002.infineon.com/FAB_Engineering/01_Other/FAB Excursions/" + detailsfolder + "/" + title, target = '_blank');
return false;
})
function buildMRBLinks(MRBs)
{
var template = "";
if (MRBs != null) {
var tempValue = MRBs.split(',');
var mrb = "";
var MRB_Dispo = ""
for (var i = 0; i < tempValue.length; i++) {
mrb = "";
if (tempValue[i] != '') {
MRB_Dispo = tempValue[i].split('_');
mrb = MRB_Dispo[0];
}
template += "<a href='/MRB/Edit?IssueID=" + mrb + "'>" + tempValue[i] + "</a>" + ", ";
}
}
return template.replace(/,(\s+)?$/, '');
}
function buildLDLinks(LotDispositionsLinkedToLot)
{
//alert(connection);
var template = "";
if (LotDispositionsLinkedToLot != null) {
var tempValue = LotDispositionsLinkedToLot.split(',');
for (var i = 0; i < tempValue.length; i++) {
@*if (connection == 'PROD') {
template += "<a href='http://temapprovalsystem.irf.com/LotDisposition/Edit?IssueID=" + tempValue[i] + "'>" + tempValue[i] + "</a>" + ", ";
}
else {
template += "<a href='@GlobalVars.hostURL" + "LotDisposition/Edit?IssueID=" + tempValue[i] + "'>" + tempValue[i] + "</a>" + ", ";
}*@
template += "<a href='/LotDisposition/Edit?IssueID=" + tempValue[i] + "'>" + tempValue[i] + "</a>" + ", ";
}
}
//alert(template);
return template.replace(/,(\s+)?$/, '');
}
$("#lotAddFormButton").on('click', function () {
$("#LotAddForm").modal('show');
return false;
})
$("#lotExport").on('click', function () {
var url = '@Url.Action("ExportLots", new { mrbNumber = "__id__" })';
url = url.replace('__id__', $("#txtMRBNumber").val());
window.open(url, '_blank');
return false;
})
$("#ExportMRBHoldFlagReport").on('click', function () {
var url = '@Url.Action("ExportMRBHoldFlagReport", new { mrbNumber = "__id__" })';
url = url.replace('__id__', $("#txtMRBNumber").val());
window.open(url, '_blank');
return false;
})
$("#PreviewMRBHoldFlagTobeSentToSPN").on('click', function () {
var url = '@Url.Action("PreviewMRBHoldFlagTobeSentToSPN", new { mrbNumber = "__id__" })';
url = url.replace('__id__', $("#txtMRBNumber").val());
window.open(url, '_blank');
return false;
})
$("#submitLotAdd").on('click', function () {
$.ajax({
url: '/MRB/AddLot',
type: "Post",
dataType: "json",
contentType: "application/json; charset=utf-8",
data: JSON.stringify(
{
MRBNumber: $("#txtMRBNumber").val(),
LotNumber: $("#LotNumber").val(),
DieLotNumber: $("#LotNumber").val(),
Description: $("#Description").val(),
NewPartNo: $("#NewPartNo").val(),
WipPartNo: $("#WipPartNo").val(),
DiePartNo: $("#DiePartNo").val(),
ProductFamily: $("#ProductFamily").val(),
Gen: $("#Gen").val(),
Channel: $("#Channel").val(),
Hexsize: $("#Hexsize").val(),
Voltage: $("#Voltage").val(),
WaferCount: $("#WaferCount").val(),
DieCount: $("#DieCount").val(),
Location: $("#Location").val(),
TotalCost: $("#TotalCost").val(),
DispoType: $("#DispoType").val(),
Status: $("Status").val()
}),
success: function (result) {
if (result.OpenIssueWithExistingLots != 0) {
alert('The following Lot Number ' + data.LotNumber + ' cannot be added because it belongs to the following Open Lot Dispo ' + result.OpenIssueWithExistingLots);
}
var grid = $("#Lots").data("kendoGrid");
grid.dataSource.read($('#txtMRBNumber').val());
$("#LotAddForm").modal('hide');
},
error: function (jqXHR, textStatus, errorThrown) {
alert("Failed " + errorThrown);
}
});
return false;
})
$('#lotDeleteAllButton').on('click', function DeleteAllLots() {
if (confirm("Are you sure you want to DELETE ALL the Lots?")) {
$.ajax({
url: "/MRB/DeleteAllMRBLots",
type: "POST",
datatype: "json",
data: {
issueID: $("#txtMRBNumber").val()
},
success: function (data) {
var grid = $("#Lots").data("kendoGrid");
grid.dataSource.read($('#txtMRBNumber').val());
$('#txtNumberOfLotsAffected').val(0);
$('#txtNumberOfWafersAffected').val(0);
$('#txtNumberOfDiesAffected').val(0);
}
,
error: function (result) {
alert("Operation Failed " + result);
}
});
}
return false;
})
//$('#SendMRBSPNFlag').on('click', function () {
// if (confirm('Are you sure you want to send the MRB Flag to SPN')) {
// $('#pleaseWaitDialog').modal('show');
// $.ajax({
// url: "/MRB/SendSPN_MRB_HoldFlag",
// type: "GET",
// datatype: "json",
// data: {
// mrbNumber: $("#txtMRBNumber").val()
// },
// success: function (data) {
// $('#pleaseWaitDialog').modal('hide');
// if (data.Error) {
// alert(data.Message);
// }
// },
// error: function () {
// alert("Failed ");
// $('#pleaseWaitDialog').modal('hide');
// }
// });
// }
// return false
//});
function DispositionOnUpdate(e) {
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
//alert(dataItem);
}
function DownloadAttachment(e) {
e.preventDefault();
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
var fileName = dataItem.FileName;
var attachmentID = dataItem.AttachmentID;
window.location = '/MRB/DownloadFile?attachmentID=' + attachmentID;
}
(function ($, kendo) {
$.extend(true, kendo.ui.validator, {
rules: { // custom rules
dispotypevalidation: function (input, params) {
//check for the rule attribute
if (input.filter("[data-val-dispotypevalidation]").length && input.val()) {
return /^[A,B,C,D,E,F,G,H,I]/.test(input.val());
}
return true;
}
},
messages: { //custom rules messages
dispotypevalidation: function (input) {
// return the message text
return input.attr("data-val-dispotypevalidation");
}
}
});
})(jQuery, kendo);
$("#AddContainmentActionItem").on('click', function (e) {
clearContainmentActionForm();
containmentActionOperation = 'Add';
$("#ContainmentActionForm").modal("show");
})
function EditContainmentActionItem(e) {
var ecdDate;
var tempecdDate;
var implementDate;
var tempimplementDate;
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
containmentActionItemID = dataItem.ContainmentActionID;
var containmentAction = dataItem.ContainmentAction;
var ResponsibilityOwnerID = dataItem.ResponsibilityOwnerID;
var ecd = dataItem.ECD;
currResponsibilityOwnerID = dataItem.CurrentResponsibilityOwnerID;
if (dataItem.ECD != null) {
tempecdDate = new Date(dataItem.ECD);
ecdDate = (tempecdDate.getMonth() + 1) + '/' + tempecdDate.getDate() + '/' + tempecdDate.getFullYear();
}
else
ecdDate = '';
if (dataItem.ImplementedDate != null) {
tempimplementDate = new Date(dataItem.ImplementedDate);
implementDate = (tempimplementDate.getMonth() + 1) + '/' + tempimplementDate.getDate() + '/' + tempimplementDate.getFullYear();
}
else
implementDate = '';
containmentActionOperation = 'Edit';
clearContainmentActionForm();
$("#txtContainmentAction").val(containmentAction);
$("#ResponsibilityOwnerIds").data("kendoDropDownList").value(ResponsibilityOwnerID);
$("#txtECD").val(ecdDate);
$("#txtImplementedDate").val(implementDate);
var tempImpIDs;
var data;
var dataArray;
e.preventDefault();
$("#ContainmentActionForm").modal("show");
}
$("#SaveContainmentAction").on('click', function () {
var objectData = ReturnContainmentActionObject();
if (objectData.ResponsibilityOwnerID != '' && objectData.ECD == '') {
alert('Please enter the ECD while entering the Responsible Owner');
return false;
}
var url = "";
if (containmentActionOperation == 'Add') {
url = "/MRB/InsertContainmentAction";
}
else {
url = "/MRB/UpdateContainmentAction";
}
$.ajax({
url: url,
type: "POST",
contentType: "application/json; charset=utf-8",
data: JSON.stringify(objectData),
success: function (objdata) {
var grid = $("#ContainmentActions").data("kendoGrid");
grid.dataSource.read($("@Model.MRBNumber").val());
$("#ContainmentActionForm").modal("hide");
},
error: function (result) {
alert("Failed " + result);
//$("#CAFindingsForm").modal("hide");
}
});
})
function ReturnContainmentActionObject() {
if (containmentActionOperation == 'Add') {
var objectData = {
ID: 0,
MRBNumber: '@Model.MRBNumber',
ContainmentAction: $("#txtContainmentAction").val(),
ECD: $("#txtECD").val(),
ImplementedDate: $("#txtImplementedDate").val(),
ResponsibilityOwnerID: $("#ResponsibilityOwnerIds").data("kendoDropDownList").value()
}
}
else {
var objectData = {
ContainmentActionID: containmentActionItemID,
AuditNo: '@Model.MRBNumber',
ContainmentAction: $("#txtContainmentAction").val(),
ECD: $("#txtECD").val(),
ImplementedDate: $("#txtImplementedDate").val(),
ResponsibilityOwnerID: $("#ResponsibilityOwnerIds").data("kendoDropDownList").value()
}
}
return objectData;
}
function clearContainmentActionForm() {
$("#txtContainmentAction").val('');
$("#ResponsibilityOwnerIds").data("kendoDropDownList").value(0);
$("#txtECD").val('');
$("#txtImplementedDate").val('');
}
function UpdateMRBLotError(e) {
alert('Problem occured during the MRBLot update');
}
function IssueStartTimeChangeAlert() {
//kendoConsole.log("Change :: " + kendo.toString(this.value(), 'g'));
if ($("#txtIssueStartDate").val() != '')
alert("Please ensure to pick the right time also");
//$("#txtIssueStartDate").kendoDateTimePicker({
// format: "MM/dd/yyyy" //format is used to format the value of the widget and to parse the input.
//});
//var date = this.value();
//alert(date.getMonth() + 1 + '/' + date.getDate() + '/' + date.getFullYear());
//this.value = date.getMonth() + 1 + '/' + date.getDate() + '/' + date.getFullYear();
}
function IssueEndTimeChangeAlert() {
if ($("#txtIssueEndDate").val() != '')
alert("Please ensure to pick the time also");
}
</script>