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.
 
 
 
 
 
 

151 lines
4.5 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-23 10:41
  13. /// 描 述:车辆事故信息
  14. /// </summary>
  15. public class VehicleAccidentController : MvcControllerBase
  16. {
  17. private VehicleAccidentIBLL vehicleAccidentIBLL = new VehicleAccidentBLL();
  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 Form()
  34. {
  35. return View();
  36. }
  37. /// <summary>
  38. /// 表单页
  39. /// <summary>
  40. /// <returns></returns>
  41. [HttpGet]
  42. public ActionResult IndexTJ()
  43. {
  44. return View();
  45. }
  46. #endregion
  47. #region 获取数据
  48. /// <summary>
  49. /// 获取页面显示列表数据
  50. /// </summary>
  51. /// <param name="pagination">分页参数</param>
  52. /// <param name="queryJson">查询参数</param>
  53. /// <returns></returns>
  54. [HttpGet]
  55. [AjaxOnly]
  56. public ActionResult GetPageList(string pagination, string queryJson)
  57. {
  58. Pagination paginationobj = pagination.ToObject<Pagination>();
  59. var data = vehicleAccidentIBLL.GetPageList(paginationobj, queryJson);
  60. var jsonData = new
  61. {
  62. rows = data,
  63. total = paginationobj.total,
  64. page = paginationobj.page,
  65. records = paginationobj.records
  66. };
  67. return Success(jsonData);
  68. }
  69. /// <summary>
  70. /// 获取页面显示列表数据
  71. /// </summary>
  72. /// <param name="pagination">分页参数</param>
  73. /// <param name="queryJson">查询参数</param>
  74. /// <returns></returns>
  75. [HttpGet]
  76. [AjaxOnly]
  77. public ActionResult GetPageListForTJ(string pagination, string queryJson)
  78. {
  79. Pagination paginationobj = pagination.ToObject<Pagination>();
  80. var data = vehicleAccidentIBLL.GetPageListForTJ(paginationobj, queryJson);
  81. var jsonData = new
  82. {
  83. rows = data,
  84. total = paginationobj.total,
  85. page = paginationobj.page,
  86. records = paginationobj.records
  87. };
  88. return Success(jsonData);
  89. }
  90. /// <summary>
  91. /// 获取表单数据
  92. /// </summary>
  93. /// <param name="keyValue">主键</param>
  94. /// <returns></returns>
  95. [HttpGet]
  96. [AjaxOnly]
  97. public ActionResult GetFormData(string keyValue)
  98. {
  99. var VehicleAccidentData = vehicleAccidentIBLL.GetVehicleAccidentEntity(keyValue);
  100. var jsonData = new
  101. {
  102. VehicleAccident = VehicleAccidentData,
  103. };
  104. return Success(jsonData);
  105. }
  106. #endregion
  107. #region 提交数据
  108. /// <summary>
  109. /// 删除实体数据
  110. /// </summary>
  111. /// <param name="keyValue">主键</param>
  112. /// <returns></returns>
  113. [HttpPost]
  114. [AjaxOnly]
  115. public ActionResult DeleteForm(string keyValue)
  116. {
  117. vehicleAccidentIBLL.DeleteEntity(keyValue);
  118. return Success("删除成功!");
  119. }
  120. /// <summary>
  121. /// 保存实体数据(新增、修改)
  122. /// </summary>
  123. /// <param name="keyValue">主键</param>
  124. /// <param name="strEntity">实体</param>
  125. /// <returns></returns>
  126. [HttpPost]
  127. [ValidateAntiForgeryToken]
  128. [AjaxOnly]
  129. public ActionResult SaveForm(string keyValue, string strEntity)
  130. {
  131. VehicleAccidentEntity entity = strEntity.ToObject<VehicleAccidentEntity>();
  132. vehicleAccidentIBLL.SaveEntity(keyValue, entity);
  133. if (string.IsNullOrEmpty(keyValue))
  134. {
  135. }
  136. return Success("保存成功!");
  137. }
  138. #endregion
  139. }
  140. }