123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Linq.Expressions;
- using Bowin.Common.Linq.Entity;
- using Bowin.Common.Linq;
- using EMIS.DataLogic.RetakeManage;
- using EMIS.Entities;
- using EMIS.ViewModel;
- using EMIS.ViewModel.RetakeManage;
- using EMIS.Utility;
- using EMIS.CommonLogic.SystemServices;
- using EMIS.ViewModel.EducationManage;
- using EMIS.DataLogic.EducationManage;
- using EMIS.CommonLogic.EducationSchedule;
- using EMIS.DataLogic.SystemSetting;
- using EMIS.CommonLogic.RetakeManage.General;
- using EMIS.DataLogic.Common.Students;
- using System.Transactions;
- using EMIS.DataLogic.Repositories;
- namespace EMIS.CommonLogic.RetakeManage.General
- {
- public class RetakePlanStudentApplyServices : BaseServices, IRetakePlanStudentApplyServices
- {
- public RetakeConditionDAL RetakeConditionDAL { get; set; }
- public RetakePlanStudentApplyDAL RetakePlanStudentApplyDAL { get; set; }
- public RetakePlanDAL RetakePlanDAL { get; set; }
- public Lazy<IParameterServices> ParameterServices { get; set; }
- public DictionaryDAL DictionaryDAL { get; set; }
- public StudentsDAL StudentsDAL { get; set; }
- public Lazy<IRetakeOpenControlServices> IRetakeOpenControlServices { get; set; }
- public ParameterRepository ParameterRepository { get; set; }
- public RetakePlanTaskDAL RetakePlanTaskDAL { get; set; }
- public RetakePlanResultDAL RetakePlanResultDAL { get; set; }
- /// <summary>
- /// 查询学生平台进入报名信息View(只查询重修计划状态为已开放)
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="userID"></param>
- /// <param name="schoolyearID"></param>
- /// <param name="coursematerialID"></param>
- /// <param name="pageIndex"></param>
- /// <param name="pageSize"></param>
- /// <returns></returns>
- public IGridResultSet<RetakePlanStudentApplyView> GetRetakePlanStudentApplyView(ConfiguretView configuretView, Guid userID,
- Guid? schoolyearID, Guid? coursematerialID, int? generalPurposeID, int? pageIndex, int? pageSize)
- {
- //重修计划
- Expression<Func<ER_RetakePlan, bool>> expRetakePlan = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- //重修任务状态为已开放状态的信息
- expRetakePlan = expRetakePlan.And(x => x.RecordStatus == (int)ER_RetakePlanStatus.Opened);
- if (schoolyearID.HasValue)
- {
- //重修学年学期
- expRetakePlan = expRetakePlan.And(x => x.SchoolyearID == schoolyearID);
- }
- if (coursematerialID.HasValue)
- {
- //课程信息
- expRetakePlan = expRetakePlan.And(x => x.CoursematerialID == coursematerialID);
- }
- //重修计划名单
- Expression<Func<ER_RetakePlanStudent, bool>> expRetakePlanStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- //学生信息ID
- expRetakePlanStudent = expRetakePlanStudent.And(x => x.UserID == userID);
- //查询对应的进入报名信息
- var query = RetakePlanStudentApplyDAL.GetRetakePlanStudentApplyView(expRetakePlan, expRetakePlanStudent);
- if (generalPurposeID.HasValue)
- {
- //报名状态
- if (generalPurposeID.Value == (int)CF_GeneralPurpose.IsYes)
- {
- query = query.Where(x => x.ApplyStatus == true);
- }
- if (generalPurposeID.Value == (int)CF_GeneralPurpose.IsNo)
- {
- query = query.Where(x => x.ApplyStatus == false);
- }
- }
- //列表查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- var result = query.OrderBy(x => x.SchoolyearCode.Length).ThenBy(x => x.SchoolyearCode)
- .ThenBy(x => x.CourseCollegeNo.Length).ThenBy(x => x.CourseCollegeNo)
- .ThenBy(x => x.RetakeTypeID).ThenBy(x => x.CourseCode.Length)
- .ThenBy(x => x.CourseCode).ThenBy(x => x.CourseTypeID)
- .ThenBy(x => x.Credit).ThenBy(x => x.ClassName)
- .ToGridResultSet(pageIndex, pageSize);
- //查询重修学年学期对应的重修开放控制信息
- var retakeOpenControlView = IRetakeOpenControlServices.Value.GetRetakeOpenControlViewBySchoolyearID(schoolyearID);
- //根据对应的重修开放控制信息进行判断(操作状态,精确到分秒)
- result.rows.ForEach(x => x.CanSelect =
- (retakeOpenControlView != null
- &&
- !(
- x.PeopleNumlimit != null && x.PeopleNumlimit > 0
- && x.ApplyNumber.Value >= x.PeopleNumlimit.Value
- && x.ApplyStatus.Value == false
- )
- &&
- (
- x.SchoolyearID == retakeOpenControlView.SchoolyearID
- && retakeOpenControlView.StartDate <= DateTime.Now
- && retakeOpenControlView.EndDate >= DateTime.Now
- )
- ) ? true : false
- );
- //查询对应的重修计划IDList
- var retakePlanIDList = query.Select(x => x.RetakePlanID).ToList();
- //查询对应的课程表信息
- var schedulingList = RetakePlanTaskDAL.GetSchedulingView(x => retakePlanIDList.Contains(x.RetakePlanID.Value)).ToList();
- //查询合并显示的课程表信息
- var weekdayTimesList = this.GetWeekdayTimesSegmentName(schedulingList);
- result.rows.ForEach(x =>
- {
- var list = weekdayTimesList.Where(w => w.ID == x.RetakePlanID);
- x.WeekdayTimesSegmentName = string.Join(";", list.OrderBy(w => w.Weekday).Select(w => w.WeekdayTimesSegmentName));
- x.ClassroomName = schedulingList.Where(w => w.ID == x.RetakePlanID).Select(w => w.ClassroomName).FirstOrDefault();
- });
- //查询合并显示的任课老师信息
- var teacherList = RetakePlanResultDAL.GetRetakePlanTeacherView(x => retakePlanIDList.Contains(x.RetakePlanID));
- result.rows.ForEach(x =>
- x.TeacherName = string.Join(",", teacherList.Where(w => w.RetakePlanID == x.RetakePlanID).Select(w => w.TeacherName)));
- return result;
- }
- /// <summary>
- /// 查询重修课程信息View(学生平台,暂不排除未开放状态的重修计划)
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="userID"></param>
- /// <param name="schoolyearID"></param>
- /// <param name="coursematerialID"></param>
- /// <param name="retakePlanStatusID"></param>
- /// <param name="pageIndex"></param>
- /// <param name="pageSize"></param>
- /// <returns></returns>
- public IGridResultSet<RetakePlanStudentApplyView> GetStudentRetakeCourseView(ConfiguretView configuretView, Guid userID,
- Guid? schoolyearID, Guid? coursematerialID, int? retakePlanStatusID, int? pageIndex, int? pageSize)
- {
- //重修计划
- Expression<Func<ER_RetakePlan, bool>> expRetakePlan = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- ////排除重修任务状态为未开放状态的信息
- //expRetakePlan = expRetakePlan.And(x => x.RecordStatus != (int)ER_RetakePlanStatus.NotOpened);
- if (schoolyearID.HasValue)
- {
- //重修学年学期
- expRetakePlan = expRetakePlan.And(x => x.SchoolyearID == schoolyearID);
- }
- if (coursematerialID.HasValue)
- {
- //课程信息
- expRetakePlan = expRetakePlan.And(x => x.CoursematerialID == coursematerialID);
- }
- if (retakePlanStatusID.HasValue)
- {
- //重修任务状态
- expRetakePlan = expRetakePlan.And(x => x.RecordStatus == retakePlanStatusID);
- }
- //重修计划名单
- Expression<Func<ER_RetakePlanStudent, bool>> expRetakePlanStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- //学生信息ID
- expRetakePlanStudent = expRetakePlanStudent.And(x => x.UserID == userID);
- //查询对应的进入报名信息
- var query = RetakePlanStudentApplyDAL.GetStudentRetakeCourseView(expRetakePlan, expRetakePlanStudent);
- //列表查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- var result = query.OrderBy(x => x.SchoolyearCode.Length).ThenBy(x => x.SchoolyearCode)
- .ThenBy(x => x.CourseCollegeNo.Length).ThenBy(x => x.CourseCollegeNo)
- .ThenBy(x => x.RetakeTypeID).ThenBy(x => x.CourseCode.Length)
- .ThenBy(x => x.CourseCode).ThenBy(x => x.CourseTypeID)
- .ThenBy(x => x.Credit).ThenBy(x => x.ClassName)
- .ToGridResultSet(pageIndex, pageSize);
- //查询对应的重修计划IDList
- var retakePlanIDList = query.Select(x => x.RetakePlanID).ToList();
- //查询对应的课程表信息
- var schedulingList = RetakePlanTaskDAL.GetSchedulingView(x => retakePlanIDList.Contains(x.RetakePlanID.Value)).ToList();
- //查询合并显示的课程表信息
- var weekdayTimesList = this.GetWeekdayTimesSegmentName(schedulingList);
- result.rows.ForEach(x =>
- {
- var list = weekdayTimesList.Where(w => w.ID == x.RetakePlanID);
- x.WeekdayTimesSegmentName = string.Join(";", list.OrderBy(w => w.Weekday).Select(w => w.WeekdayTimesSegmentName));
- x.ClassroomName = schedulingList.Where(w => w.ID == x.RetakePlanID).Select(w => w.ClassroomName).FirstOrDefault();
- });
- //查询合并显示的任课老师信息
- var teacherList = RetakePlanResultDAL.GetRetakePlanTeacherView(x => retakePlanIDList.Contains(x.RetakePlanID));
- result.rows.ForEach(x =>
- x.TeacherName = string.Join(",", teacherList.Where(w => w.RetakePlanID == x.RetakePlanID).Select(w => w.TeacherName)));
- return result;
- }
- /// <summary>
- /// 查询重修课程信息View(学生平台,暂不排除未开放状态的重修计划)
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="userID"></param>
- /// <param name="schoolyearID"></param>
- /// <param name="coursematerialID"></param>
- /// <param name="retakePlanStatusID"></param>
- /// <returns></returns>
- public List<RetakePlanStudentApplyView> GetStudentRetakeCourseView(ConfiguretView configuretView, Guid userID,
- Guid? schoolyearID, Guid? coursematerialID, int? retakePlanStatusID)
- {
- //重修计划
- Expression<Func<ER_RetakePlan, bool>> expRetakePlan = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- ////排除重修任务状态为未开放状态的信息
- //expRetakePlan = expRetakePlan.And(x => x.RecordStatus != (int)ER_RetakePlanStatus.NotOpened);
- if (schoolyearID.HasValue)
- {
- //重修学年学期
- expRetakePlan = expRetakePlan.And(x => x.SchoolyearID == schoolyearID);
- }
- if (coursematerialID.HasValue)
- {
- //课程信息
- expRetakePlan = expRetakePlan.And(x => x.CoursematerialID == coursematerialID);
- }
- if (retakePlanStatusID.HasValue)
- {
- //重修任务状态
- expRetakePlan = expRetakePlan.And(x => x.RecordStatus == retakePlanStatusID);
- }
- //重修计划名单
- Expression<Func<ER_RetakePlanStudent, bool>> expRetakePlanStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- //学生信息ID
- expRetakePlanStudent = expRetakePlanStudent.And(x => x.UserID == userID);
- //查询对应的进入报名信息
- var query = RetakePlanStudentApplyDAL.GetStudentRetakeCourseView(expRetakePlan, expRetakePlanStudent);
- //列表查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- var result = query.OrderBy(x => x.SchoolyearCode.Length).ThenBy(x => x.SchoolyearCode)
- .ThenBy(x => x.CourseCollegeNo.Length).ThenBy(x => x.CourseCollegeNo)
- .ThenBy(x => x.RetakeTypeID).ThenBy(x => x.CourseCode.Length)
- .ThenBy(x => x.CourseCode).ThenBy(x => x.CourseTypeID)
- .ThenBy(x => x.Credit).ThenBy(x => x.ClassName)
- .ToList();
- //查询对应的重修计划IDList
- var retakePlanIDList = query.Select(x => x.RetakePlanID).ToList();
- //查询对应的课程表信息
- var schedulingList = RetakePlanTaskDAL.GetSchedulingView(x => retakePlanIDList.Contains(x.RetakePlanID.Value)).ToList();
- //查询合并显示的课程表信息
- var weekdayTimesList = this.GetWeekdayTimesSegmentName(schedulingList);
- result.ForEach(x =>
- {
- var list = weekdayTimesList.Where(w => w.ID == x.RetakePlanID);
- x.WeekdayTimesSegmentName = string.Join(";", list.OrderBy(w => w.Weekday).Select(w => w.WeekdayTimesSegmentName));
- x.ClassroomName = schedulingList.Where(w => w.ID == x.RetakePlanID).Select(w => w.ClassroomName).FirstOrDefault();
- });
- //查询合并显示的任课老师信息
- var teacherList = RetakePlanResultDAL.GetRetakePlanTeacherView(x => retakePlanIDList.Contains(x.RetakePlanID));
- result.ForEach(x =>
- x.TeacherName = string.Join(",", teacherList.Where(w => w.RetakePlanID == x.RetakePlanID).Select(w => w.TeacherName)));
- return result;
- }
- /// <summary>
- /// 查询合并显示的课程表信息
- /// </summary>
- /// <param name="SourceList">上课时间</param>
- /// <returns></returns>
- public List<RetakePlanSettingSchedulingView> GetWeekdayTimesSegmentName(List<RetakePlanSettingSchedulingView> SourceList)
- {
- List<RetakePlanSettingSchedulingView> newList = new List<RetakePlanSettingSchedulingView>();
- var idList = SourceList.Select(x => x.ID).Distinct().ToList();
- foreach (var id in idList)
- { //循环处理每个任选课的上课时间
- var list = SourceList.Where(x => x.ID == id).ToList();
- var weekdayList = list.Select(x => x.Weekday).Distinct().ToList();
- foreach (var weekday in weekdayList)
- { //先循环同一星期日期
- var tmpList = list.Where(x => x.Weekday == weekday).OrderBy(x => x.StartTimes).ToList();
- string WeekdayTimesSegmentName = tmpList.FirstOrDefault().WeekdayName + tmpList.FirstOrDefault().StartTimes;
- var array = tmpList.Select(x => new { x.StartTimes, x.EndTimes }).ToArray();
- for (int i = 0; i < array.Length; i++)
- { //将同一天的节次合并,相邻的节次用“-”将最开始节次和最后节次合并,例:1/2/3合并成“1-3”,
- //如果不是相邻的先用逗号隔开,再用“-”合并,例:1/2/3和5/6,合并成“1-3,5-6”
- if (i > 0 && (array[i].StartTimes > array[i - 1].EndTimes + 1))
- { //不相邻的先用逗号隔开,再用“-”合并
- WeekdayTimesSegmentName += "-" + array[i - 1].EndTimes + "节," + array[i].StartTimes;
- }
- if (i + 1 == array.Length)
- WeekdayTimesSegmentName += "-" + array[i].EndTimes + "节";
- }
- newList.Add(new RetakePlanSettingSchedulingView { ID = tmpList.FirstOrDefault().ID, WeekdayTimesSegmentName = WeekdayTimesSegmentName.Replace("星期", ""), Weekday = tmpList.FirstOrDefault().Weekday });
- }
- }
- return newList;
- }
- /// <summary>
- /// 学生平台重修报名(注:1、检测重修开放时间,2、检测人数上限,3、检测重修课程重复,4、检测重修收费控制-暂时不考虑,5、检测排课冲突)
- /// </summary>
- /// <param name="RetakePlanStudentID"></param>
- /// <param name="UserID"></param>
- public void Apply(Guid RetakePlanStudentID, Guid UserID)
- {
- try
- {
- using (TransactionScope ts = new TransactionScope())
- {
- //查询对应的重修计划名单信息View
- var retakePlanView = RetakePlanStudentApplyDAL.RetakePlanStudentRepository
- .GetList(x => x.RetakePlanStudentID == RetakePlanStudentID,
- (x => x.ER_RetakePlan),
- (x => x.ER_RetakePlan.CF_Student),
- (x => x.ER_RetakePlan.ER_RetakePlanSetting),
- (x => x.ER_RetakePlan.ER_RetakePlanSetting.ER_RetakePlanTeachingSetting),
- (x => x.ER_RetakePlan.ER_RetakePlanSettingScheduling)
- ).SingleOrDefault();
- if (retakePlanView == null)
- {
- throw new Exception("不存在此报名信息(请尝试刷新后再试)");
- }
- if (retakePlanView.ER_RetakePlan.RecordStatus != (int)EMIS.ViewModel.ER_RetakePlanStatus.Opened)
- {
- throw new Exception("只能对已开放状态的信息进行报名(请尝试刷新后再试)");
- }
- //查询重修学年学期对应的重修开放控制信息
- var retakeOpenControlView = IRetakeOpenControlServices.Value
- .GetRetakeOpenControl(retakePlanView.ER_RetakePlan.SchoolyearID);
- //对重修开放时间进行判断
- if (retakeOpenControlView == null)
- {
- throw new Exception("重修报名已关闭(请尝试刷新后再试)");
- }
- if (DateTime.Now > retakeOpenControlView.EndDate)
- {
- throw new Exception("重修报名已结束(请尝试刷新后再试)");
- }
- if (DateTime.Now < retakeOpenControlView.StartDate)
- {
- throw new Exception("重修报名即将开始(请尝试刷新后再试)");
- }
- //对人数上限进行判断
- if (retakePlanView.ER_RetakePlan.PeopleNumlimit != null && retakePlanView.ER_RetakePlan.PeopleNumlimit != 0
- && (retakePlanView.ER_RetakePlan.CF_Student.Count() + 1) > retakePlanView.ER_RetakePlan.PeopleNumlimit.Value)
- {
- throw new Exception("报名人数已达上限(请尝试刷新后再试)");
- }
- //对重修课程重复进行判断(同一课程信息ID、同一重修类型、同一重修学年学期、同一课程类型、同一学分、同一开课教研室)
- var retakePlanStudentApply = RetakePlanStudentApplyDAL.RetakePlanRepository
- .GetSingle(x =>
- x.CoursematerialID == retakePlanView.ER_RetakePlan.CoursematerialID
- && x.RetakeTypeID == retakePlanView.ER_RetakePlan.RetakeTypeID
- && x.SchoolyearID == retakePlanView.ER_RetakePlan.SchoolyearID
- //&& x.CourseTypeID == retakePlanView.ER_RetakePlan.CourseTypeID
- //&& x.Credit == retakePlanView.ER_RetakePlan.Credit
- //&& x.ER_RetakePlanSetting.DepartmentID == retakePlanView.ER_RetakePlan.ER_RetakePlanSetting.DepartmentID
- && x.CF_Student.Any(w => w.UserID == UserID));
- if (retakePlanStudentApply != null)
- {
- throw new Exception("您已对此类型的重修课程进行了报名,不允许重复报名");
- }
- //检测重修收费控制(暂时不考虑)
- //对排课冲突进行判断
- var schedulingList = retakePlanView.ER_RetakePlan.ER_RetakePlanSettingScheduling.ToList();
- if (schedulingList.Count > 0)
- {
- foreach (var scheduling in schedulingList)
- {
- var repeatTime = RetakePlanStudentApplyDAL.GetRepeatTime(UserID, retakePlanView.RetakePlanID,
- scheduling.CoursesTimeID, scheduling.Weekday, retakePlanView.ER_RetakePlan.SchoolyearID,
- retakePlanView.ER_RetakePlan.ER_RetakePlanSetting.ER_RetakePlanTeachingSetting.StartWeeklyNum,
- retakePlanView.ER_RetakePlan.ER_RetakePlanSetting.ER_RetakePlanTeachingSetting.EndWeeklyNum
- ).FirstOrDefault();
- if (repeatTime != null)
- {
- if (repeatTime.Type == 1)
- {
- throw new Exception("上课时间冲突,不允许报名(" + repeatTime.DefaultClassName + ")");
- }
- else if (repeatTime.Type == 2)
- {
- throw new Exception("上课时间冲突,不允许报名(" + repeatTime.DefaultClassName + ")");
- }
- else if (repeatTime.Type == 3)
- {
- throw new Exception("上课时间冲突,不允许报名(" + repeatTime.DefaultClassName + ")");
- }
- }
- }
- }
- //查询对应的学生信息View
- var studentView = RetakePlanStudentApplyDAL.StudentRepository
- .GetSingle(x => x.UserID == UserID, (x => x.CF_Classmajor.CF_Grademajor));
- //重修报名
- retakePlanView.ER_RetakePlan.CF_Student.Add(studentView);
- UnitOfWork.Commit();
- ts.Complete();
- }
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
-
- }
- /// <summary>
- /// 学生平台重修取消报名(注:1、检测重修开放时间,2、取消报名控制-暂时不考虑)
- /// </summary>
- /// <param name="RetakePlanStudentID"></param>
- /// <param name="UserID"></param>
- public void CancleApply(Guid RetakePlanStudentID, Guid UserID)
- {
- try
- {
- using (TransactionScope ts = new TransactionScope())
- {
- //查询对应的重修计划名单信息View
- var retakePlanView = RetakePlanStudentApplyDAL.RetakePlanStudentRepository
- .GetList(x => x.RetakePlanStudentID == RetakePlanStudentID,
- (x => x.ER_RetakePlan),
- (x => x.ER_RetakePlan.CF_Student)
- ).SingleOrDefault();
- if (retakePlanView == null)
- {
- throw new Exception("不存在此报名信息(请尝试刷新后再试)");
- }
- if (retakePlanView.ER_RetakePlan.RecordStatus != (int)EMIS.ViewModel.ER_RetakePlanStatus.Opened)
- {
- throw new Exception("只能对已开放状态的信息进行取消报名(请尝试刷新后再试)");
- }
- //查询重修学年学期对应的重修开放控制信息
- var retakeOpenControlView = IRetakeOpenControlServices.Value
- .GetRetakeOpenControl(retakePlanView.ER_RetakePlan.SchoolyearID);
- //对重修开放时间进行判断
- if (retakeOpenControlView == null)
- {
- throw new Exception("重修报名已关闭(请尝试刷新后再试)");
- }
- if (DateTime.Now > retakeOpenControlView.EndDate)
- {
- throw new Exception("重修报名已结束(请尝试刷新后再试)");
- }
- if (DateTime.Now < retakeOpenControlView.StartDate)
- {
- throw new Exception("重修报名即将开始(请尝试刷新后再试)");
- }
- //取消报名控制(暂时不考虑)
- //重修报名取消
- retakePlanView.ER_RetakePlan.CF_Student.RemoveWhere(x => x.UserID == UserID);
- UnitOfWork.Commit();
- ts.Complete();
- }
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
-
- }
- }
- }
|