StudentSelectCourseController.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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.SelectCourse.SelectCourseResult;
  8. using EMIS.Web.Controls;
  9. using EMIS.Utility.FormValidate;
  10. using EMIS.CommonLogic.SelectCourse;
  11. using Bowin.Web.Controls.Mvc;
  12. namespace EMIS.Web.Controllers.StudentSystem.SelectCourse
  13. {
  14. [Authorization]
  15. public class StudentSelectCourseController : Controller
  16. {
  17. public IStudentSelectCourseServices StudentSelectCourseServices { get; set; }
  18. public IConditionServices ConditionServices { get; set; }
  19. public IOpenControlSettingServices OpenControlSettingServices { get; set; }
  20. public ITypeSettingServices TypeSettingServices { get; set; }
  21. public ISelectCourseResultServices SelectCourseResultServices { get; set; }
  22. /// <summary>
  23. /// 学生选课页面
  24. /// </summary>
  25. /// <returns></returns>
  26. public ActionResult List()
  27. {
  28. var studentSelectCourseView = StudentSelectCourseServices.GetStudentSelectCourseSummaryView(CustomPrincipal.Current.UserID);
  29. ViewBag.IsHidden = !studentSelectCourseView.isInSchool; //是否在校生
  30. return View(studentSelectCourseView);
  31. }
  32. [HttpPost]
  33. public ActionResult List(QueryParamsModel pararms)
  34. {
  35. return base.Json(StudentSelectCourseServices.GetStudentSelectCourseResultViewList(CustomPrincipal.Current.UserID, pararms.page, pararms.rows));
  36. }
  37. public ActionResult SelectedList()
  38. {
  39. return View();
  40. }
  41. [HttpPost]
  42. public ActionResult SelectedList(QueryParamsModel pararms)
  43. {
  44. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  45. var schoolyearID = pararms.getExtraGuid("SchoolYear");
  46. var collegeID = pararms.getExtraGuid("CollegeComboGrid");
  47. var coursematerialID = pararms.getExtraGuid("CoursematerialComboGrid");
  48. var courseTypeID = pararms.getExtraInt("DictionaryCourseType") == -1 ? null : pararms.getExtraInt("DictionaryCourseType");
  49. var selectCourseTypeID = pararms.getExtraInt("DictionarySelectCourseType") == -1 ? null : pararms.getExtraInt("DictionarySelectCourseType");
  50. var result = StudentSelectCourseServices.GetSelectedCourseViewList(configuretView, schoolyearID, collegeID, coursematerialID, courseTypeID, selectCourseTypeID, 1, 10);
  51. return base.Json(result);
  52. }
  53. public ActionResult CanceledList()
  54. {
  55. return View();
  56. }
  57. [HttpPost]
  58. public ActionResult CanceledList(QueryParamsModel pararms)
  59. {
  60. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  61. var result = StudentSelectCourseServices.GetCanceledCourseViewList(configuretView, 1, 10);
  62. return base.Json(result);
  63. }
  64. [HttpPost]
  65. public ActionResult SelectCourse(Guid? grademajorID, Guid coursematerialID, int selectCourseTypeID, string teacherIDs, Guid ID)
  66. {
  67. try
  68. {
  69. this.StudentSelectCourseServices.SelectCourse(CustomPrincipal.Current.UserID, grademajorID, coursematerialID, selectCourseTypeID, teacherIDs, ID);
  70. return Json(new ReturnMessage
  71. {
  72. IsSuccess = true,
  73. Message = "选课成功。"
  74. });
  75. }
  76. catch (Exception ex)
  77. {
  78. return Json(new ReturnMessage
  79. {
  80. IsSuccess = false,
  81. Message = "操作失败:" + ex.Message
  82. });
  83. }
  84. }
  85. [HttpPost]
  86. public ActionResult CancelSelectCourse(Guid? grademajorID, Guid coursematerialID, int selectCourseTypeID, string teacherIDs, Guid ID)
  87. {
  88. try
  89. {
  90. this.StudentSelectCourseServices.CancelSelectCourse(CustomPrincipal.Current.UserID, grademajorID, coursematerialID, selectCourseTypeID, teacherIDs,ID);
  91. return Json(new ReturnMessage
  92. {
  93. IsSuccess = true,
  94. Message = "退选成功。"
  95. });
  96. }
  97. catch (Exception ex)
  98. {
  99. return Json(new ReturnMessage
  100. {
  101. IsSuccess = false,
  102. Message = "操作失败:" + ex.Message
  103. });
  104. }
  105. }
  106. }
  107. }