ArrangementsController.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using EMIS.ViewModel;
  7. using EMIS.CommonLogic.CalendarManage;
  8. using Bowin.Web.Controls.Mvc;
  9. using EMIS.ViewModel.CalendarManage;
  10. namespace EMIS.Web.Controllers.CalendarManage
  11. {
  12. [Authorization]
  13. public class ArrangementsController : Controller
  14. {
  15. public IArrangementServices arrangementServices { get; set; }
  16. /// <summary>
  17. /// 周工作表页面
  18. /// </summary>
  19. /// <returns></returns>
  20. public ActionResult List()
  21. {
  22. return View();
  23. }
  24. /// <summary>
  25. /// 列表
  26. /// </summary>
  27. /// <param name="pararms"></param>
  28. /// <returns></returns>
  29. [HttpPost]
  30. public ActionResult List(QueryParamsModel pararms)
  31. {
  32. return Json(arrangementServices.GetArrangementViewGrid());
  33. }
  34. /// <summary>
  35. /// 保存
  36. /// </summary>
  37. /// <returns></returns>
  38. [HttpPost]
  39. public ActionResult Edit()
  40. {
  41. try
  42. {
  43. var arrangementsList = DataGrid.GetTableData<ArrangementView>("dgArrangementsList");
  44. arrangementServices.ArrangementAdd(arrangementsList);
  45. return Json(new ReturnMessage()
  46. {
  47. IsSuccess = true,
  48. Message = "保存成功!"
  49. });
  50. }
  51. catch (Exception ex)
  52. {
  53. return Json(new ReturnMessage()
  54. {
  55. IsSuccess = true,
  56. Message = "保存失败,原因:" + ex.Message + "!"
  57. });
  58. }
  59. }
  60. [HttpPost]
  61. public ActionResult IsOnWork(int weekday, Guid courseTimeID)
  62. {
  63. try
  64. {
  65. var isOnWork = arrangementServices.IsOnWork(weekday, courseTimeID);
  66. return Json(isOnWork);
  67. }
  68. catch (Exception ex)
  69. {
  70. return Json(false);
  71. }
  72. }
  73. }
  74. }