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.

145 lines
3.0 KiB

  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 GetCC(string Type, string Group, string TimeFrom, string TimeArrive)
  41. {
  42. DataTable ListData = App.GetCC(Type, Group, TimeFrom, TimeArrive);
  43. var JsonData = new
  44. {
  45. rows = ListData,
  46. };
  47. return Content(JsonData.ToJson());
  48. }
  49. [HttpPost]
  50. [HandlerAjaxOnly]
  51. public ActionResult UpdateKPIMaintain(string keyValue)
  52. {
  53. string msg = App.UpdateKPIMaintain(keyValue);
  54. if (!string.IsNullOrEmpty(msg))
  55. {
  56. return Error(msg);
  57. }
  58. else
  59. {
  60. return Success("修改成功!");
  61. }
  62. }
  63. [HttpPost]
  64. [HandlerAjaxOnly]
  65. public ActionResult CreateKPIMaintain(string keyValue)
  66. {
  67. string msg = App.CreateKPIMaintain(keyValue);
  68. if (!string.IsNullOrEmpty(msg))
  69. {
  70. return Error(msg);
  71. }
  72. else
  73. {
  74. return Success("添加成功!");
  75. }
  76. }
  77. [HttpPost]
  78. [HandlerAjaxOnly]
  79. [ValidateAntiForgeryToken]
  80. public ActionResult DeleteOMAYMaintain(string keyValue)
  81. {
  82. string msg = App.DeleteOMAYMaintain(keyValue);
  83. if (string.IsNullOrEmpty(msg))
  84. {
  85. return Success("删除成功!");
  86. }
  87. else
  88. {
  89. return Error(msg);
  90. }
  91. }
  92. [HttpGet]
  93. public ActionResult GetZB(string TimeFrom, string TimeArrive)
  94. {
  95. var data = App.GetZB(TimeFrom, TimeArrive);
  96. return Content(data.ToJson());
  97. }
  98. [HttpGet]
  99. public ActionResult GetYFFJ(string TimeFrom, string TimeArrive)
  100. {
  101. var data = App.GetYFFJ(TimeFrom, TimeArrive);
  102. return Content(data.ToJson());
  103. }
  104. }
  105. }