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.
 
 
 
 
 
 

134 lines
3.7 KiB

  1. using Learun.Application.TwoDevelopment.LR_Desktop;
  2. using Learun.Util;
  3. using System.Data;
  4. using System.Web.Mvc;
  5. namespace Learun.Application.Web.Areas.LR_Desktop.Controllers
  6. {
  7. /// <summary>
  8. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  9. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  10. /// 创 建:超级管理员
  11. /// 日 期:2020-02-17 15:31
  12. /// 描 述:桌面标题背景
  13. /// </summary>
  14. public class DTTitleController : MvcControllerBase
  15. {
  16. private DTTitleIBLL dTTitleIBLL = new DTTitleBLL();
  17. private ThematicManagementIBLL thematicManagementIbll = new ThematicManagementBLL();
  18. #region 视图功能
  19. /// <summary>
  20. /// 主页面
  21. /// <summary>
  22. /// <returns></returns>
  23. [HttpGet]
  24. public ActionResult Index()
  25. {
  26. return View();
  27. }
  28. /// <summary>
  29. /// 表单页
  30. /// <summary>
  31. /// <returns></returns>
  32. [HttpGet]
  33. public ActionResult Form()
  34. {
  35. return View();
  36. }
  37. #endregion
  38. #region 获取数据
  39. /// <summary>
  40. /// 获取列表数据
  41. /// <summary>
  42. /// <returns></returns>
  43. [HttpGet]
  44. [AjaxOnly]
  45. public ActionResult GetList(string queryJson)
  46. {
  47. var data = dTTitleIBLL.GetList(queryJson);
  48. return Success(data);
  49. }
  50. /// <summary>
  51. /// 获取列表分页数据
  52. /// <param name="pagination">分页参数</param>
  53. /// <summary>
  54. /// <returns></returns>
  55. [HttpGet]
  56. [AjaxOnly]
  57. public ActionResult GetPageList(string pagination, string queryJson)
  58. {
  59. Pagination paginationobj = pagination.ToObject<Pagination>();
  60. var data = dTTitleIBLL.GetPageList(paginationobj, queryJson);
  61. var jsonData = new
  62. {
  63. rows = data,
  64. total = paginationobj.total,
  65. page = paginationobj.page,
  66. records = paginationobj.records
  67. };
  68. return Success(jsonData);
  69. }
  70. /// <summary>
  71. /// 获取表单数据
  72. /// <param name="keyValue">主键</param>
  73. /// <summary>
  74. /// <returns></returns>
  75. [HttpGet]
  76. [AjaxOnly]
  77. public ActionResult GetFormData(string keyValue)
  78. {
  79. var data = dTTitleIBLL.GetEntity(keyValue);
  80. return Success(data);
  81. }
  82. /// <summary>
  83. /// 获取表单数据
  84. /// <param name="keyValue">主键</param>
  85. /// <summary>
  86. /// <returns></returns>
  87. [HttpGet]
  88. [AjaxOnly]
  89. public ActionResult GetID()
  90. {
  91. var data = dTTitleIBLL.CreateNew();
  92. return Success(data);
  93. }
  94. #endregion
  95. #region 提交数据
  96. /// <summary>
  97. /// 删除实体数据
  98. /// <param name="keyValue">主键</param>
  99. /// <summary>
  100. /// <returns></returns>
  101. [HttpPost]
  102. [AjaxOnly]
  103. public ActionResult DeleteForm(string keyValue)
  104. {
  105. dTTitleIBLL.DeleteEntity(keyValue);
  106. return Success("删除成功!");
  107. }
  108. /// <summary>
  109. /// 保存实体数据(新增、修改)
  110. /// <param name="keyValue">主键</param>
  111. /// <summary>
  112. /// <returns></returns>
  113. [HttpPost]
  114. [ValidateAntiForgeryToken]
  115. [AjaxOnly]
  116. public ActionResult SaveForm(string keyValue, LR_DT_TitleEntity entity)
  117. {
  118. dTTitleIBLL.SaveEntity(keyValue, entity);
  119. return Success("保存成功!");
  120. }
  121. #endregion
  122. }
  123. }