123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- using Lottomat.Application.Busines.BaseManage;
- using Lottomat.Application.Cache;
- using Lottomat.Application.Code;
- using Lottomat.Application.Entity.BaseManage;
- using Lottomat.Util;
- using Lottomat.Util.WebControl;
- using System.Web.Mvc;
- using Lottomat.Util.Extension;
- namespace Lottomat.Application.Admin.Areas.BaseManage.Controllers
- {
- /// <summary>
- /// 版 本
- /// Copyright (c) 2016-2017
- /// 创建人:赵轶
- /// 日 期:2015.11.4 14:31
- /// 描 述:职位管理
- /// </summary>
- public class JobController : MvcControllerBase
- {
- private JobBLL jobBLL = new JobBLL();
- private JobCache jobCache = new JobCache();
- #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 = jobBLL.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="organizeId">机构Id</param>
- /// <returns>返回列表Json</returns>
- [HttpGet]
- public ActionResult GetListJson(string organizeId)
- {
- var data = jobCache.GetList(organizeId);
- return Content(data.ToJson());
- }
- /// <summary>
- /// 职位实体
- /// </summary>
- /// <param name="keyValue">主键值</param>
- /// <returns>返回对象Json</returns>
- [HttpGet]
- public ActionResult GetFormJson(string keyValue)
- {
- var data = jobBLL.GetEntity(keyValue);
- return Content(data.ToJson());
- }
- #endregion
- #region 验证数据
- /// <summary>
- /// 职位编号不能重复
- /// </summary>
- /// <param name="enCode">编号</param>
- /// <param name="keyValue">主键</param>
- /// <returns></returns>
- [HttpGet]
- public ActionResult ExistEnCode(string enCode, string keyValue)
- {
- bool IsOk = jobBLL.ExistEnCode(enCode, keyValue);
- return Content(IsOk.ToString());
- }
- /// <summary>
- /// 职位名称不能重复
- /// </summary>
- /// <param name="FullName">名称</param>
- /// <param name="keyValue">主键</param>
- /// <returns></returns>
- [HttpGet]
- public ActionResult ExistFullName(string FullName, string keyValue)
- {
- bool IsOk = jobBLL.ExistFullName(FullName, keyValue);
- return Content(IsOk.ToString());
- }
- #endregion
- #region 提交数据
- /// <summary>
- /// 删除职位
- /// </summary>
- /// <param name="keyValue">主键值</param>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- [HandlerAuthorize(PermissionMode.Enforce)]
- public ActionResult RemoveForm(string keyValue)
- {
- jobBLL.RemoveForm(keyValue);
- return Success("删除成功。");
- }
- /// <summary>
- /// 保存职位表单(新增、修改)
- /// </summary>
- /// <param name="keyValue">主键值</param>
- /// <param name="jobEntity">职位实体</param>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- public ActionResult SaveForm(string keyValue, RoleEntity jobEntity)
- {
- jobBLL.SaveForm(keyValue, jobEntity);
- return Success("操作成功。");
- }
- #endregion
- }
- }
|