StudentMinorRegistApplyController.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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.Web.Controls;
  8. using Bowin.Web.Controls.Mvc;
  9. using EMIS.CommonLogic.MinorManage.MinorApply;
  10. using Bowin.Common.JSON;
  11. using Bowin.Common.Utility;
  12. using Bowin.Common.Exceptions;
  13. namespace EMIS.Web.Controllers.MinorManage.MinorApply
  14. {
  15. [Authorization]
  16. public class StudentMinorRegistApplyController : Controller
  17. {
  18. //
  19. // GET: /StudentMinorRegistApply/
  20. public IStudentMinorRegistApplyServices studentMinorRegistApplyServices { get; set; }
  21. [HttpGet]
  22. public ActionResult List()
  23. {
  24. return View();
  25. }
  26. [HttpPost]
  27. public ActionResult List(QueryParamsModel pararms)
  28. {
  29. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  30. var schoolyearID = pararms.getExtraGuid("SchoolyearDropdown");
  31. var collegeID = pararms.getExtraGuid("CollegeDropdown");
  32. var yearID = pararms.getExtraInt("SchoolyearDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("SchoolyearDictionaryDropDown");
  33. var minorStandardID = pararms.getExtraInt("MinorStandardDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("MinorStandardDropDown");
  34. return base.Json(studentMinorRegistApplyServices.GetGrademinorViewGrid(configuretView, schoolyearID, collegeID, yearID, minorStandardID, (int)pararms.page, (int)pararms.rows));
  35. }
  36. [HttpPost]
  37. public ActionResult Apply(Guid GrademinorID)
  38. {
  39. try
  40. {
  41. studentMinorRegistApplyServices.Apply(GrademinorID);
  42. return Json(new ReturnMessage()
  43. {
  44. IsSuccess = true,
  45. Message = "报名成功。"
  46. });
  47. }
  48. catch (Exception ex)
  49. {
  50. return Json(new ReturnMessage()
  51. {
  52. IsSuccess = false,
  53. Message = "报名失败,原因:" + ex.Message
  54. });
  55. }
  56. }
  57. public ActionResult CourseList(Guid grademinorID)
  58. {
  59. return View();
  60. }
  61. [HttpPost]
  62. public ActionResult GetCourseListByGrademinorID(QueryParamsModel pararms)
  63. {
  64. var grademinorID = Request["grademinorID"].ParseStrTo<Guid>();
  65. return this.Json(studentMinorRegistApplyServices.existStandardAndMinorSpecialtyCourseViewGrid(grademinorID, (int)pararms.page, (int)pararms.rows));
  66. }
  67. /// <summary>
  68. /// 查询重修报名时间
  69. /// </summary>
  70. /// <returns></returns>
  71. [HttpPost]
  72. public ActionResult MinorOpenControl(QueryParamsModel pararms)
  73. {
  74. try
  75. {
  76. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  77. var schoolyearID = pararms.getExtraGuid("SchoolyearDropdown");
  78. var retakeOpenTime = studentMinorRegistApplyServices.GetMinorApplyDateTime(schoolyearID);
  79. return Json(new ReturnMessage()
  80. {
  81. IsSuccess = true,
  82. Message = retakeOpenTime
  83. });
  84. }
  85. catch (Exception ex)
  86. {
  87. return Json(new ReturnMessage()
  88. {
  89. IsSuccess = false,
  90. Message = ex.Message
  91. });
  92. }
  93. }
  94. }
  95. }