using NFine.Application.WMS; using System.Data; using System.Web.Mvc; using NFine.Code; namespace NFine.Web.Areas.WMS.Controllers { public class ICSApplyController : ControllerBase { ICSApplyApp App = new ICSApplyApp(); // GET: WMS/ICSApply public ActionResult ICSApply() { return View(); } public ActionResult ICSApplyAdd() { return View(); } public ActionResult SeachMaterial() { return View(); } public ActionResult ICSApplyUpdate() { return View(); } [HttpGet] public ActionResult SearchICSApply(Pagination pagination, string queryJson) { DataTable ListData = App.SearchICSApply(queryJson, ref pagination); var JsonData = new { total = pagination.total, page = pagination.page, records = pagination.records, rows = ListData, }; return Content(JsonData.ToJson()); } [HttpGet] [HandlerAjaxOnly] public ActionResult SeachICSApplyDetail(string Code, Pagination pagination) { DataTable ListData = App.SeachICSApplyDetail(Code, ref pagination); var JsonData = new { total = pagination.total, page = pagination.page, records = pagination.records, rows = ListData, }; return Content(JsonData.ToJson()); } [HttpGet] public ActionResult GetINV(string invcode, string Code, string Invstd, string EATTRIBUTE2, Pagination pagination) { DataTable ListData = App.GetINV(invcode, Code, Invstd, EATTRIBUTE2, ref pagination); var JsonData = new { total = pagination.total, page = pagination.page, records = pagination.records, rows = ListData, }; return Content(JsonData.ToJson()); } [HttpGet] [HandlerAjaxOnly] public ActionResult GetDocumentType() { DataTable dt = App.GetDocumentType(); return Content(dt.ToJson()); } public ActionResult GetICSApplyDetail(string ApplyCode, Pagination pagination) { DataTable table = App.GetICSApplyDetail(ApplyCode, ref pagination); var JsonData = new { total = pagination.total, page = pagination.page, records = pagination.records, rows = table }; return Content(JsonData.ToJson()); } [HttpPost] [HandlerAjaxOnly] public ActionResult SaveICSApply(string ICSASN) { string msg = App.SaveICSApply(ICSASN); if (!string.IsNullOrEmpty(msg)) { return Error(msg); } else { return Success("添加成功!"); } } [HttpPost] [HandlerAjaxOnly] public ActionResult UpdateICSApply(string ICSASN) { string msg = App.UpdateICSApply(ICSASN); if (!string.IsNullOrEmpty(msg)) { return Error(msg); } else { return Success("修改成功!"); } } [HttpPost] [HandlerAjaxOnly] [ValidateAntiForgeryToken] public ActionResult DeleteICSApply(string keyValue) { string msg = App.DeleteICSApply(keyValue); if (string.IsNullOrEmpty(msg)) { return Success("删除成功!"); } else { return Error(msg); } } [HttpPost] [HandlerAjaxOnly] public ActionResult AuditICSApply(string keyValue) { string msg = App.AuditICSApply(keyValue); if (!string.IsNullOrEmpty(msg)) { return Error(msg); } else { return Success("操作成功!"); } } } }