You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

179 lines
4.3 KiB

3 weeks ago
  1. using NFine.Application.WMS;
  2. using System.Data;
  3. using System.Web.Mvc;
  4. using NFine.Code;
  5. namespace NFine.Web.Areas.WMS.Controllers
  6. {
  7. public class ICSApplyController : ControllerBase
  8. {
  9. ICSApplyApp App = new ICSApplyApp();
  10. // GET: WMS/ICSApply
  11. public ActionResult ICSApply()
  12. {
  13. return View();
  14. }
  15. public ActionResult ICSApplyAdd()
  16. {
  17. return View();
  18. }
  19. public ActionResult SeachMaterial()
  20. {
  21. return View();
  22. }
  23. public ActionResult ICSApplyUpdate()
  24. {
  25. return View();
  26. }
  27. [HttpGet]
  28. public ActionResult SearchICSApply(Pagination pagination, string queryJson)
  29. {
  30. DataTable ListData = App.SearchICSApply(queryJson, ref pagination);
  31. var JsonData = new
  32. {
  33. total = pagination.total,
  34. page = pagination.page,
  35. records = pagination.records,
  36. rows = ListData,
  37. };
  38. return Content(JsonData.ToJson());
  39. }
  40. [HttpGet]
  41. [HandlerAjaxOnly]
  42. public ActionResult SeachICSApplyDetail(string Code, Pagination pagination)
  43. {
  44. DataTable ListData = App.SeachICSApplyDetail(Code, ref pagination);
  45. var JsonData = new
  46. {
  47. total = pagination.total,
  48. page = pagination.page,
  49. records = pagination.records,
  50. rows = ListData,
  51. };
  52. return Content(JsonData.ToJson());
  53. }
  54. [HttpGet]
  55. public ActionResult GetINV(string invcode, string Code, string Invstd, string EATTRIBUTE2, Pagination pagination)
  56. {
  57. DataTable ListData = App.GetINV(invcode, Code, Invstd, EATTRIBUTE2, ref pagination);
  58. var JsonData = new
  59. {
  60. total = pagination.total,
  61. page = pagination.page,
  62. records = pagination.records,
  63. rows = ListData,
  64. };
  65. return Content(JsonData.ToJson());
  66. }
  67. [HttpGet]
  68. [HandlerAjaxOnly]
  69. public ActionResult GetDocumentType()
  70. {
  71. DataTable dt = App.GetDocumentType();
  72. return Content(dt.ToJson());
  73. }
  74. public ActionResult GetICSApplyDetail(string ApplyCode, Pagination pagination)
  75. {
  76. DataTable table = App.GetICSApplyDetail(ApplyCode, ref pagination);
  77. var JsonData = new
  78. {
  79. total = pagination.total,
  80. page = pagination.page,
  81. records = pagination.records,
  82. rows = table
  83. };
  84. return Content(JsonData.ToJson());
  85. }
  86. [HttpPost]
  87. [HandlerAjaxOnly]
  88. public ActionResult SaveICSApply(string ICSASN)
  89. {
  90. string msg = App.SaveICSApply(ICSASN);
  91. if (!string.IsNullOrEmpty(msg))
  92. {
  93. return Error(msg);
  94. }
  95. else
  96. {
  97. return Success("添加成功!");
  98. }
  99. }
  100. [HttpPost]
  101. [HandlerAjaxOnly]
  102. public ActionResult UpdateICSApply(string ICSASN)
  103. {
  104. string msg = App.UpdateICSApply(ICSASN);
  105. if (!string.IsNullOrEmpty(msg))
  106. {
  107. return Error(msg);
  108. }
  109. else
  110. {
  111. return Success("修改成功!");
  112. }
  113. }
  114. [HttpPost]
  115. [HandlerAjaxOnly]
  116. [ValidateAntiForgeryToken]
  117. public ActionResult DeleteICSApply(string keyValue)
  118. {
  119. string msg = App.DeleteICSApply(keyValue);
  120. if (string.IsNullOrEmpty(msg))
  121. {
  122. return Success("删除成功!");
  123. }
  124. else
  125. {
  126. return Error(msg);
  127. }
  128. }
  129. [HttpPost]
  130. [HandlerAjaxOnly]
  131. public ActionResult AuditICSApply(string keyValue)
  132. {
  133. string msg = App.AuditICSApply(keyValue);
  134. if (!string.IsNullOrEmpty(msg))
  135. {
  136. return Error(msg);
  137. }
  138. else
  139. {
  140. return Success("操作成功!");
  141. }
  142. }
  143. }
  144. }