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
{
///
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创建人:zl
/// 日 期:2021.05.20
/// 描 述:失物招领管理
///
public class LostArticleInfoController : MvcControllerBase
{
private LostArticleInfoIBLL lostArticleInfoIBLL = new LostArticleInfoBLL();
#region 视图功能
///
/// 页面
///
///
[HttpGet]
public ActionResult Index()
{
return View();
}
///
/// 表单页面
///
///
[HttpGet]
public ActionResult Form()
{
return View();
}
///
/// 失物招领表单
///
///
[HttpGet]
public ActionResult FormView()
{
return View();
}
///
/// 认领
///
///
[HttpGet]
public ActionResult FormClaim()
{
return View();
}
#endregion
#region 获取数据
///
/// 获取分页数据
///
/// 分页参数
/// 关键词
///
public ActionResult GetPageList(string pagination, string keyword)
{
Pagination paginationobj = pagination.ToObject();
var data = lostArticleInfoIBLL.GetPageList(paginationobj, keyword);
var jsonData = new
{
rows = data,
total = paginationobj.total,
page = paginationobj.page,
records = paginationobj.records,
};
return JsonResult(jsonData);
}
///
/// 获取实体数据
///
/// 主键
///
public ActionResult GetEntity(string keyValue)
{
var data = lostArticleInfoIBLL.GetLostArticleInfoEntity(keyValue);
data.F_Content = WebHelper.HtmlDecode(data.F_Content);
return JsonResult(data);
}
#endregion
#region 提交数据
///
/// 保存表单数据
///
/// 主键
/// 实体
///
[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("保存成功!");
}
///
/// 删除表单数据
///
/// 主键
///
[HttpPost]
[AjaxOnly]
public ActionResult DeleteForm(string keyValue)
{
lostArticleInfoIBLL.DeleteEntity(keyValue);
return Success("删除成功!");
}
///
/// 发布
///
/// 主键
///
[HttpPost]
[AjaxOnly]
public ActionResult PublishForm(string keyValue)
{
lostArticleInfoIBLL.PublishForm(keyValue);
return Success("发布成功!");
}
///
/// 认领
///
/// 主键
///
[HttpPost]
[AjaxOnly]
public ActionResult ClaimForm(string keyValue, LostArticleInfoEntity entity)
{
lostArticleInfoIBLL.ClaimForm(keyValue, entity);
return Success("认领成功!");
}
///
/// 撤下
///
/// 主键
///
[HttpPost]
[AjaxOnly]
public ActionResult CancleForm(string keyValue)
{
lostArticleInfoIBLL.CancleForm(keyValue);
return Success("已撤下!");
}
#endregion
}
}