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.

PsychologyInfoController.cs 4.5 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. using Learun.Application.TwoDevelopment.EducationalAdministration;
  2. using Learun.Util;
  3. using System.Data;
  4. using System.Web.Mvc;
  5. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  6. {
  7. /// <summary>
  8. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  9. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  10. /// 创 建:超级管理员
  11. /// 日 期:2023-03-06 12:18
  12. /// 描 述:心里预约功能
  13. /// </summary>
  14. public class PsychologyInfoController : MvcControllerBase
  15. {
  16. private PsychologyInfoIBLL psychologyInfoIBLL = new PsychologyInfoBLL();
  17. #region 视图功能
  18. /// <summary>
  19. /// 主页面
  20. /// </summary>
  21. /// <returns></returns>
  22. [HttpGet]
  23. public ActionResult Index()
  24. {
  25. return View();
  26. }
  27. /// <summary>
  28. /// 表单页
  29. /// </summary>
  30. /// <returns></returns>
  31. [HttpGet]
  32. public ActionResult Form()
  33. {
  34. return View();
  35. }
  36. /// <summary>
  37. /// 表单页
  38. /// </summary>
  39. /// <returns></returns>
  40. [HttpGet]
  41. public ActionResult FormView()
  42. {
  43. return View();
  44. }
  45. #endregion
  46. #region 获取数据
  47. /// <summary>
  48. /// 获取列表数据
  49. /// </summary>
  50. /// <param name="queryJson">查询参数</param>
  51. /// <returns></returns>
  52. [HttpGet]
  53. [AjaxOnly]
  54. public ActionResult GetList(string queryJson)
  55. {
  56. var data = psychologyInfoIBLL.GetList(queryJson);
  57. return Success(data);
  58. }
  59. /// <summary>
  60. /// 获取列表分页数据
  61. /// </summary>
  62. /// <param name="pagination">分页参数</param>
  63. /// <param name="queryJson">查询参数</param>
  64. /// <returns></returns>
  65. [HttpGet]
  66. [AjaxOnly]
  67. public ActionResult GetPageList(string pagination, string queryJson)
  68. {
  69. Pagination paginationobj = pagination.ToObject<Pagination>();
  70. var data = psychologyInfoIBLL.GetPageList(paginationobj, queryJson);
  71. var jsonData = new
  72. {
  73. rows = data,
  74. total = paginationobj.total,
  75. page = paginationobj.page,
  76. records = paginationobj.records
  77. };
  78. return Success(jsonData);
  79. }
  80. /// <summary>
  81. /// 获取表单数据
  82. /// </summary>
  83. /// <param name="keyValue">主键</param>
  84. /// <returns></returns>
  85. [HttpGet]
  86. [AjaxOnly]
  87. public ActionResult GetFormData(string keyValue)
  88. {
  89. var data = psychologyInfoIBLL.GetEntity(keyValue);
  90. return Success(data);
  91. }
  92. /// <summary>
  93. /// 获取表单数据
  94. /// </summary>
  95. /// <param name="keyValue">主键</param>
  96. /// <returns></returns>
  97. [HttpGet]
  98. [AjaxOnly]
  99. public ActionResult GetFormViewData(string keyValue)
  100. {
  101. var data = psychologyInfoIBLL.GetEntityForView(keyValue);
  102. return Success(data);
  103. }
  104. #endregion
  105. #region 提交数据
  106. /// <summary>
  107. /// 删除实体数据
  108. /// </summary>
  109. /// <param name="keyValue">主键</param>
  110. /// <returns></returns>
  111. [HttpPost]
  112. [AjaxOnly]
  113. public ActionResult DeleteForm(string keyValue)
  114. {
  115. psychologyInfoIBLL.DeleteEntity(keyValue);
  116. return Success("删除成功!");
  117. }
  118. /// <summary>
  119. /// 保存实体数据(新增、修改)
  120. /// </summary>
  121. /// <param name="keyValue">主键</param>
  122. /// <param name="entity">实体</param>
  123. /// <returns></returns>
  124. [HttpPost]
  125. [ValidateAntiForgeryToken]
  126. [AjaxOnly]
  127. public ActionResult SaveForm(string keyValue, string strEntity)
  128. {
  129. var entity = strEntity.ToObject<PsychologyInfoEntity>();
  130. psychologyInfoIBLL.SaveEntity(keyValue, entity);
  131. return Success("保存成功!");
  132. }
  133. /// <summary>
  134. /// 提交实体数据
  135. /// </summary>
  136. /// <param name="keyValue">主键</param>
  137. /// <returns></returns>
  138. [HttpPost]
  139. [AjaxOnly]
  140. public ActionResult SubmitForm(string keyValue)
  141. {
  142. psychologyInfoIBLL.SubmitEntity(keyValue);
  143. return Success("提交成功!");
  144. }
  145. #endregion
  146. }
  147. }