|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- using Learun.Application.Excel;
- using System.Collections.Generic;
- using System.Web.Mvc;
- using Learun.Util;
-
- namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers
- {
- /// <summary>
- /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
- /// Copyright (c) 2013-2018 北京泉江科技有限公司
- /// 创建人:陈彬彬
- /// 日 期:2017.04.01
- /// 描 述:Excel导出管理
- /// </summary>
- public class ExcelExportController : MvcControllerBase
- {
- private ExcelExportIBLL excelExportIBLL = new ExcelExportBLL();
-
- #region 视图功能
- [HttpGet]
- public ActionResult Index()
- {
- return View();
- }
- [HttpGet]
- public ActionResult Form()
- {
- return View();
- }
- #endregion
-
- #region 获取数据
- /// <summary>
- /// 获取分页数据
- /// </summary>
- /// <param name="pagination">分页参数</param>
- /// <param name="queryJson">查询参数</param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetPageList(string pagination, string queryJson)
- {
- Pagination paginationobj = pagination.ToObject<Pagination>();
- var data = excelExportIBLL.GetPageList(paginationobj, queryJson);
- var jsonData = new
- {
- rows = data,
- total = paginationobj.total,
- page = paginationobj.page,
- records = paginationobj.records,
- };
- return JsonResult(jsonData);
- }
- /// <summary>
- /// 获取列表数据
- /// </summary>
- /// <param name="moduleId">功能模块主键</param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetList(string moduleId)
- {
- var data = excelExportIBLL.GetList(moduleId);
- return JsonResult(data);
- }
- /// <summary>
- /// 获取表单数据
- /// <param name="keyValue">主键</param>
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetEntity(string keyValue)
- {
- var data = excelExportIBLL.GetEntity(keyValue);
- 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, ExcelExportEntity entity)
- {
- excelExportIBLL.SaveEntity(keyValue, entity);
- return Success("保存成功!");
- }
- /// <summary>
- /// 删除表单数据
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult DeleteForm(string keyValue)
- {
- excelExportIBLL.DeleteEntity(keyValue);
- return Success("删除成功!");
- }
- /// <summary>
- /// 更新表单数据
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <param name="entity">实体数据</param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult UpdateState(string keyValue, int state)
- {
- ExcelExportEntity entity = new ExcelExportEntity()
- {
- F_EnabledMark = state
- };
- excelExportIBLL.SaveEntity(keyValue, entity);
- return Success("操作成功!");
- }
- #endregion
- }
- }
|