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.

127 lines
3.4 KiB

4 days ago
  1. using NFine.Application.SRM;
  2. using NFine.Code;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Web;
  8. using System.Web.Mvc;
  9. namespace NFine.Web.Areas.SRM.Controllers
  10. {
  11. public class ICSSrmportAlnoticeController : ControllerBase
  12. {
  13. ICSSrmportAlnoticeApp App = new ICSSrmportAlnoticeApp();
  14. //
  15. // GET: /SRM/ICSSrmportAlnotice/
  16. /// <summary>
  17. /// 查询界面
  18. /// </summary>
  19. /// <returns></returns>
  20. public ActionResult AnnouncementIssued()
  21. {
  22. return View();
  23. }
  24. /// <summary>
  25. /// 新增修改界面
  26. /// </summary>
  27. /// <returns></returns>
  28. public ActionResult AnnouncementIssuedAdd()
  29. {
  30. return View();
  31. }
  32. public ActionResult AnnouncementIssuedUpdate()
  33. {
  34. return View();
  35. }
  36. [HttpGet]
  37. [HandlerAjaxOnly]
  38. public ActionResult GetGridJson(Pagination pagination, string queryJson)
  39. {
  40. DataTable ListData = App.GetGridJson(queryJson, ref pagination);
  41. var JsonData = new
  42. {
  43. total = pagination.total,
  44. page = pagination.page,
  45. records = pagination.records,
  46. rows = ListData,
  47. };
  48. return Content(JsonData.ToJson());
  49. }
  50. /// <summary>
  51. /// 获取公告类型
  52. /// </summary>
  53. /// <param name="WorkPoint"></param>
  54. /// <returns></returns>
  55. [HttpGet]
  56. [HandlerAjaxOnly]
  57. public ActionResult GetNOTICETYPE()
  58. {
  59. DataTable dt = App.GetNOTICETYPE();
  60. return Content(dt.ToJson());
  61. }
  62. /// <summary>
  63. /// 保存公告
  64. /// </summary>
  65. /// <param name="keyValue"></param>
  66. /// <returns></returns>
  67. [HttpPost]
  68. [HandlerAjaxOnly]
  69. [ValidateAntiForgeryToken]
  70. public ActionResult SubmitSrmportAlnotice(string keyValue, string ID)
  71. {
  72. try
  73. {
  74. App.SubmitSrmportAlnotice(keyValue, ID);
  75. return Success("保存成功!");
  76. }
  77. catch (Exception ex)
  78. {
  79. return Error(ex.Message);
  80. }
  81. }
  82. [HttpPost]
  83. [HandlerAjaxOnly]
  84. [ValidateAntiForgeryToken]
  85. public ActionResult DeleteSrmportAlnotice(string keyValue)
  86. {
  87. string msg = App.DeleteSrmportAlnotice(keyValue);
  88. if (string.IsNullOrWhiteSpace(msg))
  89. {
  90. return Success("删除成功!");
  91. }
  92. else
  93. {
  94. return Error("删除失败");
  95. }
  96. }
  97. [HttpGet]
  98. [HandlerAjaxOnly]
  99. public ActionResult ICSSrmportAlnoticeByCreate(string NoticeID)
  100. {
  101. DataTable ListData = App.ICSSrmportAlnoticeByCreate(NoticeID);
  102. var JsonData = new
  103. {
  104. rows = ListData,
  105. };
  106. return Content(JsonData.ToJson());
  107. }
  108. public ActionResult ImportOrder()
  109. {
  110. try
  111. {
  112. App.ImportOrder();
  113. return Success("成功");
  114. }
  115. catch (Exception ex)
  116. {
  117. return Success(ex.Message);
  118. }
  119. }
  120. }
  121. }