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.

InterfaceController.cs 3.8 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. using Learun.Application.Base.SystemModule;
  2. using Learun.Util;
  3. using System.Web.Mvc;
  4. namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers
  5. {
  6. /// <summary>
  7. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  8. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  9. /// 创建人:陈彬彬
  10. /// 日 期:2017.04.01
  11. /// 描 述:接口管理
  12. /// </summary>
  13. public class InterfaceController : MvcControllerBase
  14. {
  15. private InterfaceIBLL interfaceIBLL = new InterfaceBLL();
  16. #region 视图功能
  17. /// <summary>
  18. /// 管理页面
  19. /// </summary>
  20. /// <returns></returns>
  21. [HttpGet]
  22. public ActionResult Index()
  23. {
  24. return View();
  25. }
  26. /// <summary>
  27. /// 表单页面
  28. /// </summary>
  29. /// <returns></returns>
  30. [HttpGet]
  31. public ActionResult Form()
  32. {
  33. return View();
  34. }
  35. /// <summary>
  36. /// 字段维护
  37. /// </summary>
  38. /// <returns></returns>
  39. [HttpGet]
  40. public ActionResult FieldForm()
  41. {
  42. return View();
  43. }
  44. #endregion
  45. #region 获取数据
  46. /// <summary>
  47. /// 获取列表数据
  48. /// </summary>
  49. /// <returns></returns>
  50. [HttpGet]
  51. [AjaxOnly]
  52. public ActionResult GetList()
  53. {
  54. var data = interfaceIBLL.GetList();
  55. return this.JsonResult(data);
  56. }
  57. /// <summary>
  58. /// 获取树形数据
  59. /// </summary>
  60. /// <returns></returns>
  61. [HttpGet]
  62. [AjaxOnly]
  63. public ActionResult GetTree()
  64. {
  65. var data = interfaceIBLL.GetTree();
  66. return this.JsonResult(data);
  67. }
  68. /// <summary>
  69. /// 获取分页数据
  70. /// </summary>
  71. /// <param name="pagination">分页参数</param>
  72. /// <param name="keyword">关键字</param>
  73. /// <returns></returns>
  74. [HttpGet]
  75. [AjaxOnly]
  76. public ActionResult GetPageList(string pagination, string keyword)
  77. {
  78. Pagination paginationobj = pagination.ToObject<Pagination>();
  79. var data = interfaceIBLL.GetPageList(paginationobj, keyword);
  80. var jsonData = new
  81. {
  82. rows = data,
  83. total = paginationobj.total,
  84. page = paginationobj.page,
  85. records = paginationobj.records,
  86. };
  87. return JsonResult(jsonData);
  88. }
  89. /// <summary>
  90. /// 获取实体数据
  91. /// </summary>
  92. /// <param name="keyValue">主键</param>
  93. /// <returns></returns>
  94. [HttpGet]
  95. [AjaxOnly]
  96. public ActionResult GetEntity(string keyValue)
  97. {
  98. var data = interfaceIBLL.GetEntity(keyValue);
  99. return JsonResult(data);
  100. }
  101. #endregion
  102. #region 提交数据
  103. /// <summary>
  104. /// 保存表单数据
  105. /// </summary>
  106. /// <param name="keyValue">主键</param>
  107. /// <param name="entity">实体</param>
  108. /// <returns></returns>
  109. [HttpPost]
  110. [ValidateAntiForgeryToken]
  111. [AjaxOnly]
  112. public ActionResult SaveForm(string keyValue, InterfaceEntity entity)
  113. {
  114. interfaceIBLL.SaveEntity(keyValue, entity);
  115. return Success("保存成功!");
  116. }
  117. /// <summary>
  118. /// 删除表单数据
  119. /// </summary>
  120. /// <param name="keyValue">主键</param>
  121. /// <returns></returns>
  122. [HttpPost]
  123. [AjaxOnly]
  124. public ActionResult DeleteForm(string keyValue)
  125. {
  126. interfaceIBLL.DeleteEntity(keyValue);
  127. return Success("删除成功!");
  128. }
  129. #endregion
  130. }
  131. }