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.
 
 
 
 
 
 

120 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:33
  13. /// 描 述:地市管理
  14. /// </summary>
  15. public class DIC_CITYController : MvcControllerBase
  16. {
  17. private DIC_CITYIBLL dIC_CITYIBLL = new DIC_CITYBLL();
  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 GetListByProvinceCode(string provinceCode)
  42. {
  43. var data = dIC_CITYIBLL.GetListByProvinceCode(provinceCode);
  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_CITYIBLL.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_CITYData = dIC_CITYIBLL.GetDIC_CITYEntity(keyValue);
  75. var jsonData = new
  76. {
  77. DIC_CITY = DIC_CITYData,
  78. };
  79. return Success(jsonData);
  80. }
  81. #endregion
  82. #region 提交数据
  83. /// <summary>
  84. /// 删除实体数据
  85. /// <param name="keyValue">主键</param>
  86. /// <summary>
  87. /// <returns></returns>
  88. [HttpPost]
  89. [AjaxOnly]
  90. public ActionResult DeleteForm(string keyValue)
  91. {
  92. dIC_CITYIBLL.DeleteEntity(keyValue);
  93. return Success("删除成功!");
  94. }
  95. /// <summary>
  96. /// 保存实体数据(新增、修改)
  97. /// <param name="keyValue">主键</param>
  98. /// <summary>
  99. /// <returns></returns>
  100. [HttpPost]
  101. [ValidateAntiForgeryToken]
  102. [AjaxOnly]
  103. public ActionResult SaveForm(string keyValue, string strEntity)
  104. {
  105. DIC_CITYEntity entity = strEntity.ToObject<DIC_CITYEntity>();
  106. dIC_CITYIBLL.SaveEntity(keyValue, entity);
  107. return Success("保存成功!");
  108. }
  109. #endregion
  110. }
  111. }