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.
 
 
 
 
 
 

116 lines
3.5 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:47
  11. /// 描 述:开票信息
  12. /// </summary>
  13. public class InvoiceController : MvcControllerBase
  14. {
  15. private CrmInvoiceIBLL crmInvoiceIBLL = new CrmInvoiceBLL();
  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 Form()
  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. [AjaxOnly]
  45. public ActionResult GetPageListJson(string pagination, string queryJson)
  46. {
  47. Pagination paginationobj = pagination.ToObject<Pagination>();
  48. var data = crmInvoiceIBLL.GetPageList(paginationobj, queryJson);
  49. var jsonData = new
  50. {
  51. rows = data,
  52. total = paginationobj.total,
  53. page = paginationobj.page,
  54. records = paginationobj.records,
  55. };
  56. return JsonResult(jsonData);
  57. }
  58. /// <summary>
  59. /// 获取列表
  60. /// </summary>
  61. /// <param name="queryJson">查询参数</param>
  62. /// <returns>返回列表Json</returns>
  63. [HttpGet]
  64. [AjaxOnly]
  65. public ActionResult GetListJson(string queryJson)
  66. {
  67. var data = crmInvoiceIBLL.GetList(queryJson);
  68. return JsonResult(data);
  69. }
  70. /// <summary>
  71. /// 获取实体
  72. /// </summary>
  73. /// <param name="keyValue">主键值</param>
  74. /// <returns>返回对象Json</returns>
  75. [HttpGet]
  76. [AjaxOnly]
  77. public ActionResult GetFormJson(string keyValue)
  78. {
  79. var data = crmInvoiceIBLL.GetEntity(keyValue);
  80. return JsonResult(data);
  81. }
  82. #endregion
  83. #region 提交数据
  84. /// <summary>
  85. /// 删除数据
  86. /// </summary>
  87. /// <param name="keyValue">主键值</param>
  88. /// <returns></returns>
  89. [HttpPost]
  90. [AjaxOnly]
  91. public ActionResult DeleteForm(string keyValue)
  92. {
  93. crmInvoiceIBLL.DeleteEntity(keyValue);
  94. return Success("删除成功。");
  95. }
  96. /// <summary>
  97. /// 保存表单(新增、修改)
  98. /// </summary>
  99. /// <param name="keyValue">主键值</param>
  100. /// <param name="entity">实体对象</param>
  101. /// <returns></returns>
  102. [HttpPost]
  103. [ValidateAntiForgeryToken]
  104. [AjaxOnly]
  105. public ActionResult SaveForm(string keyValue, CrmInvoiceEntity entity)
  106. {
  107. crmInvoiceIBLL.SaveEntity(keyValue, entity);
  108. return Success("操作成功。");
  109. }
  110. #endregion
  111. }
  112. }