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.

262 lines
7.1 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.Linq;
  7. using System.Reflection.Emit;
  8. using System.Web;
  9. using System.Web.Mvc;
  10. namespace NFine.Web.Areas.DHAY.Controllers
  11. {
  12. public class ICSSDNController : ControllerBase
  13. {
  14. ICSSDNApp App = new ICSSDNApp();
  15. // GET: DHAY/ICSCustomerSuppliedReturn
  16. public ActionResult Index()
  17. {
  18. return View();
  19. }
  20. public ActionResult Create()
  21. {
  22. return View();
  23. }
  24. public ActionResult GetInvCode()
  25. {
  26. return View();
  27. }
  28. public ActionResult Update()
  29. {
  30. return View();
  31. }
  32. public ActionResult GetWHCode()
  33. {
  34. return View();
  35. }
  36. public ActionResult GetBatch()
  37. {
  38. return View();
  39. }
  40. [HttpGet]
  41. [HandlerAjaxOnly]
  42. public ActionResult GetU9CodeType()
  43. {
  44. DataTable dt = App.GetU9CodeType();
  45. return Content(dt.ToJson());
  46. }
  47. [HttpPost]
  48. [HandlerAjaxOnly]
  49. [ValidateAntiForgeryToken]
  50. public ActionResult DeleteICSSDN(string keyValue)
  51. {
  52. string msg = App.DeleteICSSDN(keyValue);
  53. if (string.IsNullOrEmpty(msg))
  54. {
  55. return Success("删除成功!");
  56. }
  57. else
  58. {
  59. return Error(msg);
  60. }
  61. }
  62. [HttpPost]
  63. [HandlerAjaxOnly]
  64. public ActionResult SaveICSSDN(string ICSASN)
  65. {
  66. try
  67. {
  68. string msg = App.SaveICSSDN(ICSASN);
  69. if (!string.IsNullOrEmpty(msg))
  70. {
  71. return Error(msg);
  72. }
  73. else
  74. {
  75. return Success("添加成功!");
  76. }
  77. }
  78. catch (Exception ex)
  79. {
  80. return Error(ex.Message);
  81. }
  82. }
  83. [HttpGet]
  84. public ActionResult GetICSSDN(Pagination pagination, string queryJson)
  85. {
  86. DataTable ListData = App.GetICSSDN(ref pagination, queryJson);
  87. var JsonData = new
  88. {
  89. total = pagination.total,
  90. page = pagination.page,
  91. records = pagination.records,
  92. rows = ListData,
  93. };
  94. return Content(JsonData.ToJson());
  95. }
  96. [HttpGet]
  97. public ActionResult GetICSSDNBySDNCode(string SDNCode)
  98. {
  99. DataTable ListData = App.GetICSSDNBySDNCode(SDNCode);
  100. var JsonData = new
  101. {
  102. rows = ListData,
  103. };
  104. return Content(JsonData.ToJson());
  105. }
  106. [HttpGet]
  107. [HandlerAjaxOnly]
  108. public ActionResult GetICSSDNDetail(string SDNCode, string queryJson, Pagination pagination)
  109. {
  110. DataTable ListData = App.GetICSSDNDetail(SDNCode, queryJson, ref pagination);
  111. var JsonData = new
  112. {
  113. total = pagination.total,
  114. page = pagination.page,
  115. records = pagination.records,
  116. rows = ListData,
  117. };
  118. return Content(JsonData.ToJson());
  119. }
  120. [HttpPost]
  121. [HandlerAjaxOnly]
  122. [ValidateAntiForgeryToken]
  123. public ActionResult DeleteICSSDNByCode(string keyValue)
  124. {
  125. string msg = App.DeleteICSSDNByCode(keyValue);
  126. if (string.IsNullOrEmpty(msg))
  127. {
  128. return Success("删除成功!");
  129. }
  130. else
  131. {
  132. return Error(msg);
  133. }
  134. }
  135. [HttpPost]
  136. [HandlerAjaxOnly]
  137. [ValidateAntiForgeryToken]
  138. public ActionResult DeleteICSSDNById(string keyValue)
  139. {
  140. string msg = App.DeleteICSSDNById(keyValue);
  141. if (string.IsNullOrEmpty(msg))
  142. {
  143. return Success("删除成功!");
  144. }
  145. else
  146. {
  147. return Error(msg);
  148. }
  149. }
  150. public ActionResult GetBidCode(string WorkPoint)
  151. {
  152. try
  153. {
  154. string Code = App.GetBidCode(WorkPoint);
  155. var JsonData = new
  156. {
  157. Code = Code,
  158. };
  159. return Content(JsonData.ToJson());
  160. }
  161. catch (Exception ex)
  162. {
  163. return Error(ex.Message);
  164. }
  165. }
  166. [HttpPost]
  167. [HandlerAjaxOnly]
  168. public ActionResult UpdateICSSDN(string ICSASN)
  169. {
  170. string msg = App.UpdateICSSDN(ICSASN);
  171. if (!string.IsNullOrEmpty(msg))
  172. {
  173. return Error(msg);
  174. }
  175. else
  176. {
  177. return Success("修改成功!");
  178. }
  179. }
  180. [HttpGet]
  181. [HandlerAjaxOnly]
  182. public ActionResult GetItemList(Pagination pagination, string queryJson)
  183. {
  184. DataTable ListData = App.GetItemList(queryJson, ref pagination);
  185. var JsonData = new
  186. {
  187. total = pagination.total,
  188. page = pagination.page,
  189. records = pagination.records,
  190. rows = ListData,
  191. };
  192. return Content(JsonData.ToJson());
  193. }
  194. public ActionResult GetICSReturnTemporary(string rfqno, Pagination pagination)
  195. {
  196. DataTable table = App.GetICSReturnTemporary(rfqno);
  197. var JsonData = new
  198. {
  199. total = pagination.total,
  200. page = pagination.page,
  201. records = pagination.records,
  202. rows = table
  203. };
  204. return Content(JsonData.ToJson());
  205. }
  206. /// <summary>
  207. /// 获取批次信息
  208. /// </summary>
  209. /// <param name="pagination"></param>
  210. /// <param name="queryJson"></param>
  211. /// <returns></returns>
  212. [HttpGet]
  213. [HandlerAjaxOnly]
  214. public ActionResult GetBatchList(Pagination pagination, string queryJson)
  215. {
  216. DataTable ListData = App.GetBatchList(queryJson, ref pagination);
  217. var JsonData = new
  218. {
  219. total = pagination.total,
  220. page = pagination.page,
  221. records = pagination.records,
  222. rows = ListData,
  223. };
  224. return Content(JsonData.ToJson());
  225. }
  226. [HttpGet]
  227. [HandlerAjaxOnly]
  228. public ActionResult GetU9Status(string SOCode)
  229. {
  230. try
  231. {
  232. DataTable ListData = App.GetU9Status(SOCode);
  233. if (ListData.Rows.Count <= 0)
  234. {
  235. return Success("验证成功");
  236. }
  237. else
  238. {
  239. return Error("验证失败");
  240. }
  241. }
  242. catch (Exception ex)
  243. {
  244. return Error(ex.Message);
  245. }
  246. }
  247. }
  248. }