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.

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