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.

215 lines
5.9 KiB

3 weeks ago
  1. using NFine.Application.DHAY;
  2. using NFine.Code;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.IO;
  7. using System.Linq;
  8. using System.Reflection.Emit;
  9. using System.Web;
  10. using System.Web.Mvc;
  11. namespace NFine.Web.Areas.DHAY.Controllers
  12. {
  13. public class ICSMOIssueController : ControllerBase
  14. {
  15. ICSMOIssueAPP App = new ICSMOIssueAPP();
  16. // GET: DHAY/ICSCustomerSuppliedReturn
  17. public ActionResult Index()
  18. {
  19. return View();
  20. }
  21. public ActionResult Create()
  22. {
  23. return View();
  24. }
  25. public ActionResult GetInvCode()
  26. {
  27. return View();
  28. }
  29. public ActionResult Update()
  30. {
  31. return View();
  32. }
  33. public ActionResult GetWHCode()
  34. {
  35. return View();
  36. }
  37. [HttpPost]
  38. [HandlerAjaxOnly]
  39. [ValidateAntiForgeryToken]
  40. public ActionResult DeleteICSMOIssue(string keyValue)
  41. {
  42. string msg = App.DeleteICSMOIssue(keyValue);
  43. if (string.IsNullOrEmpty(msg))
  44. {
  45. return Success("删除成功!");
  46. }
  47. else
  48. {
  49. return Error(msg);
  50. }
  51. }
  52. [HttpPost]
  53. [HandlerAjaxOnly]
  54. public ActionResult SaveICSMOIssue(string ICSASN)
  55. {
  56. string msg = App.SaveICSMOIssue(ICSASN);
  57. if (!string.IsNullOrEmpty(msg))
  58. {
  59. return Error(msg);
  60. }
  61. else
  62. {
  63. return Success("添加成功!");
  64. }
  65. }
  66. [HttpGet]
  67. public ActionResult GetICSMOIssue(Pagination pagination, string queryJson)
  68. {
  69. DataTable ListData = App.GetICSMOIssue(ref pagination, queryJson);
  70. var JsonData = new
  71. {
  72. total = pagination.total,
  73. page = pagination.page,
  74. records = pagination.records,
  75. rows = ListData,
  76. };
  77. return Content(JsonData.ToJson());
  78. }
  79. [HttpGet]
  80. public ActionResult GetICSMOIssueByIssueCode(string IssueCode)
  81. {
  82. DataTable ListData = App.GetICSMOIssueByIssueCode(IssueCode);
  83. var JsonData = new
  84. {
  85. rows = ListData,
  86. };
  87. return Content(JsonData.ToJson());
  88. }
  89. [HttpGet]
  90. [HandlerAjaxOnly]
  91. public ActionResult GetICSMOIssueDetail(string IssueCode, string queryJson, Pagination pagination)
  92. {
  93. DataTable ListData = App.GetICSMOIssueDetail(IssueCode, queryJson, ref pagination);
  94. var JsonData = new
  95. {
  96. total = pagination.total,
  97. page = pagination.page,
  98. records = pagination.records,
  99. rows = ListData,
  100. };
  101. return Content(JsonData.ToJson());
  102. }
  103. [HttpPost]
  104. [HandlerAjaxOnly]
  105. [ValidateAntiForgeryToken]
  106. public ActionResult DeleteICSMOIssueByCode(string keyValue)
  107. {
  108. string msg = App.DeleteICSMOIssueByCode(keyValue);
  109. if (string.IsNullOrEmpty(msg))
  110. {
  111. return Success("删除成功!");
  112. }
  113. else
  114. {
  115. return Error(msg);
  116. }
  117. }
  118. public ActionResult GetBidCode(string WorkPoint)
  119. {
  120. try
  121. {
  122. string Code = App.GetBidCode(WorkPoint);
  123. var JsonData = new
  124. {
  125. Code = Code,
  126. };
  127. return Content(JsonData.ToJson());
  128. }
  129. catch (Exception ex)
  130. {
  131. return Error(ex.Message);
  132. }
  133. }
  134. [HttpPost]
  135. [HandlerAjaxOnly]
  136. public ActionResult UpdateICSMOIssue(string ICSASN)
  137. {
  138. string msg = App.UpdateICSMOIssue(ICSASN);
  139. if (!string.IsNullOrEmpty(msg))
  140. {
  141. return Error(msg);
  142. }
  143. else
  144. {
  145. return Success("修改成功!");
  146. }
  147. }
  148. public ActionResult GetICSReturnTemporary(string rfqno, Pagination pagination)
  149. {
  150. DataTable table = App.GetICSReturnTemporary(rfqno);
  151. var JsonData = new
  152. {
  153. total = pagination.total,
  154. page = pagination.page,
  155. records = pagination.records,
  156. rows = table
  157. };
  158. return Content(JsonData.ToJson());
  159. }
  160. [HttpGet]
  161. [HandlerAjaxOnly]
  162. public ActionResult GetU9CodeType(string type)
  163. {
  164. string dt = App.GetU9CodeType(type);
  165. return Content(dt);
  166. }
  167. [HttpGet]
  168. [HandlerAjaxOnly]
  169. public ActionResult GetItemList(Pagination pagination, string queryJson)
  170. {
  171. DataTable ListData = App.GetItemList(queryJson, ref pagination);
  172. var JsonData = new
  173. {
  174. total = pagination.total,
  175. page = pagination.page,
  176. records = pagination.records,
  177. rows = ListData,
  178. };
  179. return Content(JsonData.ToJson());
  180. }
  181. [HttpGet]
  182. [HandlerAjaxOnly]
  183. public ActionResult GetItemListCount(Pagination pagination, string queryJson)
  184. {
  185. DataTable ListData = App.GetItemListCount(queryJson,ref pagination);
  186. var JsonData = new
  187. {
  188. total = pagination.total,
  189. page = pagination.page,
  190. records = pagination.records,
  191. rows = ListData,
  192. };
  193. return Content(JsonData.ToJson());
  194. }
  195. [HttpGet]
  196. public ActionResult GetLYDep()
  197. {
  198. DataTable dt = App.GetLYDep();
  199. return Content(dt.ToJson());
  200. }
  201. }
  202. }