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.

AreaController.cs 2.6 KiB

4 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using Learun.Application.Base.SystemModule;
  2. using System.Web.Mvc;
  3. namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers
  4. {
  5. /// <summary>
  6. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  7. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  8. /// 创建人:陈彬彬
  9. /// 日 期:2017.04.01
  10. /// 描 述:行政区域
  11. /// </summary>
  12. public class AreaController : MvcControllerBase
  13. {
  14. private AreaIBLL areaIBLL = new AreaBLL();
  15. #region 视图功能
  16. /// <summary>
  17. /// 行政区域管理
  18. /// </summary>
  19. /// <returns></returns>
  20. [HttpGet]
  21. public ActionResult Index()
  22. {
  23. return View();
  24. }
  25. /// <summary>
  26. /// 表单
  27. /// </summary>
  28. /// <returns></returns>
  29. [HttpGet]
  30. public ActionResult Form()
  31. {
  32. return View();
  33. }
  34. #endregion
  35. #region 获取数据
  36. /// <summary>
  37. /// 获取列表数据
  38. /// </summary>
  39. /// <param name="parentId">父级主键</param>
  40. /// <param name="keyword">关键字查询(名称/编号)</param>
  41. /// <returns></returns>
  42. [HttpGet]
  43. [AjaxOnly]
  44. public ActionResult Getlist(string parentId, string keyword) {
  45. var data = areaIBLL.GetList(parentId, keyword);
  46. return JsonResult(data);
  47. }
  48. /// <summary>
  49. /// 获取树形数据
  50. /// </summary>
  51. /// <param name="parentId"></param>
  52. /// <returns></returns>
  53. [HttpGet]
  54. [AjaxOnly]
  55. public ActionResult GetTree(string parentId)
  56. {
  57. var data = areaIBLL.GetTree(parentId);
  58. return JsonResult(data);
  59. }
  60. #endregion
  61. #region 提交数据
  62. /// <summary>
  63. /// 保存表单数据
  64. /// </summary>
  65. /// <param name="keyValue"></param>
  66. /// <param name="entity"></param>
  67. /// <returns></returns>
  68. [HttpPost]
  69. [ValidateAntiForgeryToken]
  70. [AjaxOnly]
  71. public ActionResult SaveForm(string keyValue, AreaEntity entity)
  72. {
  73. areaIBLL.SaveEntity(keyValue, entity);
  74. return Success("保存成功!");
  75. }
  76. /// <summary>
  77. /// 删除表单数据
  78. /// </summary>
  79. /// <param name="keyValue"></param>
  80. /// <returns></returns>
  81. [HttpPost]
  82. [AjaxOnly]
  83. public ActionResult DeleteForm(string keyValue)
  84. {
  85. areaIBLL.VirtualDelete(keyValue);
  86. return Success("删除成功!");
  87. }
  88. #endregion
  89. }
  90. }