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.
 
 
 
 
 
 

178 lines
5.2 KiB

  1. using System;
  2. using Learun.Util;
  3. using System.Data;
  4. using Learun.Application.TwoDevelopment.EducationalAdministration;
  5. using System.Web.Mvc;
  6. using System.Collections.Generic;
  7. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  8. {
  9. /// <summary>
  10. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  11. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  12. /// 创 建:超级管理员
  13. /// 日 期:2022-05-09 11:23
  14. /// 描 述:心理咨询
  15. /// </summary>
  16. public class Sys_PsychologicalCounseController : MvcControllerBase
  17. {
  18. private Sys_PsychologicalCounseIBLL sys_PsychologicalCounseIBLL = new Sys_PsychologicalCounseBLL();
  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. ViewBag.Code = "XLZX_" + CommonHelper.CreateNo();
  37. return View();
  38. }
  39. [HttpGet]
  40. public ActionResult FormView()
  41. {
  42. return View();
  43. }
  44. [HttpGet]
  45. public ActionResult IndexRecive()
  46. {
  47. return View();
  48. }
  49. [HttpGet]
  50. public ActionResult FormReceive()
  51. {
  52. return View();
  53. }
  54. [HttpGet]
  55. public ActionResult FormViewReceive()
  56. {
  57. return View();
  58. }
  59. [HttpGet]
  60. public ActionResult FormViewReceiveData()
  61. {
  62. return View();
  63. }
  64. #endregion
  65. #region 获取数据
  66. /// <summary>
  67. /// 获取页面显示列表数据
  68. /// </summary>
  69. /// <param name="pagination">分页参数</param>
  70. /// <param name="queryJson">查询参数</param>
  71. /// <returns></returns>
  72. [HttpGet]
  73. [AjaxOnly]
  74. public ActionResult GetPageList(string pagination, string queryJson)
  75. {
  76. Pagination paginationobj = pagination.ToObject<Pagination>();
  77. var data = sys_PsychologicalCounseIBLL.GetPageList(paginationobj, queryJson);
  78. var jsonData = new
  79. {
  80. rows = data,
  81. total = paginationobj.total,
  82. page = paginationobj.page,
  83. records = paginationobj.records
  84. };
  85. return Success(jsonData);
  86. }
  87. /// <summary>
  88. /// 获取表单数据
  89. /// </summary>
  90. /// <param name="keyValue">主键</param>
  91. /// <returns></returns>
  92. [HttpGet]
  93. [AjaxOnly]
  94. public ActionResult GetFormData(string keyValue)
  95. {
  96. var Sys_PsychologicalCounseData = sys_PsychologicalCounseIBLL.GetSys_PsychologicalCounseEntity(keyValue);
  97. var jsonData = new
  98. {
  99. Sys_PsychologicalCounse = Sys_PsychologicalCounseData,
  100. };
  101. return Success(jsonData);
  102. }
  103. #endregion
  104. #region 提交数据
  105. /// <summary>
  106. /// 删除实体数据
  107. /// </summary>
  108. /// <param name="keyValue">主键</param>
  109. /// <returns></returns>
  110. [HttpPost]
  111. [AjaxOnly]
  112. public ActionResult DeleteForm(string keyValue)
  113. {
  114. sys_PsychologicalCounseIBLL.DeleteEntity(keyValue);
  115. return Success("删除成功!");
  116. }
  117. /// <summary>
  118. /// 提交
  119. /// </summary>
  120. /// <param name="keyValue"></param>
  121. /// <returns></returns>
  122. [HttpPost]
  123. [AjaxOnly]
  124. public ActionResult SubmitForm(string keyValue)
  125. {
  126. sys_PsychologicalCounseIBLL.SubmitForm(keyValue);
  127. return Success("提交成功!");
  128. }
  129. /// <summary>
  130. /// 保存实体数据(新增、修改)
  131. /// </summary>
  132. /// <param name="keyValue">主键</param>
  133. /// <param name="strEntity">实体</param>
  134. /// <returns></returns>
  135. [HttpPost]
  136. [ValidateAntiForgeryToken]
  137. [AjaxOnly]
  138. public ActionResult SaveForm(string keyValue, string strEntity)
  139. {
  140. Sys_PsychologicalCounseEntity entity = strEntity.ToObject<Sys_PsychologicalCounseEntity>();
  141. sys_PsychologicalCounseIBLL.SaveEntity(keyValue, entity);
  142. return Success("保存成功!");
  143. }
  144. /// <summary>
  145. /// 心理咨询回复
  146. /// </summary>
  147. /// <param name="keyValue">主键</param>
  148. /// <param name="strEntity">实体</param>
  149. /// <returns></returns>
  150. [HttpPost]
  151. [ValidateAntiForgeryToken]
  152. [AjaxOnly]
  153. public ActionResult SaveReceiveForm(string keyValue, string strEntity)
  154. {
  155. Sys_PsychologicalCounseEntity entity = strEntity.ToObject<Sys_PsychologicalCounseEntity>();
  156. entity.ReplyFlag = true;
  157. entity.ReplyTime = DateTime.Now;
  158. entity.ReplyUserId = LoginUserInfo.Get().userId;
  159. sys_PsychologicalCounseIBLL.SaveEntity(keyValue, entity);
  160. return Success("保存成功!");
  161. }
  162. #endregion
  163. }
  164. }