diff --git a/.vs/Fab2ApprovalSystem/FileContentIndex/ebbf2280-9117-4a7c-a9b9-e1e9b808657d.vsidx b/.vs/Fab2ApprovalSystem/FileContentIndex/5f0ce5a2-c27e-4d03-9e06-c1f704035194.vsidx similarity index 79% rename from .vs/Fab2ApprovalSystem/FileContentIndex/ebbf2280-9117-4a7c-a9b9-e1e9b808657d.vsidx rename to .vs/Fab2ApprovalSystem/FileContentIndex/5f0ce5a2-c27e-4d03-9e06-c1f704035194.vsidx index f07592f..1390a2d 100644 Binary files a/.vs/Fab2ApprovalSystem/FileContentIndex/ebbf2280-9117-4a7c-a9b9-e1e9b808657d.vsidx and b/.vs/Fab2ApprovalSystem/FileContentIndex/5f0ce5a2-c27e-4d03-9e06-c1f704035194.vsidx differ diff --git a/.vs/Fab2ApprovalSystem/v17/.suo b/.vs/Fab2ApprovalSystem/v17/.suo index e3b9042..d01fae1 100644 Binary files a/.vs/Fab2ApprovalSystem/v17/.suo and b/.vs/Fab2ApprovalSystem/v17/.suo differ diff --git a/Fab2ApprovalSystem/Controllers/CorrectiveActionController.cs b/Fab2ApprovalSystem/Controllers/CorrectiveActionController.cs index b0a886e..9ab9fd4 100644 --- a/Fab2ApprovalSystem/Controllers/CorrectiveActionController.cs +++ b/Fab2ApprovalSystem/Controllers/CorrectiveActionController.cs @@ -334,6 +334,10 @@ namespace Fab2ApprovalSystem.Controllers return Json(caDMO.GetCAAttachmentsList(caNo, Functions.CASectionMapper(GlobalVars.CASection.D2)).ToDataSourceResult(request)); } + public ActionResult Attachment_Read([DataSourceRequest] DataSourceRequest request, int caNO) + { + return Json(caDMO.GetCAAttachmentsList(caNO, "").ToDataSourceResult(request), JsonRequestBehavior.AllowGet); + } /// /// diff --git a/Fab2ApprovalSystem/Views/CorrectiveAction/Edit.cshtml b/Fab2ApprovalSystem/Views/CorrectiveAction/Edit.cshtml index d6d6867..597d89e 100644 --- a/Fab2ApprovalSystem/Views/CorrectiveAction/Edit.cshtml +++ b/Fab2ApprovalSystem/Views/CorrectiveAction/Edit.cshtml @@ -431,6 +431,47 @@ +
+
+ +
+ + + + @(Html.Kendo().Grid() + .Name("Attachments") + .Columns(columns => + { + columns.Bound(a => a.ID).Visible(false); + columns.Bound(a => a.CANo).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("DownloadCAAttachment")); + columns.Command(command => command.Custom("Delete").Click("DeleteCAAttachment")); + + }) + + .Sortable() + .HtmlAttributes(new { style = "height:300px; width:100%; font-size: 10px", Readonly = "Readonly" }) + .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("Attach_Read", "CorrectiveAction", new { caNO = Model.CANo })) + .Destroy(destroy => destroy.Action("DeleteCAAttachment", "CorrectionAction")) + ) + ) +
+
+
@@ -2733,7 +2774,7 @@ return message; } - + $('#CATypeList').on('change', function () { HideAllSections(); @@ -3245,7 +3286,7 @@ $('#cover-spin').show(0); var data = ReturnModelObject(); var confirmationMessage = "Submit " + section + " completion for approval?"; - + if (!confirm(confirmationMessage)) { $('#' + section + 'Completed').prop('checked', false); if (section == 'D5D6D7') { @@ -3317,7 +3358,7 @@ else { alert(result); if (result.indexOf("Validation initiated") >= 0) { - + var url = '@Url.Action("Edit", "CorrectiveAction", new { issueID = "__id__" })'; url = url.replace('amp;', ''); window.location.href = url.replace('__id__', "@Model.CANo"); @@ -3399,7 +3440,7 @@ } }) - + return false; @@ -3914,8 +3955,30 @@ grid.dataSource.read("@Model.CANo"); } + function DeleteCAAttachment(e) { + e.preventDefault(); + if (confirm("Are you sure you want to delete this Attachment?")) { + var dataItem = this.dataItem($(e.currentTarget).closest("tr")); + var fileName = dataItem.FileGUID; + var attachmentID = dataItem.ID; - + $.ajax({ + url: "/CorrectiveAction/DeleteCAAttachment", + type: "POST", + datatype: "json", + data: { + attachmentID: attachmentID + }, + success: function (data) { + var grid = $("#Attachments").data("kendoGrid"); + grid.dataSource.read("@Model.CANo"); + }, + error: function (result) { + alert("Failed " + result); + } + }); + } + } function DeleteD2CAAttachment(e) { e.preventDefault(); @@ -4116,7 +4179,7 @@ var grid = $("#D5D6CorrectivetActions").data("kendoGrid"); grid.dataSource.read($("@Model.CANo").val()); $("#D5D6CorrectiveActionForm").modal("hide"); - + }, error: function (result) { diff --git a/Fab2ApprovalSystem/Views/CorrectiveAction/ReadOnlyCA.cshtml b/Fab2ApprovalSystem/Views/CorrectiveAction/ReadOnlyCA.cshtml index e056781..ad75852 100644 --- a/Fab2ApprovalSystem/Views/CorrectiveAction/ReadOnlyCA.cshtml +++ b/Fab2ApprovalSystem/Views/CorrectiveAction/ReadOnlyCA.cshtml @@ -318,6 +318,46 @@
+
+
+ +
+ + + + @(Html.Kendo().Grid() + .Name("files") + .Columns(columns => + { + columns.Bound(a => a.ID).Visible(false); + columns.Bound(a => a.CANo).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("DownloadCAAttachment")); + //columns.Command(command => command.Custom("Delete").Click("DeleteD4CAAttachment")); + + }) + + .Sortable() + .HtmlAttributes(new { style = "height:300px; width:100%; font-size: 10px", Readonly = "Readonly" }) + .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("Attach_Read", "CorrectiveAction", new { caNO = Model.CANo })) + ) + ) +
+
+
diff --git a/Fab2ApprovalSystem/Views/Home/CorrectiveActionList.cshtml b/Fab2ApprovalSystem/Views/Home/CorrectiveActionList.cshtml index e0a8508..a40ac34 100644 --- a/Fab2ApprovalSystem/Views/Home/CorrectiveActionList.cshtml +++ b/Fab2ApprovalSystem/Views/Home/CorrectiveActionList.cshtml @@ -25,18 +25,18 @@ { columns.Bound(l => l.CANo) - .ClientTemplate("#=formatIssueID(CANo)#").Width("50px"); + .ClientTemplate("#=formatIssueID(CANo)#"); - columns.Bound(l => l.CASource).Width("100px"); - columns.Bound(l => l.RequestorName).Title("Requestor").Width("250px"); - columns.Bound(l => l.D1AssigneeName).Title("Assignee").Width("100px"); - columns.Bound(l => l.IssueDate).Format("{0:MM/dd/yy}").Width("100px"); - columns.Bound(l => l.CATitle).Width("150px"); - columns.Bound(l => l.StatusName).Width("50px"); - columns.Bound(l => l.PendingApprovers).Width("100px"); - columns.Bound(l => l.PendingAIOwners).Width("100px").Title("Action Item Owners"); - columns.Bound(l => l.D8DueDate).Format("{0:MM/dd/yy}").Width("100px"); - columns.Bound(l => l.ClosedDate).Format("{0:MM/dd/yy}").Width("100px"); + columns.Bound(l => l.CASource); + columns.Bound(l => l.RequestorName).Title("Requestor"); + columns.Bound(l => l.D1AssigneeName).Title("Assignee"); + columns.Bound(l => l.IssueDate).Format("{0:MM/dd/yy}"); + columns.Bound(l => l.CATitle); + columns.Bound(l => l.StatusName); + columns.Bound(l => l.PendingApprovers); + columns.Bound(l => l.PendingAIOwners).Title("Action Item Owners"); + columns.Bound(l => l.D8DueDate).Format("{0:MM/dd/yy}"); + columns.Bound(l => l.ClosedDate).Format("{0:MM/dd/yy}"); columns.Template(t => { }).HeaderTemplate("").ClientTemplate(@"button delete"); })