using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using EMIS.ViewModel; using EMIS.Web.Controls; using Bowin.Web.Controls.Mvc; using EMIS.CommonLogic.MinorManage.MinorApply; using Bowin.Common.JSON; using Bowin.Common.Utility; using Bowin.Common.Exceptions; namespace EMIS.Web.Controllers.MinorManage.MinorApply { [Authorization] public class StudentMinorRegistApplyController : Controller { // // GET: /StudentMinorRegistApply/ public IStudentMinorRegistApplyServices studentMinorRegistApplyServices { get; set; } [HttpGet] public ActionResult List() { return View(); } [HttpPost] public ActionResult List(QueryParamsModel pararms) { ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms); var schoolyearID = pararms.getExtraGuid("SchoolyearDropdown"); var collegeID = pararms.getExtraGuid("CollegeDropdown"); var yearID = pararms.getExtraInt("SchoolyearDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("SchoolyearDictionaryDropDown"); var minorStandardID = pararms.getExtraInt("MinorStandardDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("MinorStandardDropDown"); return base.Json(studentMinorRegistApplyServices.GetGrademinorViewGrid(configuretView, schoolyearID, collegeID, yearID, minorStandardID, (int)pararms.page, (int)pararms.rows)); } [HttpPost] public ActionResult Apply(Guid GrademinorID) { try { studentMinorRegistApplyServices.Apply(GrademinorID); return Json(new ReturnMessage() { IsSuccess = true, Message = "报名成功。" }); } catch (Exception ex) { return Json(new ReturnMessage() { IsSuccess = false, Message = "报名失败,原因:" + ex.Message }); } } public ActionResult CourseList(Guid grademinorID) { return View(); } [HttpPost] public ActionResult GetCourseListByGrademinorID(QueryParamsModel pararms) { var grademinorID = Request["grademinorID"].ParseStrTo(); return this.Json(studentMinorRegistApplyServices.existStandardAndMinorSpecialtyCourseViewGrid(grademinorID, (int)pararms.page, (int)pararms.rows)); } /// /// 查询重修报名时间 /// /// [HttpPost] public ActionResult MinorOpenControl(QueryParamsModel pararms) { try { ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms); var schoolyearID = pararms.getExtraGuid("SchoolyearDropdown"); var retakeOpenTime = studentMinorRegistApplyServices.GetMinorApplyDateTime(schoolyearID); return Json(new ReturnMessage() { IsSuccess = true, Message = retakeOpenTime }); } catch (Exception ex) { return Json(new ReturnMessage() { IsSuccess = false, Message = ex.Message }); } } } }