123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.ViewModel;
- using EMIS.CommonLogic.SelectCourse.SelectCourseResult;
- using EMIS.Web.Controls;
- using EMIS.Utility.FormValidate;
- using EMIS.CommonLogic.SelectCourse;
- using Bowin.Web.Controls.Mvc;
- namespace EMIS.Web.Controllers.StudentSystem.SelectCourse
- {
- [Authorization]
- public class StudentSelectCourseController : Controller
- {
- public IStudentSelectCourseServices StudentSelectCourseServices { get; set; }
- public IConditionServices ConditionServices { get; set; }
- public IOpenControlSettingServices OpenControlSettingServices { get; set; }
- public ITypeSettingServices TypeSettingServices { get; set; }
- public ISelectCourseResultServices SelectCourseResultServices { get; set; }
- /// <summary>
- /// 学生选课页面
- /// </summary>
- /// <returns></returns>
- public ActionResult List()
- {
- var studentSelectCourseView = StudentSelectCourseServices.GetStudentSelectCourseSummaryView(CustomPrincipal.Current.UserID);
- ViewBag.IsHidden = !studentSelectCourseView.isInSchool; //是否在校生
- return View(studentSelectCourseView);
- }
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- return base.Json(StudentSelectCourseServices.GetStudentSelectCourseResultViewList(CustomPrincipal.Current.UserID, pararms.page, pararms.rows));
- }
- public ActionResult SelectedList()
- {
- return View();
- }
- [HttpPost]
- public ActionResult SelectedList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("SchoolYear");
- var collegeID = pararms.getExtraGuid("CollegeComboGrid");
- var coursematerialID = pararms.getExtraGuid("CoursematerialComboGrid");
- var courseTypeID = pararms.getExtraInt("DictionaryCourseType") == -1 ? null : pararms.getExtraInt("DictionaryCourseType");
- var selectCourseTypeID = pararms.getExtraInt("DictionarySelectCourseType") == -1 ? null : pararms.getExtraInt("DictionarySelectCourseType");
- var result = StudentSelectCourseServices.GetSelectedCourseViewList(configuretView, schoolyearID, collegeID, coursematerialID, courseTypeID, selectCourseTypeID, 1, 10);
- return base.Json(result);
- }
- public ActionResult CanceledList()
- {
- return View();
- }
- [HttpPost]
- public ActionResult CanceledList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var result = StudentSelectCourseServices.GetCanceledCourseViewList(configuretView, 1, 10);
- return base.Json(result);
- }
- [HttpPost]
- public ActionResult SelectCourse(Guid? grademajorID, Guid coursematerialID, int selectCourseTypeID, string teacherIDs, Guid ID)
- {
- try
- {
- this.StudentSelectCourseServices.SelectCourse(CustomPrincipal.Current.UserID, grademajorID, coursematerialID, selectCourseTypeID, teacherIDs, ID);
- return Json(new ReturnMessage
- {
- IsSuccess = true,
- Message = "选课成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage
- {
- IsSuccess = false,
- Message = "操作失败:" + ex.Message
- });
- }
- }
- [HttpPost]
- public ActionResult CancelSelectCourse(Guid? grademajorID, Guid coursematerialID, int selectCourseTypeID, string teacherIDs, Guid ID)
- {
- try
- {
- this.StudentSelectCourseServices.CancelSelectCourse(CustomPrincipal.Current.UserID, grademajorID, coursematerialID, selectCourseTypeID, teacherIDs,ID);
- return Json(new ReturnMessage
- {
- IsSuccess = true,
- Message = "退选成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage
- {
- IsSuccess = false,
- Message = "操作失败:" + ex.Message
- });
- }
- }
- }
- }
|