Mike Phares 7650bf2869 Removed PdfViewController, HtmlViewRenderer and FakeView to be replaced with ViewEngineResult Render method
Added HttpException class for missing HttpException for net8

Wrapped HttpContext.Session, GetJsonResult, IsAjaxRequest and GetUserIdentityName in controllers for net8

Added AuthenticationService to test Fab2ApprovalMKLink code for net8

Compile conditionally flags to debug in dotnet core
2025-05-23 12:51:42 -07:00

453 lines
20 KiB
Plaintext

@model Fab2ApprovalSystem.Models.LTLotTravelerHeaderViewModel
@{
ViewBag.Title = "LotTraveler - Readonly";
}
@{
Layout = "_LotTravelerLayout.cshtml";
}
<link rel="stylesheet" href="/Content/kendo/kendo.blueopal.min.css" />
<style>
.k-header .k-link {
text-align: center;
}
</style>
@using (Html.BeginForm())
{
<input type="hidden" id="LTWorkRequestID" value="@Model.LTWorkRequestID" />
<input type="hidden" id="ReturnURL" value="@Url.Action("LotTravelerReadonly", "LotTraveler", new { ltLotID = Model.ID, revisionNumber = Model.LotTravCurrentRevision })" />
@Html.AntiForgeryToken()
<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-12">
<div class="row">
<div class="col-sm-12 text-center">
<font style="color:crimson">
<label id="RevNumber" style="font-size: large; font-weight: bold; color: blue; ">
Fab2 Electronic Lot Traveler - Lot# @Model.LotNumber
Rev @Model.LotTravCurrentRevision &nbsp;&nbsp;
[Mode : Readonly]
</label>
@*<font style="color: blue; font-weight:bold">@Model.LotNumber</font> <font style="color: green; font-weight:bold; font-style:italic">Rev @Model.LotTravCurrentRevision</font><font style="color: red; font-weight:bold;" > [Mode : Readonly]</font>*@
</font>
</div>
</div>
</div>
<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>
</div>
</div>
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-body bg-warning">
<div class="row">
<div class="col-sm-12">
<input type="button" value="Print PDF" class="btn btn-warning btn-xs" id="PrintTravelerPDF" style="font-size: 10px" />
<input type="button" value="Back to Work Request" class="btn btn-warning btn-xs" id="BackToRequestID" style="font-size: 10px" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<label class="control-label">Lot Numbers:</label>
@(Html.Kendo().DropDownList()
.Name("LotList")
.BindTo(new SelectList(ViewBag.LotList, "LotID", "LotNumber"))
.OptionLabel("Select")
)
<input type="button" value="Display Traveler" class="btn btn-warning btn-xs" id="GetTraveler" style="font-size: 10px" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<label class="control-label">Revisions:</label>
@(Html.Kendo().DropDownList()
.Name("Revisions")
.BindTo(new SelectList(ViewBag.LotTravRevisionList, "ID", "RevisionNumber"))
.OptionLabel("Select")
)
<input type="button" value="Display Revision" class="btn btn-warning btn-xs" id="GetRevision" style="font-size: 10px" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" value="Revision History" class="btn btn-warning btn-xs" id="RevisionHistoryData" style=" font-size: 10px" />
</div>
</div>
</div>
</div>
<div class="panel panel-default" style="font-size: 10px">
<div class="panel-body bg-warning">
<div class="row">
<div class="col-sm-2">
<div class="row">
<div class="col-sm-3">
<label class="control-label pull-right">SWR #:</label>
</div>
<div class="col-sm-9">
@Html.TextBoxFor(model => model.SWRNumber, new { @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
</div>
</div>
</div>
<div class="col-sm-2">
<div class="row">
<div class="col-sm-3">
<label class="control-label pull-right">Last Update:</label>
</div>
<div class="col-sm-9">
@Html.TextBoxFor(model => model.LastUpdate, new { id = "txtLastUpdate", @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
</div>
</div>
</div>
<div class="col-sm-2">
<div class="row">
<div class="col-sm-3">
<label class="control-label pull-right">Title</label>
</div>
<div class="col-sm-9">
@Html.TextBoxFor(model => model.Title, new { @class = "k-textbox", Readonly = "Readonly" })
</div>
</div>
</div>
<div class="col-sm-2">
<div class="row">
<div class="col-sm-3">
<label class="control-label pull-right">Closed Reason:</label>
</div>
<div class="col-sm-9">
@Html.TextBoxFor(model => model.TravelerClosedReason, new { @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
</div>
</div>
</div>
<div class="col-sm-2">
<div class="row">
<div class="col-sm-3">
<label class="control-label pull-right">Closed By:</label>
</div>
<div class="col-sm-9">
@Html.TextBoxFor(model => model.TravelerClosedBy, new { @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
</div>
</div>
</div>
<div class="col-sm-2">
<div class="row">
<div class="col-sm-3">
<label class="control-label pull-right">Closed Date:</label>
</div>
<div class="col-sm-9">
@Html.TextBoxFor(model => model.TravelerClosedDate, new { @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-2">
<div class="row">
<div class="col-sm-3">
<label class="control-label pull-right">Originator:</label>
</div>
<div class="col-sm-9">
@Html.TextBoxFor(model => model.Originator, new { @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
@if (GlobalVars.IsAdminValueNotNull(Session))
{
<a href="javascript:undefined" id="lnkReassignOriginator" class="linkbutton edit" title="Re-assign Originator"></a>
}
</div>
</div>
</div>
<div class="col-sm-2">
<div class="row">
<div class="col-sm-3">
<label class="control-label pull-right">Updated By:</label>
</div>
<div class="col-sm-9">
@Html.TextBoxFor(model => model.LastUpdatedBy, new { id = "txtUpdatedBy", @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
</div>
</div>
</div>
<div class="col-sm-2">
<div class="row">
<div class="col-sm-3">
<label class="control-label pull-right">WIP PN#:</label>
</div>
<div class="col-sm-9">
@Html.TextBoxFor(model => model.WIPPartNumber, new { @class = "k-textbox", Readonly = "Readonly"})
</div>
</div>
</div>
<div class="col-sm-2">
<div class="row">
<div class="col-sm-3">
<label class="control-label pull-right">Part Desc:</label>
</div>
<div class="col-sm-9">
@Html.TextBoxFor(model => model.PartDescription, new { @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue;width:100%" })
</div>
</div>
</div>
<div class="col-sm-2">
<div class="row">
<div class="col-sm-3">
<label class="control-label pull-right">Base Flow:</label>
</div>
<div class="col-sm-9">
@Html.TextBoxFor(model => model.BaseFlow, new { id = "txtProcessFlow", @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
</div>
</div>
</div>
<div class="col-sm-2">
<div class="row">
<div class="col-sm-3">
<label class="control-label pull-right">ITAR:</label>
</div>
<div class="col-sm-9">
@Html.TextBoxFor(model => model.IsITAR, new { @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-1">
<label class="control-label pull-right">Purpose Of Lot/Change Description:</label>
</div>
<div class="col-sm-11">
@Html.TextAreaFor(model => model.PurposeOfRequest, 5, 100, new { @class = "k-textbox", Readonly = "Readonly", style = "width:100%" })
</div>
</div>
</div>
</div>
<div class="panel panel-default" style="font-size: 10px">
<!-- NEW PANEL ===============================================================-->
<div class="panel-body bg-info">
<h5>
<font style="color:crimson; font-weight:bold">
OLHold Steps
</font>
<a class="btn btn-xs pull-right alert-danger" id="aSection2" role="button" data-toggle="collapse" href="#collapseSection2" aria-expanded="true" aria-controls="collapseExample">
Expand/Collpase
</a>
</h5>
</div>
<div class="collapse" id="collapseSection2">
<div class="panel-body bg-warning">
<div class="col-sm-offset-0">
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.LTLotTravelerHoldSteps>()
.Name("HoldSteps")
.Columns(columns =>
{
columns.Bound(a => a.ID).Visible(false);
columns.Bound(a => a.LotTravelerRevisionID).Visible(false);
columns.Bound(a => a.Location).Width("50px");
columns.Bound(a => a.Operation).Width("50px");
columns.Bound(a => a.OperationDescription).Width("100px");
columns.Bound(a => a.ChangeInstructions).ClientTemplate("#=changeNewLine(ChangeInstructions)#").Width("250px");
columns.Bound(a => a.FileNames).ClientTemplate("#=buildLinks(FileNames, SWRNumber)#").Width("100px");
columns.Bound(a => a.ExecutionTaskComments).ClientTemplate("#=changeNewLine(ExecutionTaskComments)#").Width("250px");
columns.Bound(a => a.SignedOffByName).Width("50px");
columns.Bound(a => a.SignOffTime).Format("{0:MM/dd/yy hh:mm:ss}").Width("50px");
columns.Bound(a => a.Completed).ClientTemplate("<input type='checkbox' disabled #= Completed ? checked='checked':'' # class='chkbx' />").Width("50px");
})
.Resizable(e => e.Columns(true))
.Events(e => e.DataBound("onHoldStepsDataBound"))
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:250; width:100%; font-size: 10px" })
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.Model(model =>
{
model.Id(p => p.ID);
})
.PageSize(50)
.Read(read => read.Action("GetLotTravHoldStepsByRevision", "LotTraveler", new { LotID = Model.ID, revisionNumber = Model.LotTravCurrentRevision }))
)
)
</div>
</div>
</div>
</div>
}
<div class="modal fade" id="RevisionHistoryWin" 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">Revision History</h4>
</div>
<div class="modal-body">
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.RevisionHistory>()
.Name("RevisionHistory")
.Columns(columns =>
{
columns.Bound(a => a.ID).Visible(false);
columns.Bound(a => a.RevisionedBy);
columns.Bound(a => a.Comments);
columns.Bound(a => a.RevisionCreateDate).Format("{0:MM/dd/yy hh:mm:ss}");
})
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:300px; width:100%; font-size: 12px" })
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.Model(model =>
{
model.Id(p => p.ID);
})
.PageSize(50)
.Read(read => read.Action("GetLotTravelerRevisionHistory", "LotTraveler", new { lotID = Model.ID }))
)
)
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
@Html.Partial("_LTReassignOriginator")
<script type="text/javascript">
var holdStepOperation;
var currentHoldStepID;
var currentLotTravRevisionID;
var newSession = true;
$(document).ready(function () {
$('#collapseSection2').collapse({
toggle: true
})
})
function onHoldStepsDataBound(arg) {
var myElem = document.getElementById('trParentHeader');
if (myElem == null) {
$("#HoldSteps").find("th.k-header").parent().before("<tr id='trParentHeader'> <th align='center' colspan='3' class='k-header' style='color:red'></th> <th align='center' colspan='2' class='k-header' style='font-size:12px;color:red'><strong>Change Instructions/File </strong></th> </th> <th align='center' colspan='4' class='k-header' style='font-size:12px;color:red'><strong>Execution </strong></th></tr>");
}
}
function buildLinks(fileNames, swrNumber) {
var template = "";
//var fileName = 4;
//alert(workRequestID);
if (fileNames != null) {
var tempValue = fileNames.split(',');
for (var i = 0; i < tempValue.length; i++) {
var tempValue2 = tempValue[i].split('~');
var fileName = tempValue2[0];
var fileGuid = tempValue2[1];
var tempFile = fileName.split('.');
var fileExtension = tempFile[tempFile.length - 1];
//template += "<a href='@GlobalVars.AttachmentUrl" + "LotTraveler/" + swrNumber + "/" + fileGuid + "." + fileExtension + "'>" + fileName + "</a><BR>" + " ";
template += "<a href='/LotTraveler/DownloadFile?fileGuid=" + fileGuid + "&swrNumber=" + @Model.SWRNumber + "&typeOfDoc=2" + "'>" + fileName + "</a><BR>" + " ";
}
}
return template;
}
$("#GetRevision").on('click', function (e) {
e.preventDefault();
var revid = $("#Revisions").data("kendoDropDownList").text();
if (revid != "Select") {
var url = "@Html.Raw(@Url.Action("LotTravelerReadonly", "LotTraveler", new { ltLotID = "__id__", revisionNumber = "__revID__" }))";
url = url.replace('__revID__', revid);
url = url.replace('amp;', '');
window.location.href = url.replace('__id__', '@Model.ID');
}
else {
alert('Please select a Revision Number');
}
})
$("#GetTraveler").on('click', function () {
var lotid = $("#LotList").data("kendoDropDownList").value();
var url = "@Html.Raw(@Url.Action("LotTravelerUpdate", "LotTraveler", new { ltLotID = "__id__" }))";
//url = url.replace('amp;', '');
window.location.href = url.replace('__id__', lotid);
})
$("#PrintTravelerPDF").on('click', function (e) {
e.preventDefault();
var url = "@Html.Raw(@Url.Action("DisplayLotTravlerPdf", "LotTraveler", new { ltLotID = "__id__", revisionNumber = "__revid__" }))";
url = url.replace("__revid__", '@Model.LotTravCurrentRevision')
window.open(url.replace('__id__', '@Model.ID', '_blank'));
})
$("#BackToRequestID").on('click', function (e) {
e.preventDefault();
var url = "@Html.Raw(@Url.Action("Edit", "LotTraveler", new { IssueID = "__id__"}))";
window.location.href = url.replace('__id__', $("#LTWorkRequestID").val());
})
$('#RevisionHistoryData').on('click', function () {
$("#RevisionHistoryWin").modal('show');
return false;
})
function changeNewLine(text) {
if (text != null) {
var regexp = new RegExp('\n', 'g');
return text.replace(regexp, '<br>');
}
else
return '';
}
</script>