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.

LostArticleInfoController.cs 5.2 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. using Learun.Application.OA;
  2. using Learun.Util;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Configuration;
  6. using System.Linq;
  7. using System.Threading.Tasks;
  8. using System.Web;
  9. using System.Web.Mvc;
  10. using Learun.Application.Base.AuthorizeModule;
  11. using Learun.Application.Base.SystemModule;
  12. using Learun.Application.Organization;
  13. using Learun.Application.TwoDevelopment.LR_Desktop;
  14. using Learun.Util.Operat;
  15. using Microsoft.AspNet.SignalR.Client;
  16. using Microsoft.Owin.Logging;
  17. using Newtonsoft.Json;
  18. using Learun.Application.TwoDevelopment.EducationalAdministration;
  19. using Learun.Application.TwoDevelopment.Permission;
  20. namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
  21. {
  22. /// <summary>
  23. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  24. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  25. /// 创建人:zl
  26. /// 日 期:2021.05.20
  27. /// 描 述:失物招领管理
  28. /// </summary>
  29. public class LostArticleInfoController : MvcControllerBase
  30. {
  31. private LostArticleInfoIBLL lostArticleInfoIBLL = new LostArticleInfoBLL();
  32. #region 视图功能
  33. /// <summary>
  34. /// 页面
  35. /// </summary>
  36. /// <returns></returns>
  37. [HttpGet]
  38. public ActionResult Index()
  39. {
  40. return View();
  41. }
  42. /// <summary>
  43. /// 表单页面
  44. /// </summary>
  45. /// <returns></returns>
  46. [HttpGet]
  47. public ActionResult Form()
  48. {
  49. return View();
  50. }
  51. /// <summary>
  52. /// 失物招领表单
  53. /// </summary>
  54. /// <returns></returns>
  55. [HttpGet]
  56. public ActionResult FormView()
  57. {
  58. return View();
  59. }
  60. /// <summary>
  61. /// 认领
  62. /// </summary>
  63. /// <returns></returns>
  64. [HttpGet]
  65. public ActionResult FormClaim()
  66. {
  67. return View();
  68. }
  69. #endregion
  70. #region 获取数据
  71. /// <summary>
  72. /// 获取分页数据
  73. /// </summary>
  74. /// <param name="pagination">分页参数</param>
  75. /// <param name="keyword">关键词</param>
  76. /// <returns></returns>
  77. public ActionResult GetPageList(string pagination, string keyword)
  78. {
  79. Pagination paginationobj = pagination.ToObject<Pagination>();
  80. var data = lostArticleInfoIBLL.GetPageList(paginationobj, keyword);
  81. var jsonData = new
  82. {
  83. rows = data,
  84. total = paginationobj.total,
  85. page = paginationobj.page,
  86. records = paginationobj.records,
  87. };
  88. return JsonResult(jsonData);
  89. }
  90. /// <summary>
  91. /// 获取实体数据
  92. /// </summary>
  93. /// <param name="keyValue">主键</param>
  94. /// <returns></returns>
  95. public ActionResult GetEntity(string keyValue)
  96. {
  97. var data = lostArticleInfoIBLL.GetLostArticleInfoEntity(keyValue);
  98. data.F_Content = WebHelper.HtmlDecode(data.F_Content);
  99. return JsonResult(data);
  100. }
  101. #endregion
  102. #region 提交数据
  103. /// <summary>
  104. /// 保存表单数据
  105. /// </summary>
  106. /// <param name="keyValue">主键</param>
  107. /// <param name="entity">实体</param>
  108. /// <returns></returns>
  109. [HttpPost, ValidateAntiForgeryToken, AjaxOnly]
  110. public ActionResult SaveForm(string keyValue, LostArticleInfoEntity entity)
  111. {
  112. entity.F_Content = WebHelper.HtmlEncode(entity.F_Content);
  113. entity.F_State = 0;
  114. lostArticleInfoIBLL.SaveEntity(keyValue, entity);
  115. return Success("保存成功!");
  116. }
  117. /// <summary>
  118. /// 删除表单数据
  119. /// </summary>
  120. /// <param name="keyValue">主键</param>
  121. /// <returns></returns>
  122. [HttpPost]
  123. [AjaxOnly]
  124. public ActionResult DeleteForm(string keyValue)
  125. {
  126. lostArticleInfoIBLL.DeleteEntity(keyValue);
  127. return Success("删除成功!");
  128. }
  129. /// <summary>
  130. /// 发布
  131. /// </summary>
  132. /// <param name="keyValue">主键</param>
  133. /// <returns></returns>
  134. [HttpPost]
  135. [AjaxOnly]
  136. public ActionResult PublishForm(string keyValue)
  137. {
  138. lostArticleInfoIBLL.PublishForm(keyValue);
  139. return Success("发布成功!");
  140. }
  141. /// <summary>
  142. /// 认领
  143. /// </summary>
  144. /// <param name="keyValue">主键</param>
  145. /// <returns></returns>
  146. [HttpPost]
  147. [AjaxOnly]
  148. public ActionResult ClaimForm(string keyValue, LostArticleInfoEntity entity)
  149. {
  150. lostArticleInfoIBLL.ClaimForm(keyValue, entity);
  151. return Success("认领成功!");
  152. }
  153. /// <summary>
  154. /// 撤下
  155. /// </summary>
  156. /// <param name="keyValue">主键</param>
  157. /// <returns></returns>
  158. [HttpPost]
  159. [AjaxOnly]
  160. public ActionResult CancleForm(string keyValue)
  161. {
  162. lostArticleInfoIBLL.CancleForm(keyValue);
  163. return Success("已撤下!");
  164. }
  165. #endregion
  166. }
  167. }