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.

169 lines
3.8 KiB

10 months ago
10 months ago
  1. using NFine.Application.OMAY;
  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.OMAY.Controllers
  10. {
  11. public class OMAYKPIController : ControllerBase
  12. {
  13. OMAYApp App = new OMAYApp();
  14. // GET: OMAY/OMAYKPI
  15. public ActionResult OMAYKPIIndex()
  16. {
  17. return View();
  18. }
  19. public ActionResult OMAYMaintain()
  20. {
  21. return View();
  22. }
  23. public ActionResult OMAYMaintainAdd()
  24. {
  25. return View();
  26. }
  27. [HttpGet]
  28. [HandlerAjaxOnly]
  29. public ActionResult GetYLAndPC(string Type, string Group, string TimeFrom, string TimeArrive)
  30. {
  31. DataTable ListData = App.GetYLAndPC(Type, Group, TimeFrom, TimeArrive);
  32. var JsonData = new
  33. {
  34. rows = ListData,
  35. };
  36. return Content(JsonData.ToJson());
  37. }
  38. [HttpGet]
  39. [HandlerAjaxOnly]
  40. public ActionResult GetYLAndPCLRK(string Type, string Group, string TimeFrom, string TimeArrive)
  41. {
  42. DataTable ListData = App.GetYLAndPCLRK(Type, Group, TimeFrom, TimeArrive);
  43. var JsonData = new
  44. {
  45. rows = ListData,
  46. };
  47. return Content(JsonData.ToJson());
  48. }
  49. [HttpGet]
  50. [HandlerAjaxOnly]
  51. public ActionResult GetCC(string Type, string Group, string TimeFrom, string TimeArrive)
  52. {
  53. DataTable ListData = App.GetCC(Type, Group, TimeFrom, TimeArrive);
  54. var JsonData = new
  55. {
  56. rows = ListData,
  57. };
  58. return Content(JsonData.ToJson());
  59. }
  60. [HttpGet]
  61. [HandlerAjaxOnly]
  62. public ActionResult GetCCL7(string Type, string Group, string TimeFrom, string TimeArrive)
  63. {
  64. DataTable ListData = App.GetCCL7(Type, Group, TimeFrom, TimeArrive);
  65. var JsonData = new
  66. {
  67. rows = ListData,
  68. };
  69. return Content(JsonData.ToJson());
  70. }
  71. [HttpPost]
  72. [HandlerAjaxOnly]
  73. public ActionResult UpdateKPIMaintain(string keyValue)
  74. {
  75. string msg = App.UpdateKPIMaintain(keyValue);
  76. if (!string.IsNullOrEmpty(msg))
  77. {
  78. return Error(msg);
  79. }
  80. else
  81. {
  82. return Success("修改成功!");
  83. }
  84. }
  85. [HttpPost]
  86. [HandlerAjaxOnly]
  87. public ActionResult CreateKPIMaintain(string keyValue)
  88. {
  89. string msg = App.CreateKPIMaintain(keyValue);
  90. if (!string.IsNullOrEmpty(msg))
  91. {
  92. return Error(msg);
  93. }
  94. else
  95. {
  96. return Success("添加成功!");
  97. }
  98. }
  99. [HttpPost]
  100. [HandlerAjaxOnly]
  101. [ValidateAntiForgeryToken]
  102. public ActionResult DeleteOMAYMaintain(string keyValue)
  103. {
  104. string msg = App.DeleteOMAYMaintain(keyValue);
  105. if (string.IsNullOrEmpty(msg))
  106. {
  107. return Success("删除成功!");
  108. }
  109. else
  110. {
  111. return Error(msg);
  112. }
  113. }
  114. [HttpGet]
  115. public ActionResult GetZB(string TimeFrom, string TimeArrive)
  116. {
  117. var data = App.GetZB(TimeFrom, TimeArrive);
  118. return Content(data.ToJson());
  119. }
  120. [HttpGet]
  121. public ActionResult GetYFFJ(string TimeFrom, string TimeArrive)
  122. {
  123. var data = App.GetYFFJ(TimeFrom, TimeArrive);
  124. return Content(data.ToJson());
  125. }
  126. }
  127. }