123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786 |
- using System;
- using System.Collections.Generic;
- using System.Data.Entity;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Text;
- using EMIS.DataLogic.CultureplanManage.PlanManagement;
- using EMIS.ViewModel.SelectCourse;
- using EMIS.ViewModel;
- using EMIS.DataLogic.SelectCourse;
- using EMIS.Entities;
- using Bowin.Common.Linq;
- using Bowin.Common.Linq.Entity;
- using EMIS.ViewModel.CacheManage;
- using EMIS.CommonLogic.SystemServices;
- using EMIS.DataLogic.GraduationManage.GraduationManage;
- using EMIS.DataLogic.GraduationManage.GraduationSetting;
- using EMIS.ViewModel.GraduationManage.GraduationManage;
- using EMIS.ViewModel.CultureplanManage.PlanManagement;
- using EMIS.DataLogic.Common.CalendarManage;
- using EMIS.DataLogic.UniversityManage.SpecialtyClassManage;
- using Bowin.Common.Exceptions;
- using EMIS.DataLogic.Repositories;
- namespace EMIS.CommonLogic.SelectCourse
- {
- public class OptionalCourseSettingServices : BaseServices, IOptionalCourseSettingServices
- {
- public ExecutableOptionalCourseTeachingSettingRepository executableOptionalCourseTeachingSettingRepository { get; set; }
- public ExecutableOptionalCourseTeacherRepository executableOptionalCourseTeacherRepository { get; set; }
- public ExecutableOptionalCourseTeachingModeRepository executableOptionalCourseTeachingModeRepository { get; set; }
- public ClassmajorDAL classmajorDAL { get; set; }
- public OptionalCourseSettingDAL optionalCourseSettingDAL { get; set; }
- public OptionalCoursePlanDAL optionalCoursePlanDAL { get; set; }
- public SchoolYearDAL schoolYearDAL { get; set; }
- public GrademajorDAL GrademajorDAL { get; set; }
- public IGridResultSet<OptionalCourseSettingView> GetOptionalCourseSettingViewGrid(ConfiguretView configuretView, Guid? collegeID, int? standardID, Guid? coursematerialID, Guid? schoolYearID, int? Years, int? Status, int? isOpened, int pageIndex, int pageSize)
- {
- Expression<Func<EM_ExecutableOptionalCourse, bool>> openControlSettingExp = (x => true);
- Expression<Func<EM_OptionalCoursePlan, bool>> exp = (x => true);
- Expression<Func<EMIS.Entities.CF_Schoolyear, bool>> schoolYearExp = (x => true);
- Expression<Func<CF_Grademajor, bool>> gradeMajorExp = (x => true);
- //IQueryable<ViewModel.SelectCourse.OptionalCourseSettingView> query =
- // optionalCourseSettingDAL.GetOpenControlSettingView(exp,openControlSettingExp, schoolYearExp, gradeMajorExp)
- // .OrderByDescending(x => x.SchoolYearCode);
- var query = optionalCourseSettingDAL.GetOpenControlSettingView(openControlSettingExp, exp, schoolYearExp, gradeMajorExp);
- if (collegeID.HasValue)
- query = query.Where(x => x.CollegeID == collegeID);
- if (standardID.HasValue)
- query = query.Where(x => x.StandardID == standardID);
- if (coursematerialID.HasValue)
- query = query.Where(x => x.CoursematerialID == coursematerialID);
- if (schoolYearID.HasValue)
- query = query.Where(x => x.SchoolyearID == schoolYearID);
- if (Years.HasValue)
- query = query.Where(x => x.Years == Years);
- if (Status.HasValue)
- query = query.Where(x => x.RecordStatus == Status);
- //if (schoolYearNumID.HasValue)
- // query = query.Where(x => x.SchoolyearNumID == schoolYearNumID);
- //if (schoolCodeID.HasValue)
- // query = query.Where(x => x.SchoolcodeID == schoolCodeID);
- //if (isEnable.HasValue)
- // query = query.Where(x => x.IsEnable == (isEnable == 1 ? true : false));
- if (isOpened.HasValue)
- query = query.Where(x => x.IsOpened == (isOpened == 1 ? true : false));
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue);
- var result = this.GetQueryByDataRangeByCollege(query).OrderBy(x => x.SchoolYearCode).ThenBy(x => x.GrademajorCode).
- ThenBy(x => x.CourseCode).ThenBy(x => x.DefaultClassName).ToGridResultSet<OptionalCourseSettingView>(pageIndex, pageSize);
- //var result = this.GetQueryByDataRangeByCollege(query).OrderBy(x => x.SchoolYearCode).ThenByDescending(x => x.GrademajorCode).ThenBy(x => x.DefaultClassName).ToGridResultSet<OptionalCourseSettingView>(pageIndex, pageSize);
- return result;
- }
- public List<OptionalCourseSettingView> GetOptionalCourseSettingViewList(ConfiguretView configuretView, Guid? collegeID, int? standardID, Guid? coursematerialID, Guid? schoolYearID, int? Years, int? Status, int? isOpened)
- {
- Expression<Func<EM_ExecutableOptionalCourse, bool>> openControlSettingExp = (x => true);
- Expression<Func<EM_OptionalCoursePlan, bool>> exp = (x => true);
- Expression<Func<EMIS.Entities.CF_Schoolyear, bool>> schoolYearExp = (x => true);
- Expression<Func<CF_Grademajor, bool>> gradeMajorExp = (x => true);
- //IQueryable<ViewModel.SelectCourse.OptionalCourseSettingView> query =
- // optionalCourseSettingDAL.GetOpenControlSettingView(exp,openControlSettingExp, schoolYearExp, gradeMajorExp)
- // .OrderByDescending(x => x.SchoolYearCode);
- var query = optionalCourseSettingDAL.GetOpenControlSettingView(openControlSettingExp, exp, schoolYearExp, gradeMajorExp);
- if (collegeID.HasValue)
- query = query.Where(x => x.CollegeID == collegeID);
- if (standardID.HasValue)
- query = query.Where(x => x.StandardID == standardID);
- if (coursematerialID.HasValue)
- query = query.Where(x => x.CoursematerialID == coursematerialID);
- if (schoolYearID.HasValue)
- query = query.Where(x => x.SchoolyearID == schoolYearID);
- if (Years.HasValue)
- query = query.Where(x => x.Years == Years);
- if (Status.HasValue)
- query = query.Where(x => x.RecordStatus == Status);
- //if (schoolYearNumID.HasValue)
- // query = query.Where(x => x.SchoolyearNumID == schoolYearNumID);
- //if (schoolCodeID.HasValue)
- // query = query.Where(x => x.SchoolcodeID == schoolCodeID);
- //if (isEnable.HasValue)
- // query = query.Where(x => x.IsEnable == (isEnable == 1 ? true : false));
- if (isOpened.HasValue)
- query = query.Where(x => x.IsOpened == (isOpened == 1 ? true : false));
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue);
- //var result = this.GetQueryByDataRangeByCollege(query).OrderBy(x => x.SchoolYearCode).ThenByDescending(x => x.GrademajorCode).ThenBy(x => x.DefaultClassName).ToList();
- var result = this.GetQueryByDataRangeByCollege(query).OrderBy(x => x.SchoolYearCode).ThenBy(x => x.GrademajorCode).ThenBy(x => x.CourseCode).ToList();
- return result;
- }
- /// <summary>
- /// 获取限选计划实体
- /// </summary>
- /// <param name="optionalCourseID"></param>
- /// <returns></returns>
- public EM_ExecutableOptionalCourse GetOptionalCourseSettingEntity(Guid? executableOptionalCourseID)
- {
- return optionalCourseSettingDAL.ExecutableOptionalCourseRepository.GetSingle(x => x.ExecutableOptionalCourseID == executableOptionalCourseID);
- }
- // <summary>
- /// 获取限选计划视图
- /// </summary>
- /// <param name="optionalCourseID"></param>
- /// <returns></returns>
- public OptionalCourseSettingView GetOptionalCourseSettingView(Guid? executableOptionalCourseID)
- {
- var query = optionalCourseSettingDAL.GetOpenControlSettingView(x => x.ExecutableOptionalCourseID == executableOptionalCourseID, x => true, x => true, x => true).FirstOrDefault();
- return query;
- }
- /// <summary>
- /// 添加
- /// </summary>
- /// <param name="specialtyPlan"></param>
- /// <returns></returns>
- public void OptionalCourseSettingCreate(OptionalCourseSettingCreateView OptionalCourseSettingView)
- {
- int susCount = 0; //成功数
- int susAddCount = 0; //新增数
- int susUpdateCount = 0; //修改数
- int susNoUpdateCount = 0; //不能修改数
- try
- {
- // var schoolYearList = this.schoolYearDAL.schoolyearRepository.GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).ToList();
- var courseSchoolyear = schoolYearDAL.schoolyearRepository.GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).FirstOrDefault(x => x.SchoolyearID == OptionalCourseSettingView.SchoolyearID);
- //所选年级专业与限选计划的专业匹配,关联出限选计划
- Expression<Func<CF_Grademajor, bool>> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- Expression<Func<EM_OptionalCoursePlan, bool>> opExp = (x => x.IsEnable == true);//&& x.RecordStatus > 0);
- var query = optionalCoursePlanDAL.GetGrademajorOptionalCoursePlanViewQueryable(opExp, exp);
- if (OptionalCourseSettingView.GrademajorID != null) //年级专业不为空时,以年级专业和学年学期为条件查询专业计划表
- {
- query = query.Where(x => x.GrademajorID == OptionalCourseSettingView.GrademajorID);
- }
- else //年级专业为空时,以学年学期为关键条件,联合校区、院系所、年级、专业代码查询专业计划表
- {
- if (OptionalCourseSettingView.CampusID != null)
- {
- query = query.Where(x => x.CampusID == OptionalCourseSettingView.CampusID);
- }
- if (OptionalCourseSettingView.CollegeID != null)
- {
- query = query.Where(x => x.CollegeID == OptionalCourseSettingView.CollegeID);
- }
- if (OptionalCourseSettingView.Years != null)
- {
- query = query.Where(x => x.Years == OptionalCourseSettingView.Years);
- }
- if (OptionalCourseSettingView.StandardID != null)
- {
- query = query.Where(x => x.StandardID == OptionalCourseSettingView.StandardID);
- }
- }
- if (OptionalCourseSettingView.CoursematerialID != null)
- {
- query = query.Where(x => x.CoursematerialID == OptionalCourseSettingView.CoursematerialID);
- }
- query = query.Where(x => x.SchoolValue == courseSchoolyear.Value);
- List<OptionalCoursePlanView> optionalCoursePlanViewList = query.ToList();
- var executableOptionalCourseList = query.Join(optionalCourseSettingDAL.ExecutableOptionalCourseRepository.Entities,
- (x => new { OptionalCourseID = (Guid?)x.OptionalCourseID, x.GrademajorID, SchoolyearID = OptionalCourseSettingView.SchoolyearID }),
- (x => new { x.OptionalCourseID, x.GrademajorID, x.SchoolyearID }),
- (x, y) => y).Include(x => x.EM_ExecutableOptionalCourseTeachingSetting).ToList();
- if (optionalCoursePlanViewList == null || optionalCoursePlanViewList.Count < 1)
- {
- throw new Exception("未能匹配到已启用但未生成的限选计划数据,请核查。");
- }
- var insertList = new List<EM_ExecutableOptionalCourse>();
- var insertTeachingSettingList = new List<EM_ExecutableOptionalCourseTeachingSetting>();
- var insertTeachingModeList = new List<EM_ExecutableOptionalCourseTeachingMode>();
- var updateList = new List<EM_ExecutableOptionalCourse>();
- var updateTechingSettingList = new List<EM_ExecutableOptionalCourseTeachingSetting>();
- foreach (var optionalCourse in optionalCoursePlanViewList)
- {
- EM_ExecutableOptionalCourse executableOptionalCourse = executableOptionalCourseList.FirstOrDefault(
- x => x.OptionalCourseID == optionalCourse.OptionalCourseID && x.GrademajorID == optionalCourse.GrademajorID && x.SchoolyearID == OptionalCourseSettingView.SchoolyearID);
-
- if (executableOptionalCourse != null)
- {
- if (executableOptionalCourse.RecordStatus == (int)EM_SelectCourseResultStatus.NotOpen)
- {
- EM_ExecutableOptionalCourseTeachingSetting ExecutableOptionalCourseTeachingSetting = executableOptionalCourse.EM_ExecutableOptionalCourseTeachingSetting;
- ExecutableOptionalCourseTeachingSetting.Credit = optionalCourse.Credit;
- ExecutableOptionalCourseTeachingSetting.TheoryCourse = optionalCourse.TheoryCourse;
- ExecutableOptionalCourseTeachingSetting.Practicehours = optionalCourse.Practicehours;
- ExecutableOptionalCourseTeachingSetting.Trialhours = optionalCourse.Trialhours;
- ExecutableOptionalCourseTeachingSetting.WeeklyNum = optionalCourse.WeeklyNum;
- ExecutableOptionalCourseTeachingSetting.TheoryWeeklyNum = optionalCourse.TheoryWeeklyNum;
- ExecutableOptionalCourseTeachingSetting.PracticeWeeklyNum = optionalCourse.PracticeWeeklyNum;
- ExecutableOptionalCourseTeachingSetting.TrialWeeklyNum = optionalCourse.TrialWeeklyNum;
- ExecutableOptionalCourseTeachingSetting.StartWeeklyNum = optionalCourse.StartWeeklyNum;
- ExecutableOptionalCourseTeachingSetting.EndWeeklyNum = optionalCourse.EndWeeklyNum;
- ExecutableOptionalCourseTeachingSetting.WeeklyHours = optionalCourse.WeeklyHours;
- SetModifyStatus(executableOptionalCourse);
- executableOptionalCourse.RecordStatus = (int)EM_SelectCourseResultStatus.NotOpen;
- susUpdateCount++;
- updateTechingSettingList.Add(ExecutableOptionalCourseTeachingSetting);
- updateList.Add(executableOptionalCourse);
- }
- else
- {
- susNoUpdateCount++;
- }
-
- }
- else
- {
- executableOptionalCourse = new EM_ExecutableOptionalCourse();
- executableOptionalCourse.ExecutableOptionalCourseID = Guid.NewGuid();
- executableOptionalCourse.DefaultClassName = optionalCourse.DefaultClassName + "_" + optionalCourse.CourseName + "(限选)";
- executableOptionalCourse.IsEnable = false;
- executableOptionalCourse.IsOpened = false;
- SetNewStatus(executableOptionalCourse);
- executableOptionalCourse.RecordStatus = (int)EM_SelectCourseResultStatus.NotOpen;
- //插入限选设定关联班数据
- CF_Classmajor clas = GetClassmajor(optionalCourse.ClassmajorID);
- if (clas != null)
- {
- executableOptionalCourse.CF_Classmajor = new HashSet<CF_Classmajor>();
- executableOptionalCourse.CF_Classmajor.Add(clas);
- }
- susAddCount++;
- executableOptionalCourse.GrademajorID = optionalCourse.GrademajorID;
- executableOptionalCourse.OptionalCourseID = optionalCourse.OptionalCourseID;
- executableOptionalCourse.SchoolyearID = OptionalCourseSettingView.SchoolyearID;
- executableOptionalCourse.DepartmentID = optionalCourse.DepartmentID;
- executableOptionalCourse.CourseStructureID = optionalCourse.CourseStructureID;
- executableOptionalCourse.CourseCategoryID = optionalCourse.CourseCategoryID;
- executableOptionalCourse.CourseTypeID = optionalCourse.CourseTypeID;
- executableOptionalCourse.CourseQualityID = optionalCourse.CourseQualityID;
- executableOptionalCourse.PracticeTypeID = optionalCourse.PracticeTypeID;
- executableOptionalCourse.ExaminationModeID = optionalCourse.ExaminationModeID;
- executableOptionalCourse.TeachinglanguageID = optionalCourse.TeachinglanguageID;
- executableOptionalCourse.PeopleNumlower = optionalCourse.PeopleNumlower;
- executableOptionalCourse.PeopleNumlimit = optionalCourse.PeopleNumlimit;
- executableOptionalCourse.ResultTypeID = optionalCourse.ResultTypeID;
- insertList.Add(executableOptionalCourse);
- EM_ExecutableOptionalCourseTeachingSetting optionalCourseTeachingSetting = new EM_ExecutableOptionalCourseTeachingSetting();
- optionalCourseTeachingSetting.ExecutableOptionalCourseID = executableOptionalCourse.ExecutableOptionalCourseID;
- optionalCourseTeachingSetting.Credit = optionalCourse.Credit;
- optionalCourseTeachingSetting.TheoryCourse = optionalCourse.TheoryCourse;
- optionalCourseTeachingSetting.Practicehours = optionalCourse.Practicehours;
- optionalCourseTeachingSetting.Trialhours = optionalCourse.Trialhours;
- optionalCourseTeachingSetting.WeeklyNum = optionalCourse.WeeklyNum;
- optionalCourseTeachingSetting.TheoryWeeklyNum = optionalCourse.TheoryWeeklyNum;
- optionalCourseTeachingSetting.PracticeWeeklyNum = optionalCourse.PracticeWeeklyNum;
- optionalCourseTeachingSetting.TrialWeeklyNum = optionalCourse.TrialWeeklyNum;
- optionalCourseTeachingSetting.StartWeeklyNum = optionalCourse.StartWeeklyNum;
- optionalCourseTeachingSetting.EndWeeklyNum = optionalCourse.EndWeeklyNum;
- optionalCourseTeachingSetting.WeeklyHours = optionalCourse.WeeklyHours;
- insertTeachingSettingList.Add(optionalCourseTeachingSetting);
- if (optionalCourse.TeachingModeID != null)
- {
- foreach (var i in optionalCourse.TeachingModeID)
- {
- EM_ExecutableOptionalCourseTeachingMode optionalCourseTeachingMode = new EM_ExecutableOptionalCourseTeachingMode();
- optionalCourseTeachingMode.ExecutableOptionalCourseTeachingModeID = Guid.NewGuid();
- optionalCourseTeachingMode.ExecutableOptionalCourseID = executableOptionalCourse.ExecutableOptionalCourseID;
- optionalCourseTeachingMode.TeachingModeID = i;
- SetNewStatus(optionalCourseTeachingMode);
- insertTeachingModeList.Add(optionalCourseTeachingMode);
- }
- }
- }
-
- susCount++;
- }
- UnitOfWork.BatchUpdate(updateList);
- UnitOfWork.BatchUpdate(updateTechingSettingList);
- UnitOfWork.BulkInsert(insertList);
- UnitOfWork.BulkInsert(insertTeachingSettingList);
- UnitOfWork.BulkInsert(insertTeachingModeList);
- //UnitOfWork.Commit();
- if (susNoUpdateCount > 0)
- {
- throw new SuccessException(string.Format("保存成功{0}条记录,其中新增{1}条,更新{2}条,有{3}条已开放,不能修改。", susCount, susAddCount, susUpdateCount,susNoUpdateCount));
- }
- else
- throw new SuccessException(string.Format("保存成功{0}条记录,其中新增{1}条,更新{2}条。", susCount, susAddCount, susUpdateCount));
- //throw new SuccessException(string.Format("新增{0}条。", susAddCount));
- }
- catch (Exception ex)
- {
- throw;
- //throw new Exception(string.Format("保存成功{0}条记录,第{1}条出错," + ex.Message, susCount, susCount + 1));
- }
- }
- /// <summary>
- /// 更新
- /// </summary>
- /// <param name="optionalCourseSettingView"></param>
- /// <returns></returns>
- public void OptionalCourseSettingUpdate(OptionalCourseSettingView optionalCourseSettingView, IList<OptionalCourseTeacherListView> teacherList, IList<OptionalCourseClassListView> classList)
- {
- try
- {
- if (optionalCourseSettingView.ExecutableOptionalCourseID != null && optionalCourseSettingView.ExecutableOptionalCourseID != Guid.Empty)
- {
- EM_ExecutableOptionalCourse optionalCoursePlan = GetOptionalCourseSettingEntity(optionalCourseSettingView.ExecutableOptionalCourseID);
- //EM_ExecutableOptionalCourseTeachingMode optionalCourseTeachingMode = executableOptionalCourseTeachingModeRepository.Entities.Where(x => x.ExecutableOptionalCourseID == optionalCoursePlan.ExecutableOptionalCourseID).SingleOrDefault();
- EM_ExecutableOptionalCourseTeachingSetting optionalCourseTeachingSetting = executableOptionalCourseTeachingSettingRepository.Entities.Where(x => x.ExecutableOptionalCourseID == optionalCoursePlan.ExecutableOptionalCourseID).SingleOrDefault();
- //EM_ExecutableOptionalCourseTeacher optionalCourseTeacher = executableOptionalCourseTeacherRepository.Entities.Where(x=>x.ExecutableOptionalCourseID==optionalCoursePlan.ExecutableOptionalCourseID).SingleOrDefault();
- //CF_Classmajor clas=GetClassmajor(optionalCourseSettingView.ClassmajorID);
- //var classList = GetClassmajorList(optionalCourseSettingView.ExecutableOptionalCourseID);
- if (optionalCoursePlan != null)
- {
- //if (optionalCoursePlan.IsOpened == true && optionalCoursePlan.RecordStatus == (int)EMIS.ViewModel.EM_SelectCourseResultStatus.NotOpen)
- // throw new Exception("只能开放“已提交”状态的数据,请核查,请核查。");
- //var query = optionalCourseSettingDAL.GetOpenControlSettingClassmajorView(x => x.RecordStatus > 0 && x.ExecutableOptionalCourseID == optionalCoursePlan.ExecutableOptionalCourseID).ToList();
- var query = optionalCourseSettingDAL.GetExecutableOptionalCourseClassmajorList().Where(x => x.ExecutableOptionalCourseID == optionalCoursePlan.ExecutableOptionalCourseID).ToList();
- optionalCoursePlan.CF_Classmajor = new HashSet<CF_Classmajor>();
- if (query.Count > 0 && classList.Count > 0)
- {
- //if (optionalCourseSettingIDs.Count > 0)
- //{
- // for (int i = 0; i < optionalCourseSettingIDs.Count; i++)
- // {
- // Guid optionalCourseSettingID = optionalCourseSettingIDs[i];
- // var executableOptionalCourse = optionalCourseSettingDAL.executableOptionalCourseRepository.GetSingle(
- // x => x.ExecutableOptionalCourseID == optionalCourseSettingID);
- // executableOptionalCourse.CF_Classmajor = new HashSet<CF_Classmajor>();
- // UnitOfWork.Delete(executableOptionalCourse, (x => x.CF_Classmajor));
- // }
- //}
- //optionalCoursePlan.CF_Classmajor.Clear();
- //optionalCoursePlan.CF_Classmajor.r;
- //删除限选设定关联班数据
- UnitOfWork.Delete(optionalCoursePlan, (x => x.CF_Classmajor));
- }
- optionalCoursePlan.CF_Classmajor = new HashSet<CF_Classmajor>();
- //插入限选设定关联班数据
- foreach (var list in classList)
- {
- CF_Classmajor clas = GetClassmajor(list.ClassmajorID);
- optionalCoursePlan.CF_Classmajor.Add(clas);
- }
- optionalCoursePlan.DefaultClassName = optionalCourseSettingView.DefaultClassName;
- optionalCoursePlan.DepartmentID = optionalCourseSettingView.DepartmentID;
- optionalCoursePlan.CourseStructureID = optionalCourseSettingView.CourseStructureID;
- optionalCoursePlan.CourseCategoryID = optionalCourseSettingView.CourseCategoryID;
- optionalCoursePlan.CourseTypeID = optionalCourseSettingView.CourseTypeID;
- optionalCoursePlan.CourseQualityID = optionalCourseSettingView.CourseQualityID;
- optionalCoursePlan.PracticeTypeID = optionalCourseSettingView.PracticeTypeID;
- optionalCoursePlan.ExaminationModeID = optionalCourseSettingView.ExaminationModeID;
- optionalCoursePlan.TeachinglanguageID = optionalCourseSettingView.TeachinglanguageID;
- optionalCoursePlan.IsEnable = optionalCourseSettingView.IsEnable;
- //optionalCoursePlan.No = optionalCourseSettingView.No;
- //optionalCoursePlan.HandleModeID = optionalCourseSettingView.HandleModeID;
- //optionalCoursePlan.IsNeedMaterial = optionalCourseSettingView.IsNeedMaterial;
- optionalCoursePlan.PeopleNumlower = optionalCourseSettingView.PeopleNumlower;
- optionalCoursePlan.PeopleNumlimit = optionalCourseSettingView.PeopleNumlimit;
- optionalCoursePlan.IsOpened = optionalCourseSettingView.IsOpened;
- optionalCoursePlan.ResultTypeID = optionalCourseSettingView.ResultTypeID;
- optionalCoursePlan.Remarks = optionalCourseSettingView.Remarks;
- if (optionalCourseSettingView.TeachingModeID != null)
- {
- UnitOfWork.Delete<EM_ExecutableOptionalCourseTeachingMode>(x => x.ExecutableOptionalCourseID == optionalCourseSettingView.ExecutableOptionalCourseID);
- foreach (var i in optionalCourseSettingView.TeachingModeID)
- {
- EM_ExecutableOptionalCourseTeachingMode optionalCourseTeachingMode = new EM_ExecutableOptionalCourseTeachingMode();
- optionalCourseTeachingMode.ExecutableOptionalCourseTeachingModeID = Guid.NewGuid();
- optionalCourseTeachingMode.ExecutableOptionalCourseID = optionalCoursePlan.ExecutableOptionalCourseID;
- optionalCourseTeachingMode.TeachingModeID = i;
- SetNewStatus(optionalCourseTeachingMode);
- UnitOfWork.Add(optionalCourseTeachingMode);
- }
- }
- //限选设定授课方式表
- //if (optionalCourseTeachingMode != null)
- //{
- // SetModifyStatus(optionalCourseTeachingMode);
- //}
- //else
- //{
- // optionalCourseTeachingMode = new EM_ExecutableOptionalCourseTeachingMode();
- // optionalCourseTeachingMode.ExecutableOptionalCourseTeachingModeID = Guid.NewGuid();
- // optionalCourseTeachingMode.ExecutableOptionalCourseID = optionalCoursePlan.ExecutableOptionalCourseID;
- // optionalCourseTeachingMode.TeachingModeID = optionalCourseSettingView.TeachingModeID;
- // SetNewStatus(optionalCourseTeachingMode);
- // UnitOfWork.Add(optionalCourseTeachingMode);
- //}
- //optionalCourseTeachingMode.TeachingModeID = optionalCourseSettingView.TeachingModeID;
- ////限选设定授课老师表
- //if (optionalCourseTeacher != null)
- //{
- // SetModifyStatus(optionalCourseTeacher);
- //}
- //else
- //{
- // optionalCourseTeacher = new EM_ExecutableOptionalCourseTeacher();
- // optionalCourseTeacher.ExecutableOptionalCourseTeacherID = Guid.NewGuid();
- // optionalCourseTeacher.ExecutableOptionalCourseID = optionalCoursePlan.ExecutableOptionalCourseID;
- // SetNewStatus(optionalCourseTeacher);
- // UnitOfWork.Add(optionalCourseTeacher);
- //}
- ////optionalCourseTeacher.UserID = optionalCourseSettingView.TeacherID;
- //optionalCourseTeacher.TeachingMethod = optionalCourseSettingView.TeachingMethod;
- //删除教师
- UnitOfWork.Delete<EM_ExecutableOptionalCourseTeacher>(x => x.ExecutableOptionalCourseID == optionalCoursePlan.ExecutableOptionalCourseID);
- //添加教师
- if (teacherList.Count > 0)
- {
- foreach (var teacher in teacherList)
- {
- EM_ExecutableOptionalCourseTeacher executableOptionalCourseTeacher = new EM_ExecutableOptionalCourseTeacher();
- executableOptionalCourseTeacher.ExecutableOptionalCourseTeacherID = Guid.NewGuid();
- executableOptionalCourseTeacher.ExecutableOptionalCourseID = optionalCoursePlan.ExecutableOptionalCourseID;
- executableOptionalCourseTeacher.UserID = teacher.UserID;
- executableOptionalCourseTeacher.TeachingMethod = teacher.TeachingMethod;
- SetNewStatus(executableOptionalCourseTeacher);
- UnitOfWork.Add(executableOptionalCourseTeacher);
- }
- }
- //限选设定教学设置表
- if (optionalCourseTeachingSetting != null)
- {
- UnitOfWork.Update(optionalCourseTeachingSetting);
- }
- else
- {
- optionalCourseTeachingSetting = new EM_ExecutableOptionalCourseTeachingSetting();
- optionalCourseTeachingSetting.ExecutableOptionalCourseID = optionalCourseSettingView.ExecutableOptionalCourseID.Value;
- UnitOfWork.Add(optionalCourseTeachingSetting);
- }
- optionalCourseTeachingSetting.Credit = optionalCourseSettingView.Credit;
- optionalCourseTeachingSetting.TheoryCourse = optionalCourseSettingView.TheoryCourse;
- optionalCourseTeachingSetting.Practicehours = optionalCourseSettingView.Practicehours;
- optionalCourseTeachingSetting.Trialhours = optionalCourseSettingView.Trialhours;
- optionalCourseTeachingSetting.WeeklyNum = optionalCourseSettingView.WeeklyNum;
- if (optionalCourseSettingView.WeeklyNum == 0 || optionalCourseSettingView.WeeklyNum == null)
- {
- var t = (optionalCourseSettingView.TheoryCourse.Value + optionalCourseSettingView.Practicehours.Value);
- var w = (optionalCourseSettingView.TheoryWeeklyNum.Value + optionalCourseSettingView.PracticeWeeklyNum.Value);
- if (w != 0 && t != 0)
- optionalCourseTeachingSetting.WeeklyNum = t / w / 2;
- }
- optionalCourseTeachingSetting.TheoryWeeklyNum = optionalCourseSettingView.TheoryWeeklyNum;
- optionalCourseTeachingSetting.PracticeWeeklyNum = optionalCourseSettingView.PracticeWeeklyNum;
- optionalCourseTeachingSetting.TrialWeeklyNum = optionalCourseSettingView.TrialWeeklyNum;
- optionalCourseTeachingSetting.StartWeeklyNum = optionalCourseSettingView.StartWeeklyNum;
- optionalCourseTeachingSetting.EndWeeklyNum = optionalCourseSettingView.EndWeeklyNum;
- optionalCourseTeachingSetting.WeeklyHours = optionalCourseSettingView.WeeklyHours;
- this.SetModifyStatus(optionalCoursePlan);
- UnitOfWork.Commit();
- }
- }
- else
- {
- var optionalCourse=optionalCourseSettingDAL.ExecutableOptionalCourseRepository.GetSingle(
- x => x.OptionalCourseID==optionalCourseSettingView.OptionalCourseID
- &&x.SchoolyearID==optionalCourseSettingView.SchoolyearID
- &&x.GrademajorID==optionalCourseSettingView.GrademajorID);
- if (optionalCourse!=null)
- {
- throw new Exception("已存在重复的数据。");
- }
- EM_ExecutableOptionalCourse optionalCoursePlan = new EM_ExecutableOptionalCourse();
- optionalCoursePlan.ExecutableOptionalCourseID = Guid.NewGuid();
- optionalCoursePlan.OptionalCourseID = optionalCourseSettingView.OptionalCourseID;
- optionalCoursePlan.SchoolyearID = optionalCourseSettingView.SchoolyearID;
- optionalCoursePlan.GrademajorID = optionalCourseSettingView.GrademajorID;
- optionalCoursePlan.DepartmentID = optionalCourseSettingView.DepartmentID;
- optionalCoursePlan.DefaultClassName = optionalCourseSettingView.DefaultClassName;
- optionalCoursePlan.CourseStructureID=optionalCourseSettingView.CourseStructureID;
- optionalCoursePlan.CourseCategoryID=optionalCourseSettingView.CourseCategoryID;
- optionalCoursePlan.CourseTypeID=optionalCourseSettingView.CourseTypeID;
- optionalCoursePlan.CourseQualityID=optionalCourseSettingView.CourseQualityID;
- optionalCoursePlan.PracticeTypeID=optionalCourseSettingView.PracticeTypeID;
- optionalCoursePlan.ExaminationModeID=optionalCourseSettingView.ExaminationModeID;
- optionalCoursePlan.TeachinglanguageID=optionalCourseSettingView.TeachinglanguageID;
- optionalCoursePlan.IsEnable = optionalCourseSettingView.IsEnable;
- optionalCoursePlan.ResultTypeID=optionalCourseSettingView.ResultTypeID;
- optionalCoursePlan.Remarks=optionalCourseSettingView.Remarks;
- optionalCoursePlan.PeopleNumlimit=optionalCourseSettingView.PeopleNumlimit;
- optionalCoursePlan.PeopleNumlower=optionalCourseSettingView.PeopleNumlower;
- optionalCoursePlan.IsOpened = optionalCourseSettingView.IsOpened;
- this.SetNewStatus(optionalCoursePlan);
-
- optionalCoursePlan.CF_Classmajor = new HashSet<CF_Classmajor>();
- //插入限选设定关联班数据
- foreach (var list in classList)
- {
- CF_Classmajor clas = GetClassmajor(list.ClassmajorID);
- optionalCoursePlan.CF_Classmajor.Add(clas);
- }
- UnitOfWork.Add(optionalCoursePlan);
- if (optionalCourseSettingView.TeachingModeID != null)
- {
- foreach (var i in optionalCourseSettingView.TeachingModeID)
- {
- EM_ExecutableOptionalCourseTeachingMode optionalCourseTeachingMode = new EM_ExecutableOptionalCourseTeachingMode();
- optionalCourseTeachingMode.ExecutableOptionalCourseTeachingModeID = Guid.NewGuid();
- optionalCourseTeachingMode.ExecutableOptionalCourseID = optionalCoursePlan.ExecutableOptionalCourseID;
- optionalCourseTeachingMode.TeachingModeID = i;
- SetNewStatus(optionalCourseTeachingMode);
- UnitOfWork.Add(optionalCourseTeachingMode);
- }
- }
- if (teacherList.Count > 0)
- {
- foreach (var teacher in teacherList)
- {
- EM_ExecutableOptionalCourseTeacher executableOptionalCourseTeacher = new EM_ExecutableOptionalCourseTeacher();
- executableOptionalCourseTeacher.ExecutableOptionalCourseTeacherID = Guid.NewGuid();
- executableOptionalCourseTeacher.ExecutableOptionalCourseID = optionalCoursePlan.ExecutableOptionalCourseID;
- executableOptionalCourseTeacher.UserID = teacher.UserID;
- executableOptionalCourseTeacher.TeachingMethod = teacher.TeachingMethod;
- SetNewStatus(executableOptionalCourseTeacher);
- UnitOfWork.Add(executableOptionalCourseTeacher);
- }
- }
- EM_ExecutableOptionalCourseTeachingSetting optionalCourseTeachingSetting = new EM_ExecutableOptionalCourseTeachingSetting();
- optionalCourseTeachingSetting.ExecutableOptionalCourseID = optionalCoursePlan.ExecutableOptionalCourseID;
- optionalCourseTeachingSetting.Credit = optionalCourseSettingView.Credit;
- optionalCourseTeachingSetting.TheoryCourse = optionalCourseSettingView.TheoryCourse;
- optionalCourseTeachingSetting.Practicehours = optionalCourseSettingView.Practicehours;
- optionalCourseTeachingSetting.Trialhours = optionalCourseSettingView.Trialhours;
- optionalCourseTeachingSetting.WeeklyNum = optionalCourseSettingView.WeeklyNum;
- if (optionalCourseSettingView.WeeklyNum == 0 || optionalCourseSettingView.WeeklyNum == null)
- {
- var t = (optionalCourseSettingView.TheoryCourse.Value + optionalCourseSettingView.Practicehours.Value);
- var w = (optionalCourseSettingView.TheoryWeeklyNum.Value + optionalCourseSettingView.PracticeWeeklyNum.Value);
- if (w != 0 && t != 0)
- optionalCourseTeachingSetting.WeeklyNum = t / w / 2;
- }
- optionalCourseTeachingSetting.TheoryWeeklyNum = optionalCourseSettingView.TheoryWeeklyNum;
- optionalCourseTeachingSetting.PracticeWeeklyNum = optionalCourseSettingView.PracticeWeeklyNum;
- optionalCourseTeachingSetting.TrialWeeklyNum = optionalCourseSettingView.TrialWeeklyNum;
- optionalCourseTeachingSetting.StartWeeklyNum = optionalCourseSettingView.StartWeeklyNum;
- optionalCourseTeachingSetting.EndWeeklyNum = optionalCourseSettingView.EndWeeklyNum;
- optionalCourseTeachingSetting.WeeklyHours = optionalCourseSettingView.WeeklyHours;
- UnitOfWork.Commit();
- }
- }
- catch (Exception)
- {
- throw;
- }
- }
- public List<string> GetTeachingModeType(Guid? specialtyCourseID)
- {
- return optionalCourseSettingDAL.GetTeachingModeTypeQueryble(specialtyCourseID);
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="optionalCourseIDs"></param>
- /// <returns></returns>
- public bool OptionalCourseSettingDelete(List<Guid> optionalCourseSettingIDs)
- {
- try
- {
- if (optionalCourseSettingIDs.Count > 0)
- {
- for (int i = 0; i < optionalCourseSettingIDs.Count; i++)
- {
- Guid optionalCourseSettingID = optionalCourseSettingIDs[i];
- var executableOptionalCourse = optionalCourseSettingDAL.ExecutableOptionalCourseRepository.GetSingle(
- x => x.ExecutableOptionalCourseID == optionalCourseSettingID);
- if (executableOptionalCourse != null)
- {
- if (executableOptionalCourse.RecordStatus > (int)EMIS.ViewModel.EM_SelectCourseResultStatus.NotOpen)
- throw new Exception("只能删除未开放状态的信息。");
- //if (executableOptionalCourse.IsEnable==true)
- // throw new Exception("该限选已启用不能能删除。");
- if (executableOptionalCourse.RecordStatus == (int)EMIS.ViewModel.EM_SelectCourseResultStatus.Opened)
- throw new Exception("只能删除未开放状态的信息。");
- }
- executableOptionalCourse.CF_Classmajor = new HashSet<CF_Classmajor>();
- executableOptionalCourse.CF_Student = new HashSet<CF_Student>();
- UnitOfWork.Delete(executableOptionalCourse, (x => x.CF_Classmajor));
- UnitOfWork.Delete(executableOptionalCourse, (x => x.CF_Student));
- }
- //EM_ExecutableOptionalCourse em = new EM_ExecutableOptionalCourse();
- //em.CF_Classmajor = new HashSet<CF_Classmajor>();
- ////optionalCoursePlan.CF_Classmajor.Clear();
- ////optionalCoursePlan.CF_Classmajor.r;
- //UnitOfWork.Delete(em.ExecutableOptionalCourseID., x => x.CF_Classmajor);
- //限选设定教学设置表
- UnitOfWork.Delete<EM_ExecutableOptionalCourseTeachingSetting>(x => optionalCourseSettingIDs.Contains(x.ExecutableOptionalCourseID));
- //限选设定授课老师表
- UnitOfWork.Delete<EM_ExecutableOptionalCourseTeacher>(x => optionalCourseSettingIDs.Contains(x.ExecutableOptionalCourseID.Value));
- //限选设定授课方式表
- UnitOfWork.Delete<EM_ExecutableOptionalCourseTeachingMode>(x => optionalCourseSettingIDs.Contains(x.ExecutableOptionalCourseID.Value));
- //限选计划
- UnitOfWork.Delete<EM_ExecutableOptionalCourse>(x => optionalCourseSettingIDs.Contains(x.ExecutableOptionalCourseID));
- return true;
- }
- return false;
- }
- catch (Exception)
- {
- throw;
- }
- }
- /// <summary>
- /// 现在是开放操作
- /// </summary>
- /// <param name="optionalCourseIDs"></param>
- /// <returns></returns>
- public bool OptionalCourseSettingSubmit(List<Guid> optionalCourseSettingIDs)
- {
- try
- {
- if (optionalCourseSettingIDs.Count > 0)
- {
- //Expression<Func<EM_ExecutableOptionalCourse, bool>> exp = (x => true);
- //Expression<Func<EM_OptionalCoursePlan, bool>> exp1 = (x => true);
- //Expression<Func<EMIS.Entities.CF_Schoolyear, bool>> exp2 = (x => true);
- //Expression<Func<CF_Grademajor, bool>> exp3 = (x => true);
- for (int i = 0; i < optionalCourseSettingIDs.Count; i++)
- {
- Guid optionalCourseSettingID = optionalCourseSettingIDs[i];
- var executableOptionalCourse = optionalCourseSettingDAL.ExecutableOptionalCourseRepository.GetSingle(
- x => x.ExecutableOptionalCourseID == optionalCourseSettingID && (x.RecordStatus == (int)EMIS.ViewModel.EM_SelectCourseResultStatus.NotOpen || x.RecordStatus == (int)EMIS.ViewModel.EM_SelectCourseResultStatus.CancleCreate));
- if (executableOptionalCourse != null)
- {
- EM_OptionalCoursePlan ocp = optionalCoursePlanDAL.OptionalCoursePlanRepository.GetSingle(x => x.OptionalCourseID == executableOptionalCourse.OptionalCourseID);
- //查询要开放的限选设定及相关班级
- var query = optionalCourseSettingDAL.GetSubmitcompareClassmajor().Where(x => x.ExecutableOptionalCourseID == executableOptionalCourse.ExecutableOptionalCourseID);
- List<Guid> clas = query.Select(x => x.ClassmajorID).ToList(); //相关班级ID
- //查询所有限选设定及相关班级
- var query1 = optionalCourseSettingDAL.GetSubmitcompareClassmajor().Where(x =>
- x.ExecutableOptionalCourseID != executableOptionalCourse.ExecutableOptionalCourseID &&
- x.SchoolyearID == executableOptionalCourse.SchoolyearID &&
- x.CoursematerialID == ocp.CoursematerialID);
- var list = query1.ToList();
- //查询要开放的限选设定及相关授课老师ID
- var teacherList = optionalCourseSettingDAL.GetEducationMissionClassTeacherListViewQueryble().
- Where(x => x.ExecutableOptionalCourseID == executableOptionalCourse.ExecutableOptionalCourseID).
- Select(x => x.UserID).ToList();
- if (teacherList.Count > 0) //有授课老师才进行判断
- {
- //查询要开放的数据中班级是否有重复
- var result = list.Where(x => optionalCourseSettingIDs.Contains(x.ExecutableOptionalCourseID) && clas.Contains(x.ClassmajorID)).ToList();
- if (result.Count > 0)
- { //班级重复的数据中查询老师是否也是重复
- var IDs = result.Select(x => x.ExecutableOptionalCourseID).ToList();
- var teacher = optionalCourseSettingDAL.ExecutableOptionalCourseRepository.Entities.Where(x =>
- IDs.Contains(x.ExecutableOptionalCourseID) &&
- x.ExecutableOptionalCourseID != executableOptionalCourse.ExecutableOptionalCourseID &&
- x.EM_ExecutableOptionalCourseTeacher.Count() == teacherList.Count &&
- x.EM_ExecutableOptionalCourseTeacher.Count() == (x.EM_ExecutableOptionalCourseTeacher.
- Where(w => teacherList.Contains(w.UserID.Value)).Count()));
- if (teacher.ToList().Count > 0)
- throw new Exception(string.Format("【{0}】和【{1}】存在相同的开放班级和授课老师,请核查。", result[0].DefaultClassName, executableOptionalCourse.DefaultClassName));
- //throw new Exception(string.Format("【{0}】和【{1}】存在相同的开放班级,请核查。", result[0].DefaultClassName, executableOptionalCourse.DefaultClassName));
- }
- var result1 = list.Where(x => x.RecordStatus > (int)EMIS.ViewModel.EM_SelectCourseResultStatus.NotOpen && clas.Contains(x.ClassmajorID)).ToList();
- if (result1.Count > 0)
- {
- var IDs = result1.Select(x => x.ExecutableOptionalCourseID).ToList();
- var teacher = optionalCourseSettingDAL.ExecutableOptionalCourseRepository.Entities.Where(x =>
- IDs.Contains(x.ExecutableOptionalCourseID) &&
- x.EM_ExecutableOptionalCourseTeacher.Count() == teacherList.Count &&
- x.EM_ExecutableOptionalCourseTeacher.Count() == (x.EM_ExecutableOptionalCourseTeacher.
- Where(w => teacherList.Contains(w.UserID.Value)).Count()));
- if (teacher.ToList().Count > 0)
- throw new Exception(string.Format("已开放的【{0}】和准备开放的【{1}】存在相同的开放班级和授课老师,请核查。", result1[0].DefaultClassName, executableOptionalCourse.DefaultClassName));
- //throw new Exception(string.Format("已开放的【{0}】和准备开放的【{1}】存在相同的开放班级,请核查。", result1[0].DefaultClassName, executableOptionalCourse.DefaultClassName));
- }
- }
- executableOptionalCourse.RecordStatus = (int)EM_SelectCourseResultStatus.Opened;
- }
- else
- throw new Exception("当前状态的数据不能开放,请核查");
- }
- UnitOfWork.Commit();
- return true;
- }
- return false;
- }
- catch (Exception)
- {
- throw;
- }
- }
- //取消开放
- public bool OptionalCourseSettingCancel(List<Guid?> optionalCourseSettingIDs)
- {
- try
- {
- if (optionalCourseSettingIDs.Count > 0)
- {
- var ExecutableOptionalCourseList = optionalCourseSettingDAL.ExecutableOptionalCourseRepository.GetList(x => optionalCourseSettingIDs.Contains(x.ExecutableOptionalCourseID)).ToList();
- foreach (var ExecutableOptionalCourse in ExecutableOptionalCourseList)
- {
- if (ExecutableOptionalCourse.RecordStatus < (int)EMIS.ViewModel.EM_SelectCourseResultStatus.Opened) //开放状态
- {
- throw new Exception("限选设定未开放");
- }
- }
- UnitOfWork.Update<EM_ExecutableOptionalCourse>(x => new EM_ExecutableOptionalCourse { RecordStatus = (int)EMIS.ViewModel.EM_SelectCourseResultStatus.NotOpen }, x => optionalCourseSettingIDs.Contains(x.ExecutableOptionalCourseID));
- this.UnitOfWork.Commit();
- return true;
- }
- return false;
- }
- catch (Exception)
- {
- throw;
- }
- }
- /// <summary>
- /// 获取授课老师
- /// </summary>
- /// <param name="educationMissionClassID"></param>
- /// <returns></returns>
- public List<OptionalCourseTeacherListView> GetEducationMissionClassTeacherListViewList(Guid executableOptionalCourseID)
- {
- return optionalCourseSettingDAL.GetEducationMissionClassTeacherListViewQueryble().Where(x => x.ExecutableOptionalCourseID == executableOptionalCourseID).OrderBy(x => x.TeachingMethod).ToList();
- }
- public List<OptionalCourseClassListView> GetClassmajorList(Guid? executableOptionalCourseID)
- {
- //查询条件
- var query = optionalCourseSettingDAL.GetExecutableOptionalCourseClassmajorList().Where(x => x.ExecutableOptionalCourseID == executableOptionalCourseID).OrderBy(x => x.No).ToList();
- return query;
- //return classmajorDAL.classmajorRepository.GetSingle(w => w.ClassmajorID == classmajorID);
- }
- public CF_Classmajor GetClassmajor(Guid? classmajorID)
- {
- //查询条件
- return classmajorDAL.ClassmajorRepository.GetSingle(w => w.ClassmajorID == classmajorID);
- }
- }
- }
|