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.

213 lines
5.9 KiB

  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 ICSAccessoriesMOApplyController : ControllerBase
  13. {
  14. ICSAccessoriesMOIApplyApp App = new ICSAccessoriesMOIApplyApp();
  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. [HttpPost]
  37. [HandlerAjaxOnly]
  38. [ValidateAntiForgeryToken]
  39. public ActionResult DeleteICSMOApply(string keyValue)
  40. {
  41. string msg = App.DeleteICSMOApply(keyValue);
  42. if (string.IsNullOrEmpty(msg))
  43. {
  44. return Success("删除成功!");
  45. }
  46. else
  47. {
  48. return Error(msg);
  49. }
  50. }
  51. [HttpPost]
  52. [HandlerAjaxOnly]
  53. public ActionResult SaveICSMOApply(string ICSASN)
  54. {
  55. string msg = App.SaveICSMOApply(ICSASN);
  56. if (!string.IsNullOrEmpty(msg))
  57. {
  58. return Error(msg);
  59. }
  60. else
  61. {
  62. return Success("添加成功!");
  63. }
  64. }
  65. [HttpGet]
  66. public ActionResult GetICSMOApply(Pagination pagination, string queryJson)
  67. {
  68. DataTable ListData = App.GetICSMOApply(ref pagination, queryJson);
  69. var JsonData = new
  70. {
  71. total = pagination.total,
  72. page = pagination.page,
  73. records = pagination.records,
  74. rows = ListData,
  75. };
  76. return Content(JsonData.ToJson());
  77. }
  78. [HttpGet]
  79. public ActionResult GetICSMOApplyByApplyCode(string ApplyCode)
  80. {
  81. DataTable ListData = App.GetICSMOApplyByApplyCode(ApplyCode);
  82. var JsonData = new
  83. {
  84. rows = ListData,
  85. };
  86. return Content(JsonData.ToJson());
  87. }
  88. [HttpGet]
  89. [HandlerAjaxOnly]
  90. public ActionResult GetICSMOApplyDetail(string ApplyCode, string queryJson, Pagination pagination)
  91. {
  92. DataTable ListData = App.GetICSMOApplyDetail(ApplyCode, queryJson, ref pagination);
  93. var JsonData = new
  94. {
  95. total = pagination.total,
  96. page = pagination.page,
  97. records = pagination.records,
  98. rows = ListData,
  99. };
  100. return Content(JsonData.ToJson());
  101. }
  102. [HttpPost]
  103. [HandlerAjaxOnly]
  104. [ValidateAntiForgeryToken]
  105. public ActionResult DeleteICSMOApplyByCode(string keyValue)
  106. {
  107. string msg = App.DeleteICSMOApplyByCode(keyValue);
  108. if (string.IsNullOrEmpty(msg))
  109. {
  110. return Success("删除成功!");
  111. }
  112. else
  113. {
  114. return Error(msg);
  115. }
  116. }
  117. [HttpPost]
  118. [HandlerAjaxOnly]
  119. [ValidateAntiForgeryToken]
  120. public ActionResult ApproveICSMOApplyByCode(string keyValue)
  121. {
  122. string msg = App.ApproveICSMOApplyByCode(keyValue);
  123. if (string.IsNullOrEmpty(msg))
  124. {
  125. return Success("审核成功!");
  126. }
  127. else
  128. {
  129. return Error(msg);
  130. }
  131. }
  132. [HttpPost]
  133. [HandlerAjaxOnly]
  134. [ValidateAntiForgeryToken]
  135. public ActionResult AbandonICSMOApplyByCode(string keyValue)
  136. {
  137. string msg = App.AbandonICSMOApplyByCode(keyValue);
  138. if (string.IsNullOrEmpty(msg))
  139. {
  140. return Success("操作成功!");
  141. }
  142. else
  143. {
  144. return Error(msg);
  145. }
  146. }
  147. [HttpPost]
  148. [HandlerAjaxOnly]
  149. [ValidateAntiForgeryToken]
  150. public ActionResult CloseICSMOApplyByCode(string keyValue)
  151. {
  152. string msg = App.CloseICSMOApplyByCode(keyValue);
  153. if (string.IsNullOrEmpty(msg))
  154. {
  155. return Success("关闭成功!");
  156. }
  157. else
  158. {
  159. return Error(msg);
  160. }
  161. }
  162. public ActionResult GetBidCode(string WorkPoint)
  163. {
  164. try
  165. {
  166. string Code = App.GetBidCode(WorkPoint);
  167. var JsonData = new
  168. {
  169. Code = Code,
  170. };
  171. return Content(JsonData.ToJson());
  172. }
  173. catch (Exception ex)
  174. {
  175. return Error(ex.Message);
  176. }
  177. }
  178. [HttpPost]
  179. [HandlerAjaxOnly]
  180. public ActionResult UpdateICSMOApply(string ICSASN)
  181. {
  182. string msg = App.UpdateICSMOApply(ICSASN);
  183. if (!string.IsNullOrEmpty(msg))
  184. {
  185. return Error(msg);
  186. }
  187. else
  188. {
  189. return Success("修改成功!");
  190. }
  191. }
  192. public ActionResult GetICSReturnTemporary(string rfqno, Pagination pagination)
  193. {
  194. DataTable table = App.GetICSReturnTemporary(rfqno);
  195. var JsonData = new
  196. {
  197. total = pagination.total,
  198. page = pagination.page,
  199. records = pagination.records,
  200. rows = table
  201. };
  202. return Content(JsonData.ToJson());
  203. }
  204. }
  205. }