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.
 
 
 
 
 
 

145 lines
4.2 KiB

  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.EducationalAdministration;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System;
  8. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  9. {
  10. /// <summary>
  11. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  12. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  13. /// 创 建:超级管理员
  14. /// 日 期:2021-09-27 10:33
  15. /// 描 述:学金类型
  16. /// </summary>
  17. public class ScholarshipTranController : MvcControllerBase
  18. {
  19. private ScholarshipTranIBLL scholarshipTranIBLL = new ScholarshipTranBLL();
  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. /// <param name="pagination">分页参数</param>
  45. /// <param name="queryJson">查询参数</param>
  46. /// <returns></returns>
  47. [HttpGet]
  48. [AjaxOnly]
  49. public ActionResult GetPageList(string pagination, string queryJson)
  50. {
  51. Pagination paginationobj = pagination.ToObject<Pagination>();
  52. var data = scholarshipTranIBLL.GetPageList(paginationobj, queryJson);
  53. var jsonData = new
  54. {
  55. rows = data,
  56. total = paginationobj.total,
  57. page = paginationobj.page,
  58. records = paginationobj.records
  59. };
  60. return Success(jsonData);
  61. }
  62. /// <summary>
  63. /// 获取表单数据
  64. /// </summary>
  65. /// <param name="keyValue">主键</param>
  66. /// <returns></returns>
  67. [HttpGet]
  68. [AjaxOnly]
  69. public ActionResult GetFormData(string keyValue)
  70. {
  71. var ScholarshipData = scholarshipTranIBLL.GetScholarshipTranEntity(keyValue);
  72. var jsonData = new
  73. {
  74. Scholarship = ScholarshipData,
  75. };
  76. return Success(jsonData);
  77. }
  78. /// <summary>
  79. /// 获取页面显示列表数据
  80. /// </summary>
  81. /// <param name="queryJson">查询参数</param>
  82. /// <returns></returns>
  83. [HttpGet]
  84. [AjaxOnly]
  85. public ActionResult GetList(string queryJson)
  86. {
  87. var data = scholarshipTranIBLL.GetList(queryJson);
  88. return Success(data);
  89. }
  90. #endregion
  91. #region 提交数据
  92. /// <summary>
  93. /// 删除实体数据
  94. /// </summary>
  95. /// <param name="keyValue">主键</param>
  96. /// <returns></returns>
  97. [HttpPost]
  98. [AjaxOnly]
  99. public ActionResult DeleteForm(string keyValue)
  100. {
  101. scholarshipTranIBLL.DeleteEntity(keyValue);
  102. return Success("删除成功!");
  103. }
  104. /// <summary>
  105. /// 保存实体数据(新增、修改)
  106. /// </summary>
  107. /// <param name="keyValue">主键</param>
  108. /// <param name="strEntity">实体</param>
  109. /// <returns></returns>
  110. [HttpPost]
  111. [ValidateAntiForgeryToken]
  112. [AjaxOnly]
  113. public ActionResult SaveForm(string keyValue, string strEntity)
  114. {
  115. var LogUserinfo = LoginUserInfo.Get();
  116. ScholarshipTranEntity entity = strEntity.ToObject<ScholarshipTranEntity>();
  117. if (string.IsNullOrEmpty(keyValue))
  118. {
  119. entity.State = "0";
  120. }
  121. if (entity.State != "0")
  122. {
  123. entity.AuditPeople = LogUserinfo.userId;
  124. entity.AuditTime = DateTime.Today;
  125. }
  126. scholarshipTranIBLL.SaveEntity(keyValue, entity);
  127. return Success("保存成功!");
  128. }
  129. #endregion
  130. #region 扩展数据
  131. #endregion
  132. }
  133. }