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.
 
 
 
 
 
 

154 lines
4.7 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. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  7. {
  8. /// <summary>
  9. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  10. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  11. /// 创 建:超级管理员
  12. /// 日 期:2022-03-01 17:26
  13. /// 描 述:教材征订管理
  14. /// </summary>
  15. public class TextBookSolSubController : MvcControllerBase
  16. {
  17. private TextBookSolSubIBLL textBookSolSubIBLL = new TextBookSolSubBLL();
  18. private TextBookSolSubDetailIBLL textBookSolSubDetailIBLL = new TextBookSolSubDetailBLL();
  19. #region 视图功能
  20. /// <summary>
  21. /// 主页面
  22. /// <summary>
  23. /// <returns></returns>
  24. [HttpGet]
  25. public ActionResult Index()
  26. {
  27. return View();
  28. }
  29. /// <summary>
  30. /// 表单页
  31. /// <summary>
  32. /// <returns></returns>
  33. [HttpGet]
  34. public ActionResult Form()
  35. {
  36. return View();
  37. }
  38. /// <summary>
  39. /// 表单页
  40. /// <summary>
  41. /// <returns></returns>
  42. [HttpGet]
  43. public ActionResult StatisticsIndex()
  44. {
  45. return View();
  46. }
  47. #endregion
  48. #region 获取数据
  49. /// <summary>
  50. /// 获取页面显示列表数据
  51. /// </summary>
  52. /// <param name="pagination">分页参数</param>
  53. /// <param name="queryJson">查询参数</param>
  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 = textBookSolSubIBLL.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. /// </summary>
  73. /// <param name="keyValue">主键</param>
  74. /// <returns></returns>
  75. [HttpGet]
  76. [AjaxOnly]
  77. public ActionResult GetFormData(string keyValue)
  78. {
  79. var TextBookSolSubData = textBookSolSubIBLL.GetTextBookSolSubEntity(keyValue);
  80. var textBookSolSubDetailData = textBookSolSubDetailIBLL.GetListBySolSubId(TextBookSolSubData.ID);
  81. var jsonData = new
  82. {
  83. TextBookSolSub = TextBookSolSubData,
  84. TextBookSolSubDetail = textBookSolSubDetailData
  85. };
  86. return Success(jsonData);
  87. }
  88. /// <summary>
  89. /// 获取页面显示列表数据
  90. /// </summary>
  91. /// <param name="pagination">分页参数</param>
  92. /// <param name="queryJson">查询参数</param>
  93. /// <returns></returns>
  94. [HttpGet]
  95. [AjaxOnly]
  96. public ActionResult GetStatistics(string pagination, string queryJson)
  97. {
  98. Pagination paginationobj = pagination.ToObject<Pagination>();
  99. var data = textBookSolSubIBLL.GetStatistics(paginationobj, queryJson);
  100. var jsonData = new
  101. {
  102. rows = data,
  103. total = paginationobj.total,
  104. page = paginationobj.page,
  105. records = paginationobj.records
  106. };
  107. return Success(jsonData);
  108. }
  109. #endregion
  110. #region 提交数据
  111. /// <summary>
  112. /// 删除实体数据
  113. /// </summary>
  114. /// <param name="keyValue">主键</param>
  115. /// <returns></returns>
  116. [HttpPost]
  117. [AjaxOnly]
  118. public ActionResult DeleteForm(string keyValue)
  119. {
  120. textBookSolSubIBLL.DeleteEntity(keyValue);
  121. return Success("删除成功!");
  122. }
  123. /// <summary>
  124. /// 保存实体数据(新增、修改)
  125. /// </summary>
  126. /// <param name="keyValue">主键</param>
  127. /// <param name="strEntity">实体</param>
  128. /// <returns></returns>
  129. [HttpPost]
  130. [ValidateAntiForgeryToken]
  131. [AjaxOnly]
  132. public ActionResult SaveForm(string keyValue, string strEntity)
  133. {
  134. TextBookSolSubEntity entity = strEntity.ToObject<TextBookSolSubEntity>();
  135. textBookSolSubIBLL.SaveEntity(keyValue, entity);
  136. if (string.IsNullOrEmpty(keyValue))
  137. {
  138. }
  139. return Success("保存成功!");
  140. }
  141. #endregion
  142. }
  143. }