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.

SW_HolidayGoController.cs 3.6 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. using Learun.Util;
  2. using System.Data;
  3. using Learun.Application.TwoDevelopment.StudentWork;
  4. using System.Web.Mvc;
  5. using System.Collections.Generic;
  6. using System;
  7. namespace Learun.Application.Web.Areas.StudentWork.Controllers
  8. {
  9. /// <summary>
  10. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  11. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  12. /// 创 建:超级管理员
  13. /// 日 期:2020-05-22 11:49
  14. /// 描 述:节假日去向
  15. /// </summary>
  16. public class SW_HolidayGoController : MvcControllerBase
  17. {
  18. private SW_HolidayGoIBLL sW_HolidayGoIBLL = new SW_HolidayGoBLL();
  19. #region 视图功能
  20. /// <summary>
  21. /// 主页面
  22. /// <summary>
  23. /// <returns></returns>
  24. [HttpGet]
  25. public ActionResult Index()
  26. {
  27. return View();
  28. }
  29. /// <summary>
  30. /// 表单页
  31. /// <summary>
  32. /// <returns></returns>
  33. [HttpGet]
  34. public ActionResult Form()
  35. {
  36. return View();
  37. }
  38. /// <summary>
  39. /// 主页面
  40. /// <summary>
  41. /// <returns></returns>
  42. [HttpGet]
  43. public ActionResult StatisticIndex()
  44. {
  45. return View();
  46. }
  47. #endregion
  48. #region 获取数据
  49. /// <summary>
  50. /// 获取页面显示列表数据
  51. /// <summary>
  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 = sW_HolidayGoIBLL.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. /// <returns></returns>
  73. [HttpGet]
  74. [AjaxOnly]
  75. public ActionResult GetFormData(string keyValue)
  76. {
  77. var SW_HolidayGoData = sW_HolidayGoIBLL.GetSW_HolidayGoEntity(keyValue);
  78. var jsonData = new
  79. {
  80. SW_HolidayGo = SW_HolidayGoData,
  81. };
  82. return Success(jsonData);
  83. }
  84. #endregion
  85. #region 提交数据
  86. /// <summary>
  87. /// 删除实体数据
  88. /// <param name="keyValue">主键</param>
  89. /// <summary>
  90. /// <returns></returns>
  91. [HttpPost]
  92. [AjaxOnly]
  93. public ActionResult DeleteForm(string keyValue)
  94. {
  95. sW_HolidayGoIBLL.DeleteEntity(keyValue);
  96. return Success("删除成功!");
  97. }
  98. /// <summary>
  99. /// 保存实体数据(新增、修改)
  100. /// <param name="keyValue">主键</param>
  101. /// <summary>
  102. /// <returns></returns>
  103. [HttpPost]
  104. [ValidateAntiForgeryToken]
  105. [AjaxOnly]
  106. public ActionResult SaveForm(string keyValue, string strEntity)
  107. {
  108. var loginInfo = LoginUserInfo.Get();
  109. SW_HolidayGoEntity entity = strEntity.ToObject<SW_HolidayGoEntity>();
  110. entity.UserId = loginInfo.userId;
  111. entity.CreateUserId = loginInfo.userId;
  112. entity.CreateTime = DateTime.Now;
  113. sW_HolidayGoIBLL.SaveEntity(keyValue, entity);
  114. return Success("保存成功!");
  115. }
  116. #endregion
  117. }
  118. }