|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- using Learun.Application.OA;
- using Learun.Util;
- using System;
- using System.Collections.Generic;
- using System.Configuration;
- using System.Linq;
- using System.Threading.Tasks;
- using System.Web;
- using System.Web.Mvc;
- using Learun.Application.Base.AuthorizeModule;
- using Learun.Application.Base.SystemModule;
- using Learun.Application.Organization;
- using Learun.Application.TwoDevelopment.LR_Desktop;
- using Learun.Util.Operat;
- using Microsoft.AspNet.SignalR.Client;
- using Microsoft.Owin.Logging;
- using Newtonsoft.Json;
- using Learun.Application.TwoDevelopment.EducationalAdministration;
- using Learun.Application.TwoDevelopment.Permission;
-
- namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
- {
- /// <summary>
- /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
- /// Copyright (c) 2013-2018 北京泉江科技有限公司
- /// 创建人:zl
- /// 日 期:2021.05.20
- /// 描 述:失物招领管理
- /// </summary>
- public class LostArticleInfoController : MvcControllerBase
- {
- private LostArticleInfoIBLL lostArticleInfoIBLL = new LostArticleInfoBLL();
-
- #region 视图功能
- /// <summary>
- /// 页面
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Index()
- {
- return View();
- }
- /// <summary>
- /// 表单页面
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Form()
- {
- return View();
- }
- /// <summary>
- /// 失物招领表单
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult FormView()
- {
- return View();
- }
-
- /// <summary>
- /// 认领
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult FormClaim()
- {
- return View();
- }
-
- #endregion
-
- #region 获取数据
- /// <summary>
- /// 获取分页数据
- /// </summary>
- /// <param name="pagination">分页参数</param>
- /// <param name="keyword">关键词</param>
- /// <returns></returns>
- public ActionResult GetPageList(string pagination, string keyword)
- {
- Pagination paginationobj = pagination.ToObject<Pagination>();
- var data = lostArticleInfoIBLL.GetPageList(paginationobj, keyword);
- var jsonData = new
- {
- rows = data,
- total = paginationobj.total,
- page = paginationobj.page,
- records = paginationobj.records,
- };
- return JsonResult(jsonData);
- }
- /// <summary>
- /// 获取实体数据
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <returns></returns>
- public ActionResult GetEntity(string keyValue)
- {
- var data = lostArticleInfoIBLL.GetLostArticleInfoEntity(keyValue);
- data.F_Content = WebHelper.HtmlDecode(data.F_Content);
- return JsonResult(data);
- }
-
- #endregion
-
- #region 提交数据
-
- /// <summary>
- /// 保存表单数据
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <param name="entity">实体</param>
- /// <returns></returns>
- [HttpPost, ValidateAntiForgeryToken, AjaxOnly]
- public ActionResult SaveForm(string keyValue, LostArticleInfoEntity entity)
- {
- entity.F_Content = WebHelper.HtmlEncode(entity.F_Content);
- entity.F_State = 0;
- lostArticleInfoIBLL.SaveEntity(keyValue, entity);
- return Success("保存成功!");
- }
-
- /// <summary>
- /// 删除表单数据
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult DeleteForm(string keyValue)
- {
- lostArticleInfoIBLL.DeleteEntity(keyValue);
- return Success("删除成功!");
- }
-
- /// <summary>
- /// 发布
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult PublishForm(string keyValue)
- {
- lostArticleInfoIBLL.PublishForm(keyValue);
- return Success("发布成功!");
- }
- /// <summary>
- /// 认领
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult ClaimForm(string keyValue, LostArticleInfoEntity entity)
- {
- lostArticleInfoIBLL.ClaimForm(keyValue, entity);
- return Success("认领成功!");
- }
- /// <summary>
- /// 撤下
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult CancleForm(string keyValue)
- {
- lostArticleInfoIBLL.CancleForm(keyValue);
- return Success("已撤下!");
- }
- #endregion
-
- }
- }
|