|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- using Learun.Application.AppMagager;
- using Learun.Util;
- using System.Web.Mvc;
-
- namespace Learun.Application.Web.Areas.AppManager.Controllers
- {
- /// <summary>
- /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
- /// Copyright (c) 2013-2018 北京泉江科技有限公司
- /// 创建人:陈彬彬
- /// 日 期:2017.04.17
- /// 描 述:移动功能管理
- /// </summary>
- public class FunctionManagerController : MvcControllerBase
- {
- private FunctionIBLL functionIBLL = new FunctionBLL();
-
-
- #region 视图功能
- /// <summary>
- /// 管理页面
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Index()
- {
- return View();
- }
- /// <summary>
- /// 表单页面
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Form()
- {
- return View();
- }
- #endregion
-
- #region 获取数据
- /// <summary>
- /// 获取分页数据
- /// </summary>
- /// <param name="pagination">分页参数</param>
- /// <param name="keyword">关键字</param>
- /// <param name="type">类型</param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetPageList(string pagination, string keyword, string type)
- {
- Pagination paginationobj = pagination.ToObject<Pagination>();
- var data = functionIBLL.GetPageList(paginationobj, keyword, type);
- 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>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetForm(string keyValue) {
-
- FunctionEntity entity = functionIBLL.GetEntity(keyValue);
- FunctionSchemeEntity schemeEntity = functionIBLL.GetScheme(entity.F_SchemeId);
-
- var jsonData = new {
- entity= entity,
- schemeEntity= schemeEntity
- };
- return JsonResult(jsonData);
- }
-
- /// <summary>
- /// 获取树形移动功能列表
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetCheckTree()
- {
- var data = functionIBLL.GetCheckTree();
- return JsonResult(data);
- }
-
- #endregion
-
- #region 提交数据
-
- /// <summary>
- /// 删除表单数据
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult DeleteForm(string keyValue)
- {
- functionIBLL.Delete(keyValue);
- return Success("删除成功!");
- }
- /// <summary>
- /// 保存表单数据
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <param name="strEntity">实体对象字串</param>
- /// <param name="strSchemeEntity">模板实体对象字串</param>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- public ActionResult SaveForm(string keyValue, string strEntity, string strSchemeEntity)
- {
- FunctionEntity entity = strEntity.ToObject<FunctionEntity>();
- FunctionSchemeEntity schemeEntity = strSchemeEntity.ToObject<FunctionSchemeEntity>();
- functionIBLL.SaveEntity(keyValue, entity, schemeEntity);
- return Success("保存成功!");
- }
-
- /// <summary>
- /// 启用/停用表单
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <param name="state">状态1启用0禁用</param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult UpDateSate(string keyValue, int state)
- {
- functionIBLL.UpdateState(keyValue, state);
- return Success((state == 1 ? "启用" : "禁用") + "成功!");
- }
- #endregion
- }
- }
|