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.
 
 
 
 
 
 

121 lines
3.4 KiB

  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.EducationalAdministration;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  7. {
  8. /// <summary>
  9. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  10. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  11. /// 创 建:超级管理员
  12. /// 日 期:2019-02-21 17:59
  13. /// 描 述:县区管理
  14. /// </summary>
  15. public class DIC_AREAController : MvcControllerBase
  16. {
  17. private DIC_AREAIBLL dIC_AREAIBLL = new DIC_AREABLL();
  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. #endregion
  38. #region 获取数据
  39. [HttpGet]
  40. [AjaxOnly]
  41. public ActionResult GetAreasListByCityCode(string cityCode)
  42. {
  43. var data = dIC_AREAIBLL.GetAreasListByCityCode(cityCode);
  44. return Success(data);
  45. }
  46. /// <summary>
  47. /// 获取页面显示列表数据
  48. /// <summary>
  49. /// <param name="queryJson">查询参数</param>
  50. /// <returns></returns>
  51. [HttpGet]
  52. [AjaxOnly]
  53. public ActionResult GetPageList(string pagination, string queryJson)
  54. {
  55. Pagination paginationobj = pagination.ToObject<Pagination>();
  56. var data = dIC_AREAIBLL.GetPageList(paginationobj, queryJson);
  57. var jsonData = new
  58. {
  59. rows = data,
  60. total = paginationobj.total,
  61. page = paginationobj.page,
  62. records = paginationobj.records
  63. };
  64. return Success(jsonData);
  65. }
  66. /// <summary>
  67. /// 获取表单数据
  68. /// <summary>
  69. /// <returns></returns>
  70. [HttpGet]
  71. [AjaxOnly]
  72. public ActionResult GetFormData(string keyValue)
  73. {
  74. var DIC_AREAData = dIC_AREAIBLL.GetDIC_AREAEntity( keyValue );
  75. var jsonData = new {
  76. DIC_AREA = DIC_AREAData,
  77. };
  78. return Success(jsonData);
  79. }
  80. #endregion
  81. #region 提交数据
  82. /// <summary>
  83. /// 删除实体数据
  84. /// <param name="keyValue">主键</param>
  85. /// <summary>
  86. /// <returns></returns>
  87. [HttpPost]
  88. [AjaxOnly]
  89. public ActionResult DeleteForm(string keyValue)
  90. {
  91. dIC_AREAIBLL.DeleteEntity(keyValue);
  92. return Success("删除成功!");
  93. }
  94. /// <summary>
  95. /// 保存实体数据(新增、修改)
  96. /// <param name="keyValue">主键</param>
  97. /// <summary>
  98. /// <returns></returns>
  99. [HttpPost]
  100. [ValidateAntiForgeryToken]
  101. [AjaxOnly]
  102. public ActionResult SaveForm(string keyValue, string strEntity)
  103. {
  104. DIC_AREAEntity entity = strEntity.ToObject<DIC_AREAEntity>();
  105. dIC_AREAIBLL.SaveEntity(keyValue,entity);
  106. return Success("保存成功!");
  107. }
  108. #endregion
  109. }
  110. }