using Learun.Application.Base.SystemModule; using Learun.Util; using System.Web.Mvc; namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers { /// /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 /// Copyright (c) 2013-2018 北京泉江科技有限公司 /// 创建人:陈彬彬 /// 日 期:2017.04.01 /// 描 述:单据编号 /// public class CodeRuleController : MvcControllerBase { CodeRuleIBLL codeRuleIBLL = new CodeRuleBLL(); #region 视图功能 /// /// 单据编号管理 /// /// [HttpGet] public ActionResult Index() { return View(); } /// /// 表单 /// /// [HttpGet] public ActionResult Form() { return View(); } /// /// 单据编号规则 /// /// [HttpGet] public ActionResult FormatForm() { return View(); } #endregion #region 获取数据 /// /// 获取分页数据 /// /// 分页参数 /// 关键字 /// [HttpGet] [AjaxOnly] public ActionResult GetPageList(string pagination, string keyword) { Pagination paginationobj = pagination.ToObject(); var data = codeRuleIBLL.GetPageList(paginationobj, keyword); var jsonData = new { rows = data, total = paginationobj.total, page = paginationobj.page, records = paginationobj.records, }; return JsonResult(jsonData); } /// /// 获取列表数据 /// /// [HttpGet] [AjaxOnly] public ActionResult GetList() { var data = codeRuleIBLL.GetList(); return JsonResult(data); } #endregion #region 数据验证 /// /// 规则编码不能重复 /// /// 主键 /// 规则编码 /// [HttpGet] [AjaxOnly] public ActionResult ExistEnCode(string keyValue, string F_EnCode) { bool res = codeRuleIBLL.ExistEnCode(F_EnCode, keyValue); return JsonResult(res); } /// /// 规则名不能重复 /// /// 主键 /// 规则名 /// [HttpGet] [AjaxOnly] public ActionResult ExistFullName(string keyValue, string F_FullName) { bool res = codeRuleIBLL.ExistFullName(F_FullName, keyValue); return JsonResult(res); } #endregion #region 提交数据 /// /// 保存表单数据 /// /// /// /// [HttpPost] [ValidateAntiForgeryToken] [AjaxOnly] public ActionResult SaveForm(string keyValue, CodeRuleEntity entity) { codeRuleIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } /// /// 删除表单数据 /// /// /// [HttpPost] [AjaxOnly] public ActionResult DeleteForm(string keyValue) { codeRuleIBLL.VirtualDelete(keyValue); return Success("删除成功!"); } #endregion #region 扩展方法 /// /// 获取单据编码 /// /// [HttpGet] [AjaxOnly] public ActionResult GetEnCode(string code) { var data = codeRuleIBLL.GetBillCode(code); return SuccessString(data); } #endregion } }