using Learun.Application.CRM; using Learun.Util; using System.Web.Mvc; namespace Learun.Application.Web.Areas.LR_CRMModule.Controllers { /// /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 /// Copyright (c) 2013-2018 北京泉江科技有限公司 /// 创 建:超级管理员 /// 日 期:2017-07-11 14:28 /// 描 述:费用支出 /// public class ExpensesController : MvcControllerBase { private CrmExpensesIBLL crmExpensesIBLL = new CrmExpensesBLL(); #region 视图功能 /// /// 列表页面 /// /// [HttpGet] public ActionResult Index() { return View(); } /// /// 表单页面 /// /// [HttpGet] public ActionResult ExpensesForm() { return View(); } #endregion #region 获取数据 /// /// 获取列表 /// /// 分页参数 /// 查询参数 /// 返回分页列表Json [HttpGet] public ActionResult GetPageListJson(string pagination, string queryJson) { Pagination paginationobj = pagination.ToObject(); var data = crmExpensesIBLL.GetPageList(paginationobj, queryJson); var jsonData = new { rows = data, total = paginationobj.total, page = paginationobj.page, records = paginationobj.records, }; return JsonResult(jsonData); } /// /// 获取列表 /// /// 查询参数 /// 返回列表Json [HttpGet] public ActionResult GetListJson(string queryJson) { var data = crmExpensesIBLL.GetList(queryJson); return JsonResult(data); } /// /// 获取实体 /// /// 主键值 /// 返回对象Json [HttpGet] public ActionResult GetFormJson(string keyValue) { var data = crmExpensesIBLL.GetEntity(keyValue); return JsonResult(data); } #endregion #region 提交数据 /// /// 删除数据 /// /// 主键值 /// [HttpPost] [AjaxOnly] public ActionResult DeleteForm(string keyValue) { crmExpensesIBLL.DeleteEntity(keyValue); return Success("删除成功。"); } /// /// 保存表单(新增) /// /// 实体对象 /// [HttpPost] [ValidateAntiForgeryToken] [AjaxOnly] public ActionResult SaveForm(CrmExpensesEntity entity) { crmExpensesIBLL.SaveEntity(entity); return Success("操作成功。"); } #endregion } }