691 lines
29 KiB
Plaintext
691 lines
29 KiB
Plaintext
@model Fab2ApprovalSystem.Models.Audit
|
|
|
|
@{
|
|
ViewBag.Title = "ReadOnly";
|
|
}
|
|
|
|
<style>
|
|
table {
|
|
border-spacing: 5px;
|
|
padding: 5px;
|
|
border-color: white;
|
|
vertical-align: top;
|
|
}
|
|
|
|
.k-header .k-link {
|
|
text-align: center;
|
|
vertical-align: top;
|
|
}
|
|
|
|
.k-grid-edit-row input {
|
|
width: 100%;
|
|
}
|
|
|
|
.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%;
|
|
}
|
|
</style>
|
|
<link rel="stylesheet" href="/Content/kendo/kendo.blueopal.min.css" />
|
|
<link rel="stylesheet" href="~/Content/kendogridcustom.css" />
|
|
<body>
|
|
|
|
@using (Html.BeginForm())
|
|
{
|
|
@*@Html.AntiForgeryToken()*@
|
|
<div>
|
|
<div class="panel panel-default center-block" data-spy="affix">
|
|
<input type="button" value="Back to Audit List" class="btn btn-primary btn-xs" id="AuditList" />
|
|
|
|
</div>
|
|
</div>
|
|
<div class="panel panel-default center-block" style="font-size: 10px">
|
|
<div class="panel-body bg-warning">
|
|
<div class="row">
|
|
<div class="col-sm-12 text-center">
|
|
<font style="color: crimson; font-size:24px;font-weight: bolder">
|
|
Audit
|
|
</font>
|
|
</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-3">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Audit #:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBoxFor(model => model.AuditNo, "A" + "{0:00000}", new { id = "txtAuditNo", @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<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.AuditTitle, new { id = "txtAuditTitle", @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue; width=100%" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-sm-3">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Audit Score:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBoxFor(model => model.AuditScore, new { id = "txtAuditScore", @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-sm-3">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Audit Type:</label>
|
|
</div>
|
|
<div class="form-control-static col-sm-9">
|
|
@(Html.Kendo().MultiSelect()
|
|
.Name("AuditTypeIDs")
|
|
.BindTo(new SelectList(ViewBag.AuditTypeList, "AuditTypeID", "AuditTypeName"))
|
|
.Value(ViewBag.Nothing)
|
|
.HtmlAttributes(new { style = "font-size:10px", Readonly = "Readonly" })
|
|
)
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Audit Date:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@(Html.Kendo().DatePickerFor(model => model.AuditDate)
|
|
.Name("txtAuditDate")
|
|
.HtmlAttributes(new { @type = "text", Readonly = "Readonly" })
|
|
)
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Auditors:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@(Html.Kendo().MultiSelect()
|
|
.Name("AuditorIDs")
|
|
.BindTo(new SelectList(ViewBag.AuditorList, "AuditorID", "AuditorName"))
|
|
.HtmlAttributes(new { style = "font-size:10px", Readonly = "Readonly" })
|
|
.Value(ViewBag.Nothing)
|
|
)
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-sm-3">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Audit Finding Categories:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBoxFor(model => model.AuditFindingCategories, new { id = "txtAuditFindingCategories", @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-sm-3">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Audited Area:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@(Html.Kendo().MultiSelect()
|
|
.Name("AuditedAreaIDs")
|
|
.BindTo(new SelectList(ViewBag.AuditAreaList, "AuditedAreaID", "AuditedAreaName"))
|
|
.Value(ViewBag.Nothing)
|
|
.HtmlAttributes(new { style = "font-size:10px", Readonly = "Readonly" })
|
|
)
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">#Major Non Conformities:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBoxFor(model => model.NoOfMajorNonConformities, new { id = "txtNoOfMajorNonConformities", @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">#Minor Non Conformities:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBoxFor(model => model.NoOfMinorNonConformities, new { id = "txtNoOfMinorNonConformities", @class = "k-textbox", Readonly = "Readonly", style = "background-color:lightblue" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Auditees:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextAreaFor(model => model.Auditees, 3, 6, new { id = "txtAuditees", @class = "k-textbox", Readonly = "Readonly", style = "font-size: 10px;width: 100%;" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Audit Status:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@(Html.Kendo().DropDownList()
|
|
.Name("AuditStatus")
|
|
.DataTextField("Text")
|
|
.DataValueField("Value")
|
|
.BindTo(new List<SelectListItem>()
|
|
{
|
|
new SelectListItem()
|
|
{
|
|
Text = "Open",
|
|
Value = "0"
|
|
},
|
|
new SelectListItem()
|
|
{
|
|
Text = "Closed",
|
|
Value = "1"
|
|
},
|
|
new SelectListItem()
|
|
{
|
|
Text = "Cancelled",
|
|
Value = "2"
|
|
}
|
|
}
|
|
)
|
|
.Value(Model.AuditStatus.ToString())
|
|
.HtmlAttributes(new { Readonly = "Readonly" })
|
|
)
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="panel panel-default" style="font-size: 10px">
|
|
<div class="panel-body bg-info">
|
|
<div class="pull-left">
|
|
<h5>
|
|
<font style="color:crimson">
|
|
Documents Attachments
|
|
</font>
|
|
</h5>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<div class="panel-body bg-warning">
|
|
|
|
<div class="form-group">
|
|
<div>
|
|
@*@(Html.Kendo().Upload()
|
|
.Name("AuditReportFiles")
|
|
.Async(a => a
|
|
.Save("AuditReportAttachSave", "Audit", new { auditNo = Model.AuditNo })
|
|
.AutoUpload(true)
|
|
)
|
|
.ShowFileList(false)
|
|
.Events(events => events
|
|
.Success("onFileUploadSuccess")
|
|
.Upload("checkFileType")
|
|
)
|
|
)*@
|
|
|
|
|
|
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.AuditReportAttachment>()
|
|
.Name("AuditReportAttachments")
|
|
.Columns(columns =>
|
|
{
|
|
columns.Bound(a => a.ID).Visible(false);
|
|
columns.Bound(a => a.AuditNo).Visible(false);
|
|
columns.Bound(a => a.FileGUID).Visible(false);
|
|
columns.Bound(a => a.FileName);
|
|
columns.Bound(a => a.UploadedByName);
|
|
columns.Bound(a => a.UploadDateTime).Format("{0:MM/dd/yy hh:mm:ss}");
|
|
columns.Command(command => command.Custom("View").Click("DownloadAttachment"));
|
|
//columns.Command(command => command.Custom("Delete").Click("DeleteAttachment"));
|
|
//columns.Command(command => command.Destroy());
|
|
|
|
|
|
})
|
|
|
|
.Sortable()
|
|
.Scrollable()
|
|
.HtmlAttributes(new { style = "height:200px; width:100%; font-size: 10px" })
|
|
.DataSource(dataSource => dataSource
|
|
.Ajax()
|
|
//.Batch(false)
|
|
.ServerOperation(false)
|
|
.Events(events => events.Error("error_handler"))
|
|
.Model(model =>
|
|
{
|
|
model.Id(p => p.ID);
|
|
})
|
|
.PageSize(50)
|
|
.Read(read => read.Action("AuditReportAttachment_Read", "Audit", new { auditNo = Model.AuditNo }))
|
|
//.Destroy(destroy => destroy.Action("AuditReportAttachment_Destroy", "Audit"))
|
|
)
|
|
)
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<div class="panel panel-default" style="font-size: 10px">
|
|
<div class="panel-body bg-info">
|
|
<div class="pull-left">
|
|
<h5>
|
|
<font style="color:crimson">
|
|
Findings
|
|
</font>
|
|
</h5>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<div>
|
|
|
|
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.AuditFindings>()
|
|
.Name("AuditFindings")
|
|
.Columns(columns =>
|
|
{
|
|
columns.Bound(a => a.ID).Visible(false);
|
|
columns.Bound(a => a.AuditNo).Visible(false);
|
|
columns.Bound(a => a.CAOwner).Visible(false);
|
|
columns.Bound(a => a.CANo).Visible(false);
|
|
columns.Bound(a => a.AuditFindingCategoryID).Visible(false);
|
|
columns.Bound(a => a.Title).Width("100px");
|
|
columns.Bound(a => a.Findings).Width("250px");
|
|
columns.Bound(a => a.AssignedDate).Format("{0:MM/dd/yy}").Width("50px");
|
|
columns.Bound(a => a.FindingType).Title("Type").Width("50px");
|
|
columns.Bound(a => a.ViolatedClause).Width("250px");
|
|
columns.Bound(a => a.FindingCategories).Title("Categories").Width("150px").Encoded(false).Width("300px");
|
|
columns.Bound(a => a.CANoDisp).ClientTemplate("#=buildCALinks(CANo, CANoDisp)#").Width("100px");
|
|
columns.Bound(a => a.CAStatus).Title("8D Status").Width("50px");
|
|
columns.Bound(a => a.CAOwner).Title("8D Owner").Width("50px");
|
|
|
|
|
|
columns.Command(command => command.Custom("View").Click("ViewAuditFindings")).Width("100px");
|
|
//columns.Command(command => command.Custom("Delete").Click("DeletetAuditFindings")).Width("100px");
|
|
|
|
})
|
|
.Sortable()
|
|
.Scrollable()
|
|
.HtmlAttributes(new { style = "height:200px; width:100%; font-size: 10px" })
|
|
.DataSource(dataSource => dataSource
|
|
.Ajax()
|
|
//.Batch(false)
|
|
.ServerOperation(false)
|
|
.Model(model =>
|
|
{
|
|
model.Id(p => p.ID);
|
|
})
|
|
.PageSize(20)
|
|
.Read(read => read.Action("GetAuditFindingsList", "Audit", new { auditNo = Model.AuditNo }))
|
|
)
|
|
.Resizable(resize => resize.Columns(true))
|
|
|
|
)
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@*<div class="panel panel-default">
|
|
<div class="panel-body bg-warning">
|
|
@(Html.Kendo().Grid<Fab2ApprovalSystem.Models.CAFindings>()
|
|
.Name("CAFindings")
|
|
.Columns(columns =>
|
|
{
|
|
columns.Bound(a => a.ID).Visible(false);
|
|
columns.Bound(a => a.ResponsibilityOwnerID).Visible(false);
|
|
columns.Bound(a => a.CAFinding).Width("250px");
|
|
columns.Bound(a => a.CorrectiveAction).Width("250px");
|
|
columns.Bound(a => a.AssignedDate).Format("{0:MM/dd/yy}").Width("50px");
|
|
columns.Bound(a => a.Result).Width("100px");
|
|
columns.Bound(a => a.AttachmentLinks).ClientTemplate("#=buildLinks(AttachmentLinks, AuditNo)#").Width("100px");
|
|
columns.Bound(a => a.ResponsibilityOwnerName).Width("100px");
|
|
columns.Bound(a => a.ECD).Width("100px").Format("{0:MM/dd/yy hh:mm:ss}");
|
|
columns.Bound(a => a.ImplementedDate).Width("100px").Format("{0:MM/dd/yy hh:mm:ss}");
|
|
|
|
})
|
|
//.ToolBar(toolbar => toolbar.Create().Text("Add Item"))
|
|
.Resizable(resize => resize.Columns(true))
|
|
.Sortable()
|
|
.Scrollable()
|
|
.HtmlAttributes(new { style = "height:125; width:100%; font-size: 11px" })
|
|
.DataSource(dataSource => dataSource
|
|
.Ajax()
|
|
//.Batch(false)
|
|
.ServerOperation(false)
|
|
.Model(model =>
|
|
{
|
|
model.Id(p => p.ID);
|
|
model.Field(a => a.AuditNo).DefaultValue(Model.AuditNo);
|
|
|
|
|
|
})
|
|
.PageSize(50)
|
|
.Read(read => read.Action("GetCAFindingsList", "Audit", new { auditNo = Model.AuditNo }))
|
|
)
|
|
)
|
|
</div>
|
|
</div>*@
|
|
|
|
|
|
<div class="modal fade" id="AuditFindingsForm" tabindex="0" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content" style="width: 1000px; font-size:11px">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
<h4 class="modal-title" id="myModalLabel">Edit Audit Findings</h4>
|
|
</div>
|
|
|
|
<div class="modal-body ">
|
|
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Findings(Major/Minor):</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBox("txtAuditFindings", null, new { @class = "k-textbox", style = "width:100%" , ReadOnly = "ReadOnly"})
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Violated Clause:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBox("txtViolatedClause", null, new { @class = "k-textbox", style = "width:100%", ReadOnly = "ReadOnly" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Type:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@(Html.Kendo().DropDownList()
|
|
.Name("AuditFindingType")
|
|
.DataTextField("Text")
|
|
.DataValueField("Value")
|
|
.BindTo(new List<SelectListItem>()
|
|
{
|
|
new SelectListItem()
|
|
{
|
|
Text = "Minor",
|
|
Value = "Minor"
|
|
},
|
|
new SelectListItem()
|
|
{
|
|
Text = "Major",
|
|
Value = "Major"
|
|
}
|
|
}
|
|
)
|
|
.Value(Model.AuditStatus.ToString())
|
|
.HtmlAttributes(new { Readonly = "Readonly" })
|
|
)
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Corrective Action:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@Html.TextBox("txtCorrectiveAction", null, new { @class = "k-textbox", Readonly = "Readonly" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class="control-label pull-right">Audit Find Categories:</label>
|
|
</div>
|
|
<div class="col-sm-9">
|
|
@(Html.Kendo().MultiSelect()
|
|
.Name("AuditFindingCategoryIDs")
|
|
.BindTo(new SelectList(ViewBag.AuditFindingCategoryList, "AuditFindingCategoryID", "AuditFindingCategoryName"))
|
|
.Value(ViewBag.Nothing)
|
|
.HtmlAttributes(new { style = "font-size:11px", Readonly = "Readonly" })
|
|
)
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="modal fade" id="timeout" tabindex="0" role="dialog" aria-hidden="true" data-backdrop="static">
|
|
<div class="modal-dialog modal-lg" style="width:500px;">
|
|
<div class="modal-content">
|
|
<div class="modal-header" style="background-color: #fce0a3;">
|
|
<h3 class="modal-title">Page About To Timeout</h3>
|
|
</div>
|
|
<div class="modal-body" style="background-color: crimson; font-size: 20px; color:white">
|
|
You will automatically be redirected to your Home Page in 1 minute.<br />
|
|
To remain on this page please close this window or press the ESC key.
|
|
</div>
|
|
<div class="modal-footer" style="background-color: #fce0a3; ">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
</body>
|
|
<script type="text/javascript">
|
|
var auditFindingOperation;
|
|
var auditFindingsItemID ;
|
|
|
|
|
|
|
|
|
|
function DownloadAttachment(e) {
|
|
e.preventDefault();
|
|
|
|
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
|
|
var fileName = dataItem.FileGUID;
|
|
var fileGUID = dataItem.FileGUID;
|
|
|
|
window.location = '/Audit/DownloadAuditReportAttachment?fileGuid=' + fileGUID + '&auditNo=' + @Model.AuditNo;
|
|
//window.open('/LotDisposition/DownloadFile?attachmentID=' + attachmentID, '_blank');
|
|
|
|
}
|
|
|
|
function error_handler(e) {
|
|
if (e.errors) {
|
|
var message = "Errors:\n";
|
|
$.each(e.errors, function (key, value) {
|
|
if ('errors' in value) {
|
|
$.each(value.errors, function () {
|
|
message += this + "\n";
|
|
});
|
|
}
|
|
});
|
|
alert(message);
|
|
}
|
|
}
|
|
|
|
|
|
function ViewAuditFindings(e)
|
|
{
|
|
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
|
|
auditFindingsItemID = dataItem.ID;
|
|
var findings = dataItem.Findings;
|
|
var findingType = dataItem.FindingType;
|
|
var violatedClause = dataItem.ViolatedClause;
|
|
var caNO = dataItem.CANo;
|
|
|
|
|
|
clearAuditFindingForm();
|
|
|
|
$("#txtAuditFindings").val(findings);
|
|
$("#txtViolatedClause").val(violatedClause);
|
|
$("#AuditFindingType").data("kendoDropDownList").value(findingType);
|
|
$("#txtCorrectiveAction").val(caNO);
|
|
|
|
var tempAuditFindingCategory;
|
|
//alert(dataItem.ResponsiblePerson);
|
|
var data;
|
|
var dataArray;
|
|
|
|
|
|
$("#AuditFindingCategoryIDs").data("kendoMultiSelect").value("");
|
|
|
|
if (dataItem.AuditFindingCategoryID != null) {
|
|
tempAuditFindingCategory = dataItem.AuditFindingCategoryID.split(',');
|
|
|
|
|
|
var attValues = new Array();
|
|
for (i in tempAuditFindingCategory) {
|
|
attValues[i] = tempAuditFindingCategory[i]
|
|
}
|
|
}
|
|
|
|
$("#AuditFindingCategoryIDs").data("kendoMultiSelect").value(attValues);
|
|
|
|
e.preventDefault();
|
|
$("#AuditFindingsForm").modal("show");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function clearAuditFindingForm() {
|
|
$("#txtAuditFindings").val('');
|
|
$("#txtViolatedClause").val('');
|
|
$("#txtCorrectiveAction").val('');
|
|
}
|
|
|
|
|
|
$("#AuditList").on('click', function(){
|
|
var url = '@Url.Action("AuditList", "Home")';
|
|
window.location = url;
|
|
})
|
|
|
|
function buildCALinks(CAs, CANoDisp) {
|
|
|
|
return "<a href='/CorrectiveAction/Edit?IssueID=" + CAs + "'> " + CANoDisp + ",</a>" + " ";
|
|
|
|
}
|
|
|
|
|
|
|
|
function buildLinks(fileNames, auditNo) {
|
|
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='/Audit/DownloadAuditReportAttachment?fileGuid=" + fileGuid + "&auditNo=" + @Model.AuditNo + "'>" + fileName + "</a><BR>" + " ";
|
|
|
|
|
|
}
|
|
|
|
}
|
|
return template;
|
|
}
|
|
|
|
|
|
function onFileUploadSuccess(e) {
|
|
var grid = $("#AuditReportAttachments").data("kendoGrid");
|
|
grid.dataSource.read($('#txtAuditNo').val());
|
|
}
|
|
|
|
function checkFileType(e) {
|
|
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|.slddrw|.sldprt)$/)) {
|
|
alert("Only Word/PowerPoint/Excel/PDF/Image/Text files can be uploaded!")
|
|
e.preventDefault();
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
</script>
|