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.

101 lines
2.8 KiB

4 days ago
  1. using NFine.Application;
  2. using NFine.Application.ProductManage;
  3. using NFine.Code;
  4. using NFine.Domain.Entity.ProductManage;
  5. using System.Collections.Generic;
  6. using System.Data;
  7. using System.Linq;
  8. using System.Web.Mvc;
  9. namespace NFine.Web.Areas.SRM.Controllers
  10. {
  11. public class ASNSelectController : ControllerBase
  12. {
  13. private ASNManageApp App = new ASNManageApp();
  14. [HttpGet]
  15. [HandlerAjaxOnly]
  16. public ActionResult GetInfoBySelectItemCode(Pagination pagination, string queryJson, string WorkPoint)
  17. {
  18. DataTable ListData = App.GetInfoBySelectItemCode(queryJson,ref pagination, WorkPoint);
  19. var JsonData = new
  20. {
  21. total = pagination.total,
  22. page = pagination.page,
  23. records = pagination.records,
  24. rows = ListData,
  25. };
  26. return Content(JsonData.ToJson());
  27. }
  28. public ActionResult Index()
  29. {
  30. return View();
  31. }
  32. //[HttpGet]
  33. //[HandlerAjaxOnly]
  34. //public ActionResult GetFormJson(string keyValue)
  35. //{
  36. // //var data = maintainAppApp.GetForm(keyValue);
  37. // //return Content(data.ToJson());
  38. //}
  39. [HttpPost]
  40. [HandlerAjaxOnly]
  41. [ValidateAntiForgeryToken]
  42. public ActionResult SubmitForm(string POCode, string PORow,string keyValue)
  43. {
  44. int i = App.CreateItemLotNo(POCode, PORow, keyValue);
  45. if (i > 0)
  46. {
  47. return Success("发布成功!");
  48. }
  49. else
  50. {
  51. return Error("发布失败!");
  52. }
  53. }
  54. [HttpGet]
  55. [HandlerAjaxOnly]
  56. public ActionResult GetSubGridJsonByCreate(string POCode, string PORow)
  57. {
  58. DataTable ListData = App.GetSubGridJsonByCreate(POCode, PORow);
  59. var JsonData = new
  60. {
  61. rows = ListData,
  62. };
  63. return Content(JsonData.ToJson());
  64. }
  65. [HttpGet]
  66. [HandlerAjaxOnly]
  67. public ActionResult GetVendorLotNo(string VenCode, string WorkPoint)
  68. {
  69. DataTable ListData = App.GetVendorLotNo(VenCode, WorkPoint);
  70. var JsonData = new
  71. {
  72. VendorLotNo = ListData.Rows[0][0].ToString(),
  73. };
  74. return Content(JsonData.ToJson());
  75. }
  76. [HttpPost]
  77. [HandlerAjaxOnly]
  78. [ValidateAntiForgeryToken]
  79. public ActionResult DeleteCartonNo( string keyValue)
  80. {
  81. string msg = App.DeleteCartonNo(keyValue);
  82. if (string.IsNullOrEmpty(msg))
  83. {
  84. return Success("删除成功!");
  85. }
  86. else
  87. {
  88. return Error(msg);
  89. }
  90. }
  91. }
  92. }