Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

160 wiersze
5.2 KiB

  1. using Learun.Application.Base.SystemModule;
  2. using Learun.Application.Extention.DisplayBoardManage;
  3. using Learun.Util;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Web.Mvc;
  7. namespace Learun.Application.Web.Areas.LR_DisplayBoard.Controllers
  8. {
  9. /// <summary>
  10. /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架
  11. /// Copyright (c) 2013-2018 上海力软信息技术有限公司
  12. /// 创 建:超级管理员
  13. /// 日 期:2018-09-20 10:08
  14. /// 描 述:看板发布
  15. /// </summary>
  16. public class LR_KBFeaManageController : MvcControllerBase
  17. {
  18. private LR_KBFeaManageIBLL lR_KBFeaManageIBLL = new LR_KBFeaManageBLL();
  19. private ModuleIBLL moduleIBLL = new ModuleBLL();
  20. #region 视图功能
  21. /// <summary>
  22. /// 主页面
  23. /// <summary>
  24. /// <returns></returns>
  25. [HttpGet]
  26. public ActionResult Index()
  27. {
  28. return View();
  29. }
  30. /// <summary>
  31. /// 表单页
  32. /// <summary>
  33. /// <returns></returns>
  34. [HttpGet]
  35. public ActionResult Form()
  36. {
  37. return View();
  38. }
  39. #endregion
  40. #region 获取数据
  41. /// <summary>
  42. /// 获取列表数据
  43. /// <summary>
  44. /// <returns></returns>
  45. [HttpGet]
  46. [AjaxOnly]
  47. public ActionResult GetList( string queryJson )
  48. {
  49. var data = lR_KBFeaManageIBLL.GetList(queryJson);
  50. return Success(data);
  51. }
  52. /// <summary>
  53. /// 获取列表分页数据
  54. /// <param name="pagination">分页参数</param>
  55. /// <summary>
  56. /// <returns></returns>
  57. [HttpGet]
  58. [AjaxOnly]
  59. public ActionResult GetPageList(string pagination, string queryJson)
  60. {
  61. Pagination paginationobj = pagination.ToObject<Pagination>();
  62. var data = lR_KBFeaManageIBLL.GetPageList(paginationobj, queryJson);
  63. var jsonData = new
  64. {
  65. rows = data,
  66. total = paginationobj.total,
  67. page = paginationobj.page,
  68. records = paginationobj.records
  69. };
  70. return Success(jsonData);
  71. }
  72. /// <summary>
  73. /// 获取表单数据
  74. /// <param name="keyValue">主键</param>
  75. /// <summary>
  76. /// <returns></returns>
  77. [HttpGet]
  78. [AjaxOnly]
  79. public ActionResult GetFormData(string keyValue)
  80. {
  81. var data = lR_KBFeaManageIBLL.GetEntity(keyValue);
  82. return Success(data);
  83. }
  84. #endregion
  85. #region 提交数据
  86. /// <summary>
  87. /// 删除实体数据
  88. /// <param name="keyValue">主键</param>
  89. /// <summary>
  90. /// <returns></returns>
  91. [HttpPost]
  92. [AjaxOnly]
  93. public ActionResult DeleteForm(string keyValue)
  94. {
  95. string moduleId = lR_KBFeaManageIBLL.GetEntity(keyValue).F_ModuleId;
  96. lR_KBFeaManageIBLL.DeleteEntity(keyValue);
  97. moduleIBLL.Delete(moduleId);
  98. return Success("删除成功!");
  99. }
  100. /// <summary>
  101. /// 保存实体数据(新增、修改)
  102. /// <param name="keyValue">主键</param>
  103. /// <summary>
  104. /// <returns></returns>
  105. [HttpPost]
  106. [ValidateAntiForgeryToken]
  107. [AjaxOnly]
  108. public ActionResult SaveForm(string keyValue,LR_KBFeaManageEntity entity)
  109. {
  110. try
  111. {
  112. ModuleEntity moduleEntity = new ModuleEntity();
  113. if (string.IsNullOrEmpty(keyValue))// 新增
  114. {
  115. entity.Create();
  116. moduleEntity.F_Target = "iframe";
  117. }
  118. moduleEntity.F_UrlAddress = "/LR_DisplayBoard/LR_KBKanBanInfo/PreviewForm?keyValue=" + entity.F_KanBanId;
  119. moduleEntity.F_ModuleId = entity.F_ModuleId;
  120. moduleEntity.F_ParentId = entity.F_ParentId;
  121. moduleEntity.F_Icon = entity.F_Icon;
  122. moduleEntity.F_FullName = entity.F_FullName;
  123. moduleEntity.F_EnCode = entity.F_EnCode;
  124. moduleEntity.F_SortCode = entity.F_SortCode;
  125. moduleEntity.F_IsMenu = 1;
  126. moduleEntity.F_EnabledMark = 1;
  127. List<ModuleButtonEntity> moduleButtonList = new List<ModuleButtonEntity>();
  128. ModuleButtonEntity addButtonEntity = new ModuleButtonEntity();
  129. List<ModuleColumnEntity> moduleColumnList = new List<ModuleColumnEntity>();
  130. List<ModuleFormEntity> moduleFormEntitys = new List<ModuleFormEntity>();
  131. moduleIBLL.SaveEntity(moduleEntity.F_ModuleId, moduleEntity, moduleButtonList, moduleColumnList, moduleFormEntitys);
  132. entity.F_ModuleId = moduleEntity.F_ModuleId;
  133. lR_KBFeaManageIBLL.SaveEntity(keyValue, entity);
  134. return Success("保存成功!");
  135. }
  136. catch (Exception ex)
  137. {
  138. if (ex is ExceptionEx)
  139. {
  140. throw;
  141. }
  142. else
  143. {
  144. throw ExceptionEx.ThrowServiceException(ex);
  145. }
  146. }
  147. }
  148. #endregion
  149. }
  150. }