Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

DbFieldController.cs 3.5 KiB

4 anni fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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.03.09
  11. /// 描 述:数据库创建常用字段
  12. /// </summary>
  13. public class DbFieldController : MvcControllerBase
  14. {
  15. private DbFieldIBLL dbFieldIBLL = new DbFieldBLL();
  16. /// <summary>
  17. /// 列表页面
  18. /// </summary>
  19. /// <returns></returns>
  20. public ActionResult Index()
  21. {
  22. return View();
  23. }
  24. /// <summary>
  25. /// 表单页面
  26. /// </summary>
  27. /// <returns></returns>
  28. [HttpGet]
  29. public ActionResult Form()
  30. {
  31. return View();
  32. }
  33. /// <summary>
  34. /// 字段选择页面
  35. /// </summary>
  36. /// <returns></returns>
  37. [HttpGet]
  38. public ActionResult SelectForm() {
  39. return View();
  40. }
  41. #region 获取数据
  42. /// <summary>
  43. /// 获取列表数据
  44. /// </summary>
  45. /// <returns></returns>
  46. [HttpGet]
  47. [AjaxOnly]
  48. public ActionResult GetList(string queryJson)
  49. {
  50. var data = dbFieldIBLL.GetList(queryJson);
  51. return this.JsonResult(data);
  52. }
  53. /// <summary>
  54. /// 获取分页数据
  55. /// </summary>
  56. /// <param name="pagination">分页参数</param>
  57. /// <param name="keyword">关键字</param>
  58. /// <returns></returns>
  59. [HttpGet]
  60. [AjaxOnly]
  61. public ActionResult GetPageList(string pagination, string queryJson)
  62. {
  63. Pagination paginationobj = pagination.ToObject<Pagination>();
  64. var data = dbFieldIBLL.GetPageList(paginationobj, queryJson);
  65. var jsonData = new
  66. {
  67. rows = data,
  68. total = paginationobj.total,
  69. page = paginationobj.page,
  70. records = paginationobj.records,
  71. };
  72. return JsonResult(jsonData);
  73. }
  74. /// <summary>
  75. /// 获取实体数据
  76. /// </summary>
  77. /// <param name="keyValue">主键</param>
  78. /// <returns></returns>
  79. [HttpGet]
  80. [AjaxOnly]
  81. public ActionResult GetEntity(string keyValue)
  82. {
  83. var data = dbFieldIBLL.GetEntity(keyValue);
  84. return JsonResult(data);
  85. }
  86. #endregion
  87. #region 提交数据
  88. /// <summary>
  89. /// 保存表单数据
  90. /// </summary>
  91. /// <param name="keyValue">主键</param>
  92. /// <param name="entity">实体</param>
  93. /// <returns></returns>
  94. [HttpPost]
  95. [ValidateAntiForgeryToken]
  96. [AjaxOnly]
  97. public ActionResult SaveForm(string keyValue, DbFieldEntity entity)
  98. {
  99. dbFieldIBLL.SaveEntity(keyValue, entity);
  100. return Success("保存成功!");
  101. }
  102. /// <summary>
  103. /// 删除表单数据
  104. /// </summary>
  105. /// <param name="keyValue">主键</param>
  106. /// <returns></returns>
  107. [HttpPost]
  108. [AjaxOnly]
  109. public ActionResult DeleteForm(string keyValue)
  110. {
  111. dbFieldIBLL.DeleteEntity(keyValue);
  112. return Success("删除成功!");
  113. }
  114. #endregion
  115. }
  116. }