You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

112 lines
3.3 KiB

  1. using Learun.Application.CRM;
  2. using Learun.Util;
  3. using System.Web.Mvc;
  4. namespace Learun.Application.Web.Areas.LR_CRMModule.Controllers
  5. {
  6. /// <summary>
  7. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  8. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  9. /// 创 建:超级管理员
  10. /// 日 期:2017-07-11 14:28
  11. /// 描 述:费用支出
  12. /// </summary>
  13. public class ExpensesController : MvcControllerBase
  14. {
  15. private CrmExpensesIBLL crmExpensesIBLL = new CrmExpensesBLL();
  16. #region 视图功能
  17. /// <summary>
  18. /// 列表页面
  19. /// </summary>
  20. /// <returns></returns>
  21. [HttpGet]
  22. public ActionResult Index()
  23. {
  24. return View();
  25. }
  26. /// <summary>
  27. /// 表单页面
  28. /// </summary>
  29. /// <returns></returns>
  30. [HttpGet]
  31. public ActionResult ExpensesForm()
  32. {
  33. return View();
  34. }
  35. #endregion
  36. #region 获取数据
  37. /// <summary>
  38. /// 获取列表
  39. /// </summary>
  40. /// <param name="pagination">分页参数</param>
  41. /// <param name="queryJson">查询参数</param>
  42. /// <returns>返回分页列表Json</returns>
  43. [HttpGet]
  44. public ActionResult GetPageListJson(string pagination, string queryJson)
  45. {
  46. Pagination paginationobj = pagination.ToObject<Pagination>();
  47. var data = crmExpensesIBLL.GetPageList(paginationobj, queryJson);
  48. var jsonData = new
  49. {
  50. rows = data,
  51. total = paginationobj.total,
  52. page = paginationobj.page,
  53. records = paginationobj.records,
  54. };
  55. return JsonResult(jsonData);
  56. }
  57. /// <summary>
  58. /// 获取列表
  59. /// </summary>
  60. /// <param name="queryJson">查询参数</param>
  61. /// <returns>返回列表Json</returns>
  62. [HttpGet]
  63. public ActionResult GetListJson(string queryJson)
  64. {
  65. var data = crmExpensesIBLL.GetList(queryJson);
  66. return JsonResult(data);
  67. }
  68. /// <summary>
  69. /// 获取实体
  70. /// </summary>
  71. /// <param name="keyValue">主键值</param>
  72. /// <returns>返回对象Json</returns>
  73. [HttpGet]
  74. public ActionResult GetFormJson(string keyValue)
  75. {
  76. var data = crmExpensesIBLL.GetEntity(keyValue);
  77. return JsonResult(data);
  78. }
  79. #endregion
  80. #region 提交数据
  81. /// <summary>
  82. /// 删除数据
  83. /// </summary>
  84. /// <param name="keyValue">主键值</param>
  85. /// <returns></returns>
  86. [HttpPost]
  87. [AjaxOnly]
  88. public ActionResult DeleteForm(string keyValue)
  89. {
  90. crmExpensesIBLL.DeleteEntity(keyValue);
  91. return Success("删除成功。");
  92. }
  93. /// <summary>
  94. /// 保存表单(新增)
  95. /// </summary>
  96. /// <param name="entity">实体对象</param>
  97. /// <returns></returns>
  98. [HttpPost]
  99. [ValidateAntiForgeryToken]
  100. [AjaxOnly]
  101. public ActionResult SaveForm(CrmExpensesEntity entity)
  102. {
  103. crmExpensesIBLL.SaveEntity(entity);
  104. return Success("操作成功。");
  105. }
  106. #endregion
  107. }
  108. }