315 lines
14 KiB
Plaintext
315 lines
14 KiB
Plaintext
@using Microsoft.AspNet.Identity
|
|
@{
|
|
Layout = "_HomeLayout.cshtml";
|
|
}
|
|
|
|
<!DOCTYPE html>
|
|
<link rel="stylesheet" href="~/Scripts/js.cookie.js" />
|
|
<html>
|
|
<head>
|
|
<meta name="viewport" content="width=device-width" />
|
|
<title>@ViewBag.Title</title>
|
|
</head>
|
|
|
|
|
|
<body>
|
|
@*<body>*@
|
|
<div class="panel panel-default" style="font-size: 10px">
|
|
<div class="panel-heading">
|
|
<table style="width: 100%" border="0">
|
|
<tr>
|
|
<td width="30%"> </td>
|
|
<td align="center" style="font-size: 15px; font-weight: bold; color: crimson" width="30%">
|
|
<label id="header" style="font-size: large; font-weight: bold; color: crimson; font-family: 'Times New Roman'">
|
|
MRB
|
|
</label>
|
|
</td>
|
|
<td width="40%">
|
|
<table style="width: 100%" class="pull-right" border="0">
|
|
<tr>
|
|
<td class="pull-right"></td>
|
|
<td class="pull-right">
|
|
<table class="pull-right">
|
|
<tr>
|
|
<td class="pull-right">
|
|
@if ((bool)Session[GlobalVars.IS_ADMIN])
|
|
{
|
|
@(Html.Kendo().Upload()
|
|
.Name("AddQDBFlag")
|
|
.Messages(m => m.Select("Add QDB Flag"))
|
|
.Async(a => a.Save("ImportAddQDBFlag", "MRB", new { operation = "A" }).AutoUpload(true))
|
|
.ShowFileList(false)
|
|
.Events(events => events.Error("onLotUploadError").Upload("onLotUpload").Success("onSuccess"))
|
|
|
|
)
|
|
}
|
|
</td>
|
|
<td class="pull-right">
|
|
@if ((bool)Session[GlobalVars.IS_ADMIN])
|
|
{
|
|
@(Html.Kendo().Upload()
|
|
.Name("RemoveQDBFlag")
|
|
.Messages(m => m.Select("Remove QDB Flag"))
|
|
.Async(a => a.Save("ImportRemoveQDBFlag", "MRB", new { operation = "R" }).AutoUpload(true))
|
|
.ShowFileList(false)
|
|
.Events(events => events.Error("onLotUploadError").Upload("onLotUpload").Success("onSuccess"))
|
|
|
|
)
|
|
}
|
|
</td>
|
|
|
|
</tr>
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div id="mrbTasklistdiv" class="k-content" style="font-size: 11px;">
|
|
@if ((bool)Session[GlobalVars.IS_ADMIN])
|
|
{
|
|
@(Html.Kendo().Grid<Fab2ApprovalSystem.ViewModels.IssuesViewModel>()
|
|
.Name("mrbTasklist")
|
|
.Columns(columns =>
|
|
{
|
|
//columns.Bound(l => l.IssueID);
|
|
columns.Bound(l => l.IssueID).Template(@<text> @Html.ActionLink(@item.IssueID.ToString(), null)</text>)
|
|
.ClientTemplate("<a href='/#=DocumentType#/Edit?IssueID=#=DocID#'>#=IssueID#</a>");
|
|
columns.Bound(l => l.DocumentType);
|
|
columns.Bound(l => l.SubDoc);
|
|
columns.Bound(l => l.Originator);
|
|
columns.Bound(l => l.IssueDate).Format("{0:MM/dd/yy hh:mm:ss}");
|
|
columns.Bound(l => l.Title);
|
|
columns.Bound(l => l.LotNos);
|
|
columns.Bound(l => l.PendingApprovers).HtmlAttributes(new { style = "font-weight: bold; color: red;" }).Width("350px");
|
|
columns.Bound(l => l.SubmitedDate).Format("{0:MM/dd/yy hh:mm:ss}");
|
|
columns.Bound(l => l.CloseDate).Format("{0:MM/dd/yy hh:mm:ss}");
|
|
columns.Template(t => { }).HeaderTemplate("").ClientTemplate(@"
|
|
<a href='javascript: void(0)' class='abutton delete' onclick='deleteRow(this)' title='button delete'>button delete</a>");
|
|
|
|
})
|
|
//.Events(e => e.DataBound("onAllDocsDB"))
|
|
.Selectable(selectable => selectable.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
|
|
.Editable(editable => editable.Mode(GridEditMode.InLine))
|
|
.HtmlAttributes(new { style = "height: 700px;" })
|
|
.Scrollable()
|
|
.Sortable()
|
|
.Filterable(filterable => filterable
|
|
.Extra(false)
|
|
.Operators(operators => operators
|
|
.ForString(str => str
|
|
.Clear()
|
|
.Contains("Contains")
|
|
.DoesNotContain("Does not contain")
|
|
.StartsWith("Starts with")
|
|
.EndsWith("Ends with")
|
|
.IsEqualTo("Is equal to")
|
|
.IsNotEqualTo("Is not equal to ")
|
|
)
|
|
)
|
|
)
|
|
.Pageable(pageable => pageable
|
|
.Refresh(true)
|
|
.PageSizes(true)
|
|
.ButtonCount(5))
|
|
|
|
.DataSource(dataSource => dataSource
|
|
.Ajax()
|
|
.Model(model =>
|
|
{
|
|
model.Id(p => p.IssueID);
|
|
|
|
//model.Field(p => p.TotalCost).Editable(false);
|
|
})
|
|
//.Events(e => e.RequestEnd("LoadState"))
|
|
.PageSize(50)
|
|
.Read(read => read.Action("GetMRBList", "Home"))
|
|
.Destroy(destroy => destroy.Action("DeleteItem", "Home"))
|
|
)
|
|
)
|
|
}
|
|
else
|
|
{
|
|
|
|
@(Html.Kendo().Grid<Fab2ApprovalSystem.ViewModels.IssuesViewModel>()
|
|
.Name("mrbTasklist")
|
|
.Columns(columns =>
|
|
{
|
|
//columns.Bound(l => l.IssueID);
|
|
columns.Bound(l => l.IssueID).Template(@<text> @Html.ActionLink(@item.IssueID.ToString(), null)</text>)
|
|
.ClientTemplate("<a href='/#=DocumentType#/Edit?IssueID=#=DocID#'>#=IssueID#</a>");
|
|
columns.Bound(l => l.DocumentType);
|
|
columns.Bound(l => l.SubDoc);
|
|
columns.Bound(l => l.Originator);
|
|
columns.Bound(l => l.IssueDate).Format("{0:MM/dd/yy hh:mm:ss}");
|
|
columns.Bound(l => l.Title);
|
|
columns.Bound(l => l.LotNos);
|
|
columns.Bound(l => l.PendingApprovers).HtmlAttributes(new { style = "font-weight: bold; color: red;" }).Width("350px");
|
|
columns.Bound(l => l.SubmitedDate).Format("{0:MM/dd/yy hh:mm:ss}");
|
|
columns.Bound(l => l.CloseDate).Format("{0:MM/dd/yy hh:mm:ss}");
|
|
})
|
|
//.Events(e => e.DataBound("onAllDocsDB"))
|
|
// .Selectable(selectable => selectable.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
|
|
.Editable(editable => editable.Mode(GridEditMode.InLine))
|
|
.HtmlAttributes(new { style = "height: 700px;" })
|
|
.Scrollable()
|
|
.Sortable()
|
|
.Filterable(filterable => filterable
|
|
.Extra(false)
|
|
.Operators(operators => operators
|
|
.ForString(str => str
|
|
.Clear()
|
|
.Contains("Contains")
|
|
.DoesNotContain("Does not contain")
|
|
.StartsWith("Starts with")
|
|
.EndsWith("Ends with")
|
|
.IsEqualTo("Is equal to")
|
|
.IsNotEqualTo("Is not equal to ")
|
|
)
|
|
)
|
|
)
|
|
.Pageable(pageable => pageable
|
|
.Refresh(true)
|
|
.PageSizes(true)
|
|
.ButtonCount(5))
|
|
|
|
.DataSource(dataSource => dataSource
|
|
|
|
.Ajax()
|
|
.Model(model =>
|
|
{
|
|
model.Id(p => p.IssueID);
|
|
|
|
//model.Field(p => p.TotalCost).Editable(false);
|
|
})
|
|
// .Events(e => e.RequestEnd("LoadState"))
|
|
.PageSize(50)
|
|
.Read(read => read.Action("GetMRBList", "Home"))
|
|
.Destroy(destroy => destroy.Action("DeleteItem", "Home"))
|
|
)
|
|
|
|
)
|
|
}
|
|
|
|
|
|
|
|
|
|
</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">×</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>
|
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|
|
|
|
<script type="text/javascript">
|
|
//$('#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 onFileUploadSuccess(e) {
|
|
|
|
}
|
|
|
|
function checkFileType(e) {
|
|
var files = e.files;
|
|
|
|
if (confirm("Are you sure you want to set the QDB Flag"))
|
|
{
|
|
e.preventDefault();
|
|
}
|
|
else
|
|
{
|
|
$.each(files, function () {
|
|
|
|
if (!this.extension.toLowerCase().match(/^(.doc|.docx|.ppt|.pptx|.xls|.xlsx|.pdf|.gif|.jpeg|.jpg|.bmp|.png|.txt|.slddrw|.sldprt)$/)) {
|
|
alert("Only Word/PowerPoint/Excel/PDF/Image/Text files can be uploaded!")
|
|
e.preventDefault();
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
function onLotUploadError(e) {
|
|
//alert("Please make sure the 'Name of the Sheet' in the excel file which you are trying to use, is called 'Sheet1'");
|
|
if (e.XMLHttpRequest.responseText != '')
|
|
alert(e.XMLHttpRequest.responseText);
|
|
|
|
}
|
|
|
|
function onLotUpload(e) {
|
|
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 onSuccess(e)
|
|
{
|
|
alert("Operation completed");
|
|
}
|
|
|
|
</script>
|