PartitionSettingController.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. using LeaRun.Application.Busines.DMAManage;
  2. using LeaRun.Application.Code;
  3. using LeaRun.Util.WebControl;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Web;
  8. using System.Web.Mvc;
  9. namespace LeaRun.Application.Web.Areas.DMAManage.Controllers
  10. {
  11. public class PartitionSettingController : MvcControllerBase
  12. {
  13. PartitionSettingBLL partitionSettingBLL = new PartitionSettingBLL();
  14. // 分区设置
  15. // GET: /DMAManage/PartitionDraw/
  16. #region 视图区域
  17. public ActionResult Index()
  18. {
  19. return View();
  20. }
  21. #endregion
  22. #region 获取考核表数据
  23. /// <summary>
  24. /// 获取考核表数据
  25. /// </summary>
  26. /// <param name="pagination"></param>
  27. /// <param name="keyType"></param>
  28. /// <param name="keyWord"></param>
  29. /// <returns></returns>
  30. [HttpGet]
  31. public ActionResult GetMeterAssessments(Pagination pagination, string keyType, string keyWord, string DMAID)
  32. {
  33. return Content(partitionSettingBLL.GetMeterAssessments(pagination, keyType, keyWord, DMAID));
  34. }
  35. #endregion
  36. #region 获取关系表数据
  37. /// <summary>
  38. /// 获取关系表数据
  39. /// </summary>
  40. /// <param name="pagination"></param>
  41. /// <param name="keyType"></param>
  42. /// <param name="keyWord"></param>
  43. /// <param name="DMAID"></param>
  44. /// <param name="FlowType"></param>
  45. /// <returns></returns>
  46. public ActionResult GetDMAMeterRelations(Pagination pagination, string keyType, string keyWord, string DMAID, string FlowType)
  47. {
  48. return Content(partitionSettingBLL.GetDMAMeterRelations(pagination, keyType, keyWord, DMAID, FlowType));
  49. }
  50. #endregion
  51. #region 考核表ID插入到关系表中
  52. /// <summary>
  53. /// 考核表ID插入到关系表中
  54. /// </summary>
  55. /// <param name="meterIds"></param>
  56. /// <param name="DMAID"></param>
  57. /// <param name="FlowType"></param>
  58. /// <returns></returns>
  59. [HttpPost]
  60. [ValidateAntiForgeryToken]
  61. [AjaxOnly]
  62. public ActionResult SettingInMeterToRelation(string meterIds, string DMAID, string FlowType)
  63. {
  64. string userId = OperatorProvider.Provider.Current().UserId;
  65. string companyId = OperatorProvider.Provider.Current().CompanyId;
  66. string result = partitionSettingBLL.SettingInMeterToRelation(meterIds, DMAID, userId, companyId, FlowType);
  67. if ("".Equals(result))
  68. {
  69. return Success("操作成功!");
  70. }
  71. else
  72. {
  73. return Error(result);
  74. }
  75. }
  76. #endregion
  77. #region 入口水表挂接关系表插入到考核表中 关系表 -> 考核表
  78. /// <summary>
  79. /// 入口水表挂接关系表插入到考核表中 关系表 -> 考核表
  80. /// </summary>
  81. /// <param name="meterIds"></param>
  82. /// <param name="DMAID"></param>
  83. /// <returns></returns>
  84. [HttpPost]
  85. [ValidateAntiForgeryToken]
  86. [AjaxOnly]
  87. public ActionResult SettingInRelationToMeter(string meterIds, string DMAID)
  88. {
  89. string result = partitionSettingBLL.SettingInRelationToMeter(meterIds, DMAID);
  90. if ("".Equals(result))
  91. {
  92. return Success("操作成功!");
  93. }
  94. else
  95. {
  96. return Error(result);
  97. }
  98. }
  99. #endregion
  100. #region 获取户表挂接数据
  101. /// <summary>
  102. /// 获取户表挂接数据
  103. /// </summary>
  104. /// <param name="pagination"></param>
  105. /// <param name="keyType"></param>
  106. /// <param name="keyWord"></param>
  107. /// <param name="DMAID"></param>
  108. /// <returns></returns>
  109. public ActionResult GetDMAMeterUsers(Pagination pagination, string keyType, string keyWord, string DMAID)
  110. {
  111. return Content(partitionSettingBLL.GetDMAMeterUsers(pagination, keyType, keyWord, DMAID));
  112. }
  113. #endregion
  114. #region 获取户表挂接可以挂接的数据
  115. /// <summary>
  116. /// 获取户表挂接可以挂接的数据
  117. /// </summary>
  118. /// <param name="pagination"></param>
  119. /// <param name="keyType"></param>
  120. /// <param name="keyWord"></param>
  121. /// <returns></returns>
  122. public ActionResult GetMeterUsers(Pagination pagination, string keyType, string keyWord)
  123. {
  124. return Content(partitionSettingBLL.GetMeterUsers(pagination, keyType, keyWord));
  125. }
  126. #endregion
  127. #region 户表插入
  128. /// <summary>
  129. /// 户表插入
  130. /// </summary>
  131. /// <param name="meterIds"></param>
  132. /// <param name="DMAID"></param>
  133. /// <returns></returns>
  134. [HttpPost]
  135. [ValidateAntiForgeryToken]
  136. [AjaxOnly]
  137. public ActionResult SettingMeterUserIn(string meterIds, string DMAID)
  138. {
  139. string result = partitionSettingBLL.SettingMeterUserIn(meterIds, DMAID);
  140. if ("".Equals(result))
  141. {
  142. return Success("操作成功!");
  143. }
  144. else
  145. {
  146. return Error(result);
  147. }
  148. }
  149. #endregion
  150. #region 户表删除
  151. /// <summary>
  152. /// 户表删除
  153. /// </summary>
  154. /// <param name="meterIds"></param>
  155. /// <returns></returns>
  156. [HttpPost]
  157. [ValidateAntiForgeryToken]
  158. [AjaxOnly]
  159. public ActionResult SettingMeterUserOut(string meterIds)
  160. {
  161. string result = partitionSettingBLL.SettingMeterUserOut(meterIds);
  162. if ("".Equals(result))
  163. {
  164. return Success("操作成功!");
  165. }
  166. else
  167. {
  168. return Error(result);
  169. }
  170. }
  171. #endregion
  172. }
  173. }