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.
 
 
 
 
 
 

200 lines
5.6 KiB

  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.CustomFunction;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. namespace Learun.Application.Web.Areas.CustomFunction.Controllers
  7. {
  8. /// <summary>
  9. /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
  10. /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  11. /// 创 建:超级管理员
  12. /// 日 期:2021-07-22 09:20
  13. /// 描 述:车辆费用信息
  14. /// </summary>
  15. public class VehicleCostController : MvcControllerBase
  16. {
  17. private VehicleCostIBLL vehicleCostIBLL = new VehicleCostBLL();
  18. #region 视图功能
  19. /// <summary>
  20. /// 主页面
  21. /// <summary>
  22. /// <returns></returns>
  23. [HttpGet]
  24. public ActionResult Index()
  25. {
  26. return View();
  27. }
  28. /// <summary>
  29. /// 主页面
  30. /// <summary>
  31. /// <returns></returns>
  32. [HttpGet]
  33. public ActionResult IndexCost()
  34. {
  35. return View();
  36. }
  37. /// <summary>
  38. /// 表单页
  39. /// <summary>
  40. /// <returns></returns>
  41. [HttpGet]
  42. public ActionResult Form()
  43. {
  44. return View();
  45. }
  46. /// <summary>
  47. /// 表单页
  48. /// <summary>
  49. /// <returns></returns>
  50. [HttpGet]
  51. public ActionResult FormBuy()
  52. {
  53. return View();
  54. }
  55. /// <summary>
  56. /// 表单页
  57. /// <summary>
  58. /// <returns></returns>
  59. [HttpGet]
  60. public ActionResult IndexTJ()
  61. {
  62. return View();
  63. }
  64. #endregion
  65. #region 获取数据
  66. /// <summary>
  67. /// 获取页面显示列表数据
  68. /// </summary>
  69. /// <param name="pagination">分页参数</param>
  70. /// <param name="queryJson">查询参数</param>
  71. /// <returns></returns>
  72. [HttpGet]
  73. [AjaxOnly]
  74. public ActionResult GetPageList(string pagination, string queryJson)
  75. {
  76. Pagination paginationobj = pagination.ToObject<Pagination>();
  77. var data = vehicleCostIBLL.GetPageList(paginationobj, queryJson);
  78. var jsonData = new
  79. {
  80. rows = data,
  81. total = paginationobj.total,
  82. page = paginationobj.page,
  83. records = paginationobj.records
  84. };
  85. return Success(jsonData);
  86. }
  87. /// <summary>
  88. /// 获取页面显示列表数据
  89. /// </summary>
  90. /// <param name="pagination">分页参数</param>
  91. /// <param name="queryJson">查询参数</param>
  92. /// <returns></returns>
  93. [HttpGet]
  94. [AjaxOnly]
  95. public ActionResult GetPageListForTJ(string pagination)
  96. {
  97. Pagination paginationobj = pagination.ToObject<Pagination>();
  98. var data = vehicleCostIBLL.GetPageListForTJ(paginationobj);
  99. var jsonData = new
  100. {
  101. rows = data,
  102. total = paginationobj.total,
  103. page = paginationobj.page,
  104. records = paginationobj.records
  105. };
  106. return Success(jsonData);
  107. }
  108. /// <summary>
  109. /// 获取页面显示列表数据
  110. /// </summary>
  111. /// <param name="pagination">分页参数</param>
  112. /// <param name="queryJson">查询参数</param>
  113. /// <returns></returns>
  114. [HttpGet]
  115. [AjaxOnly]
  116. public ActionResult GetList(string queryJson)
  117. {
  118. var data = vehicleCostIBLL.GetList(queryJson);
  119. return Success(data);
  120. }
  121. /// <summary>
  122. /// 获取车辆费用类型
  123. /// </summary>
  124. /// <returns></returns>
  125. [HttpGet]
  126. [AjaxOnly]
  127. public ActionResult GetCostType()
  128. {
  129. var data = new[]
  130. {
  131. new {Id="1",Name ="公车购置费用"},
  132. new {Id="2",Name ="公车使用费用"},
  133. };
  134. return Success(data);
  135. }
  136. /// <summary>
  137. /// 获取表单数据
  138. /// </summary>
  139. /// <param name="keyValue">主键</param>
  140. /// <returns></returns>
  141. [HttpGet]
  142. [AjaxOnly]
  143. public ActionResult GetFormData(string keyValue)
  144. {
  145. var VehicleCostData = vehicleCostIBLL.GetVehicleCostEntity(keyValue);
  146. var jsonData = new
  147. {
  148. VehicleCost = VehicleCostData,
  149. };
  150. return Success(jsonData);
  151. }
  152. #endregion
  153. #region 提交数据
  154. /// <summary>
  155. /// 删除实体数据
  156. /// </summary>
  157. /// <param name="keyValue">主键</param>
  158. /// <returns></returns>
  159. [HttpPost]
  160. [AjaxOnly]
  161. public ActionResult DeleteForm(string keyValue)
  162. {
  163. vehicleCostIBLL.DeleteEntity(keyValue);
  164. return Success("删除成功!");
  165. }
  166. /// <summary>
  167. /// 保存实体数据(新增、修改)
  168. /// </summary>
  169. /// <param name="keyValue">主键</param>
  170. /// <param name="strEntity">实体</param>
  171. /// <returns></returns>
  172. [HttpPost]
  173. [ValidateAntiForgeryToken]
  174. [AjaxOnly]
  175. public ActionResult SaveForm(string keyValue, string strEntity)
  176. {
  177. VehicleCostEntity entity = strEntity.ToObject<VehicleCostEntity>();
  178. vehicleCostIBLL.SaveEntity(keyValue, entity);
  179. if (string.IsNullOrEmpty(keyValue))
  180. {
  181. }
  182. return Success("保存成功!");
  183. }
  184. #endregion
  185. }
  186. }