123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- using LeaRun.Application.Busines.PublicInfoManage;
- using LeaRun.Application.Code;
- using LeaRun.Application.Entity.PublicInfoManage;
- using LeaRun.Util;
- using LeaRun.Util.WebControl;
- using System.Web.Mvc;
- namespace LeaRun.Application.Web.Areas.PublicInfoManage.Controllers
- {
- /// <summary>
- /// 版 本 6.1
- /// Copyright (c) 2013-2016 上海力软信息技术有限公司
- /// 创建人:佘赐雄
- /// 日 期:2015.12.7 16:40
- /// 描 述:电子公告
- /// </summary>
- public class NoticeController : MvcControllerBase
- {
- private NoticeBLL noticeBLL = new NoticeBLL();
- #region 视图功能
- /// <summary>
- /// 公告管理
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- [HandlerAuthorize(PermissionMode.Enforce)]
- public ActionResult Index()
- {
- return View();
- }
- /// <summary>
- /// 公告表单
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- [HandlerAuthorize(PermissionMode.Enforce)]
- public ActionResult Form()
- {
- return View();
- }
- #endregion
- #region 获取数据
- /// <summary>
- /// 公告列表
- /// </summary>
- /// <param name="pagination">分页参数</param>
- /// <param name="queryJson">查询参数</param>
- /// <returns>返回分页列表Json</returns>
- [HttpGet]
- public ActionResult GetPageListJson(Pagination pagination, string queryJson)
- {
- var watch = CommonHelper.TimerStart();
- var data = noticeBLL.GetPageList(pagination, queryJson);
- var JsonData = new
- {
- rows = data,
- total = pagination.total,
- page = pagination.page,
- records = pagination.records,
- costtime = CommonHelper.TimerEnd(watch)
- };
- return Content(JsonData.ToJson());
- }
- /// <summary>
- /// 公告实体
- /// </summary>
- /// <param name="keyValue">主键值</param>
- /// <returns>返回对象Json</returns>
- [HttpGet]
- public ActionResult GetFormJson(string keyValue)
- {
- var data = noticeBLL.GetEntity(keyValue);
- return ToJsonResult(data);
- }
- #endregion
- #region 提交数据
- /// <summary>
- /// 删除公告
- /// </summary>
- /// <param name="keyValue">主键值</param>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- [HandlerAuthorize(PermissionMode.Enforce)]
- public ActionResult RemoveForm(string keyValue)
- {
- noticeBLL.RemoveForm(keyValue);
- return Success("删除成功。");
- }
- /// <summary>
- /// 保存公告表单(新增、修改)
- /// </summary>
- /// <param name="keyValue">主键值</param>
- /// <param name="newsEntity">公告实体</param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- [ValidateInput(false)]
- public ActionResult SaveForm(string keyValue, NewsEntity newsEntity)
- {
- noticeBLL.SaveForm(keyValue, newsEntity);
- return Success("操作成功。");
- }
- #endregion
- }
- }
|