Added ability to delete Corrective Actions through the list page.

This commit is contained in:
Daniel Wathen
2023-02-13 15:12:18 -07:00
parent bf59afdc1b
commit 09543b8474
6 changed files with 27 additions and 10 deletions

View File

@ -405,6 +405,9 @@ namespace Fab2ApprovalSystem.Controllers
ldDMO.DeleteLotDisposition(issue.IssueID);
else if (dType == GlobalVars.DocumentType.ECN)
ecnDMO.DeleteDocument(issue.IssueID, int.Parse(Session[GlobalVars.SESSION_USERID].ToString()), "ECN");
else if (dType == GlobalVars.DocumentType.CorrectiveAction)
ldDMO.DeleteCADocument(issue.IssueID, int.Parse(Session[GlobalVars.SESSION_USERID].ToString()), "Corrective Action");
return Json(new[] { issue }.ToDataSourceResult(request, ModelState));
}

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
@ -489,6 +489,16 @@ namespace Fab2ApprovalSystem.DMO
}
public void DeleteCADocument(int CANo, int userID, string caTypeString)
{
var parameters = new DynamicParameters();
parameters.Add("@UserID", userID);
parameters.Add("@CANo", CANo);
parameters.Add("@CAType", caTypeString);
this.db.Execute("_8DDeleteCADocument", parameters, commandType: CommandType.StoredProcedure);
}
/// <summary>
///
/// </summary>
@ -1413,4 +1423,4 @@ namespace Fab2ApprovalSystem.DMO
return fileName;
}
}
}
}

View File

@ -1,4 +1,4 @@
@{
@{
Layout = "_HomeLayout.cshtml";
}
@ -37,6 +37,7 @@
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.Template(t => { }).HeaderTemplate("").ClientTemplate(@"<a href='javascript: void(0)' class='abutton delete' onclick='deleteRowCA(this)' title='button delete'>button delete</a>");
})
@ -68,14 +69,14 @@
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(p => p.CANo);
{
model.Id(p => p.CANo);
//model.Field(p => p.TotalCost).Editable(false);
})
//model.Field(p => p.TotalCost).Editable(false);
})
.PageSize(50)
.Read(read => read.Action("GetCorrectiveActionList", "Home"))
//.Destroy(destroy => destroy.Action("DeleteItem", "Home"))
.Destroy(destroy => destroy.Action("DeleteItem", "Home"))
)
)
</div>
@ -93,5 +94,8 @@
return numStr;
}
</script>
function deleteRowCA(element) {
grid = $("#CAList").data("kendoGrid");
grid.removeRow($(element).closest("tr"));
}
</script>