123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Text;
- using Bowin.Common.Linq;
- using Bowin.Common.Linq.Entity;
- using Bowin.Common.Utility;
- using EMIS.Entities;
- using EMIS.ViewModel;
- using EMIS.ViewModel.EvaluationManage.EvaluationSetting;
- using EMIS.ViewModel.UniversityManage.SpecialtyClassManage;
- using EMIS.DataLogic.EvaluationManage.EvaluationSetting;
- using EMIS.CommonLogic.StudentManage.StudentStatistics;
- namespace EMIS.CommonLogic.EvaluationManage.EvaluationSetting
- {
- public class EvaluationGradeControlServices : BaseServices, IEvaluationGradeControlServices
- {
- public Lazy<EvaluationGradeControlDAL> EvaluationGradeControlDAL { get; set; }
- public Lazy<IInSchoolSettingServices> InSchoolSettingServices { get; set; }
- /// <summary>
- /// 查询对应的年级专业评价控制信息View
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="schoolyearID"></param>
- /// <param name="campusID"></param>
- /// <param name="collegeID"></param>
- /// <param name="gradeID"></param>
- /// <param name="standardID"></param>
- /// <param name="educationID"></param>
- /// <param name="learningformID"></param>
- /// <param name="learnSystem"></param>
- /// <param name="semesterID"></param>
- /// <param name="dateRange"></param>
- /// <param name="inSchoolStatus"></param>
- /// <param name="pageIndex"></param>
- /// <param name="pageSize"></param>
- /// <returns></returns>
- public IGridResultSet<EvaluationGradeControlView> GetEvaluationGradeControlViewGrid(ConfiguretView configuretView, Guid? schoolyearID, Guid? campusID, Guid? collegeID,
- int? gradeID, int? standardID, int? educationID, int? learningformID, string learnSystem, int? semesterID, DateTime? dateRange, int? inSchoolStatus, int pageIndex, int pageSize)
- {
- Expression<Func<EM_EvaluationGradeControl, bool>> expEvaluationGradeControl = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (schoolyearID.HasValue)
- {
- expEvaluationGradeControl = expEvaluationGradeControl.And(x => x.SchoolyearID == schoolyearID);
- }
- if (dateRange.HasValue)
- {
- expEvaluationGradeControl = expEvaluationGradeControl.And(x => x.StartTime <= dateRange);
- }
- if (dateRange.HasValue)
- {
- expEvaluationGradeControl = expEvaluationGradeControl.And(x => x.EndTime >= dateRange);
- }
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (inSchoolStatus != null && inSchoolStatus > -1)
- {
- var inschoolStatusList = InSchoolSettingServices.Value.GetInschoolStatusList(true);
- if (inSchoolStatus == 1)
- {
- expStudent = expStudent.And(x => inschoolStatusList.Contains(x.InSchoolStatusID));
- }
- if (inSchoolStatus == 0)
- {
- expStudent = expStudent.And(x => !inschoolStatusList.Contains(x.InSchoolStatusID));
- }
- }
- var query = EvaluationGradeControlDAL.Value.GetEvaluationGradeControlViewQueryable(expEvaluationGradeControl, expStudent);
- if (campusID.HasValue)
- {
- query = query.Where(x => x.CampusID == campusID);
- }
- if (collegeID.HasValue)
- {
- query = query.Where(x => x.CollegeID == collegeID);
- }
- if (gradeID.HasValue)
- {
- query = query.Where(x => x.GradeID == gradeID);
- }
- if (standardID.HasValue)
- {
- query = query.Where(x => x.StandardID == standardID);
- }
- if (educationID.HasValue)
- {
- query = query.Where(x => x.EducationID == educationID);
- }
- if (learningformID.HasValue)
- {
- query = query.Where(x => x.LearningformID == learningformID);
- }
- if (!string.IsNullOrEmpty(learnSystem) && learnSystem != "-1")
- {
- var LearnSystems = Convert.ToDecimal(learnSystem);
- query = query.Where(x => x.LearnSystem == LearnSystems);
- }
- if (semesterID.HasValue)
- {
- query = query.Where(x => x.SemesterID == semesterID);
- }
- //查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- return this.GetQueryByDataRangeByCollege(query).OrderBy(x => x.CollegeNo.Length).ThenBy(x => x.CollegeNo).ThenBy(x => x.StandardID)
- .ThenBy(x => x.GrademajorCode.Length).ThenBy(x => x.GrademajorCode).OrderBy(x => x.SchoolyearValue).ToGridResultSet<EvaluationGradeControlView>(pageIndex, pageSize);
- }
- /// <summary>
- /// 查询对应的年级专业评价控制信息List
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="schoolyearID"></param>
- /// <param name="campusID"></param>
- /// <param name="collegeID"></param>
- /// <param name="gradeID"></param>
- /// <param name="standardID"></param>
- /// <param name="educationID"></param>
- /// <param name="learningformID"></param>
- /// <param name="learnSystem"></param>
- /// <param name="semesterID"></param>
- /// <param name="dateRange"></param>
- /// <param name="inSchoolStatus"></param>
- /// <returns></returns>
- public IList<EvaluationGradeControlView> GetEvaluationGradeControlViewList(ConfiguretView configuretView, Guid? schoolyearID, Guid? campusID, Guid? collegeID,
- int? gradeID, int? standardID, int? educationID, int? learningformID, string learnSystem, int? semesterID, DateTime? dateRange, int? inSchoolStatus)
- {
- Expression<Func<EM_EvaluationGradeControl, bool>> expEvaluationGradeControl = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (schoolyearID.HasValue)
- {
- expEvaluationGradeControl = expEvaluationGradeControl.And(x => x.SchoolyearID == schoolyearID);
- }
- if (dateRange.HasValue)
- {
- expEvaluationGradeControl = expEvaluationGradeControl.And(x => x.StartTime <= dateRange);
- }
- if (dateRange.HasValue)
- {
- expEvaluationGradeControl = expEvaluationGradeControl.And(x => x.EndTime >= dateRange);
- }
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (inSchoolStatus != null && inSchoolStatus > -1)
- {
- var inschoolStatusList = InSchoolSettingServices.Value.GetInschoolStatusList(true);
- if (inSchoolStatus == 1)
- {
- expStudent = expStudent.And(x => inschoolStatusList.Contains(x.InSchoolStatusID));
- }
- if (inSchoolStatus == 0)
- {
- expStudent = expStudent.And(x => !inschoolStatusList.Contains(x.InSchoolStatusID));
- }
- }
- var query = EvaluationGradeControlDAL.Value.GetEvaluationGradeControlViewQueryable(expEvaluationGradeControl, expStudent);
- if (campusID.HasValue)
- {
- query = query.Where(x => x.CampusID == campusID);
- }
- if (collegeID.HasValue)
- {
- query = query.Where(x => x.CollegeID == collegeID);
- }
- if (gradeID.HasValue)
- {
- query = query.Where(x => x.GradeID == gradeID);
- }
- if (standardID.HasValue)
- {
- query = query.Where(x => x.StandardID == standardID);
- }
- if (educationID.HasValue)
- {
- query = query.Where(x => x.EducationID == educationID);
- }
- if (learningformID.HasValue)
- {
- query = query.Where(x => x.LearningformID == learningformID);
- }
- if (!string.IsNullOrEmpty(learnSystem) && learnSystem != "-1")
- {
- var LearnSystems = Convert.ToDecimal(learnSystem);
- query = query.Where(x => x.LearnSystem == LearnSystems);
- }
- if (semesterID.HasValue)
- {
- query = query.Where(x => x.SemesterID == semesterID);
- }
- //查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- return this.GetQueryByDataRangeByCollege(query).OrderBy(x => x.CollegeNo.Length).ThenBy(x => x.CollegeNo).ThenBy(x => x.StandardID)
- .ThenBy(x => x.GrademajorCode.Length).ThenBy(x => x.GrademajorCode).OrderBy(x => x.SchoolyearValue).ToList();
- }
- /// <summary>
- /// 查询对应的年级专业评价控制信息EvaluationGradeControlView
- /// </summary>
- /// <param name="evaluationGradeControlID"></param>
- /// <returns></returns>
- public EvaluationGradeControlView GetEvaluationGradeControlView(Guid? evaluationGradeControlID)
- {
- try
- {
- var query = EvaluationGradeControlDAL.Value.GetEvaluationGradeControlViewQueryable(x => x.EvaluationGradeControlID == evaluationGradeControlID).SingleOrDefault();
- return query;
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 编辑(注:学年学期在入学学年学期和毕业学年学期范围内)
- /// </summary>
- /// <param name="evaluationGradeControlView"></param>
- public void EvaluationGradeControlEdit(EvaluationGradeControlView evaluationGradeControlView)
- {
- try
- {
- var evaluationGradeControlVerify = EvaluationGradeControlDAL.Value.EvaluationGradeControlRepository.GetList(x => x.EvaluationGradeControlID != evaluationGradeControlView.EvaluationGradeControlID
- && x.SchoolyearID == evaluationGradeControlView.SchoolyearID && x.GrademajorID == evaluationGradeControlView.GrademajorID).SingleOrDefault();
- if (evaluationGradeControlVerify == null)
- {
- if (!evaluationGradeControlView.SchoolyearID.HasValue)
- {
- throw new Exception("学年学期不能为空。");
- }
- var schoolyear = EvaluationGradeControlDAL.Value.SchoolyearRepository.GetList(x => x.SchoolyearID == evaluationGradeControlView.SchoolyearID).SingleOrDefault();
- if (!evaluationGradeControlView.GrademajorID.HasValue)
- {
- throw new Exception("年级专业不能为空。");
- }
- var grademajor = EvaluationGradeControlDAL.Value.GrademajorRepository.GetList(x => x.GrademajorID == evaluationGradeControlView.GrademajorID).SingleOrDefault();
- if (grademajor == null)
- {
- throw new Exception("年级专业信息不存在。");
- }
- var startSchoolyear = EvaluationGradeControlDAL.Value.SchoolyearRepository.GetList(x => x.Years == grademajor.GradeID && x.SchoolcodeID == grademajor.SemesterID).SingleOrDefault();
- var graduateSchoolyear = EvaluationGradeControlDAL.Value.SchoolyearRepository.GetList(x => x.SchoolyearID == grademajor.GraduateSchoolyearID).SingleOrDefault();
- if (startSchoolyear.Value > schoolyear.Value)
- {
- throw new Exception("对应的年级专业中入学学年学期大于当前选择的学年学期(不在入学学年学期范围内)。");
- }
- if (graduateSchoolyear.Value < schoolyear.Value)
- {
- throw new Exception("对应的年级专业中毕业学年学期小于当前选择的学年学期(不在毕业学年学期范围内)。");
- }
- if (evaluationGradeControlView.EvaluationGradeControlID != Guid.Empty)
- {
- var evaluationGradeControl = EvaluationGradeControlDAL.Value.EvaluationGradeControlRepository.GetList(x => x.EvaluationGradeControlID == evaluationGradeControlView.EvaluationGradeControlID).SingleOrDefault();
- if (evaluationGradeControl == null)
- {
- throw new Exception("数据有误,请核查。");
- }
- else
- {
- //表示修改
- evaluationGradeControl.SchoolyearID = evaluationGradeControlView.SchoolyearID;
- evaluationGradeControl.GrademajorID = evaluationGradeControlView.GrademajorID;
- evaluationGradeControl.Number = evaluationGradeControlView.Number;
- evaluationGradeControl.StartTime = evaluationGradeControlView.StartTime;
- evaluationGradeControl.EndTime = evaluationGradeControlView.EndTime;
- SetModifyStatus(evaluationGradeControl);
- }
- }
- else
- {
- //表示新增
- var newEvaluationGradeControl = new EM_EvaluationGradeControl();
- newEvaluationGradeControl.EvaluationGradeControlID = Guid.NewGuid();
- newEvaluationGradeControl.SchoolyearID = evaluationGradeControlView.SchoolyearID;
- newEvaluationGradeControl.GrademajorID = evaluationGradeControlView.GrademajorID;
- newEvaluationGradeControl.Number = evaluationGradeControlView.Number;
- newEvaluationGradeControl.StartTime = evaluationGradeControlView.StartTime;
- newEvaluationGradeControl.EndTime = evaluationGradeControlView.EndTime;
- SetNewStatus(newEvaluationGradeControl);
- UnitOfWork.Add(newEvaluationGradeControl);
- }
- }
- else
- {
- throw new Exception("已存在相同的评价控制信息(学年学期、年级专业唯一),请核查。");
- }
- UnitOfWork.Commit();
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 批量新增(注:学年学期在入学学年学期和毕业学年学期范围内)
- /// </summary>
- /// <param name="grademajorIDList"></param>
- /// <param name="evaluationGradeControlView"></param>
- /// <returns></returns>
- public string EvaluationGradeControlBatchAdd(List<Guid?> grademajorIDList, EvaluationGradeControlView evaluationGradeControlView)
- {
- try
- {
- Expression<Func<EM_EvaluationGradeControl, bool>> expEvaluationGradeControl = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expEvaluationGradeControl = expEvaluationGradeControl.And(x => grademajorIDList.Contains(x.GrademajorID));
- var evaluationGradeControlList = EvaluationGradeControlDAL.Value.EvaluationGradeControlRepository.GetList(expEvaluationGradeControl).ToList();
- var schoolyearList = EvaluationGradeControlDAL.Value.SchoolyearRepository.GetList(x => true).ToList();
- var schoolyear = schoolyearList.Where(x => x.SchoolyearID == evaluationGradeControlView.SchoolyearID).SingleOrDefault();
- if(schoolyear == null)
- {
- throw new Exception("学年学期信息不存在。");
- }
- var grademajorList = EvaluationGradeControlDAL.Value.GrademajorRepository.GetList(x => grademajorIDList.Contains(x.GrademajorID)).ToList();
- int success = 0;
- int fail = 0;
- string tipMessage = null;
- var evaluationGradeControlInList = new List<EM_EvaluationGradeControl>();
- foreach (var grademajorID in grademajorIDList)
- {
- var grademajor = grademajorList.Where(x => x.GrademajorID == grademajorID).SingleOrDefault();
- if (grademajor == null)
- {
- throw new Exception("年级专业信息不存在。");
- }
- var startSchoolyear = schoolyearList.Where(x => x.Years == grademajor.GradeID && x.SchoolcodeID == grademajor.SemesterID).SingleOrDefault();
- if (startSchoolyear.Value <= schoolyear.Value)
- {
- var graduateSchoolyear = schoolyearList.Where(x => x.SchoolyearID == grademajor.GraduateSchoolyearID).SingleOrDefault();
- if (graduateSchoolyear.Value >= schoolyear.Value)
- {
- var evaluationGradeControlVerify = evaluationGradeControlList.Where(x => x.GrademajorID == grademajorID && x.SchoolyearID == evaluationGradeControlView.SchoolyearID).SingleOrDefault();
- if (evaluationGradeControlVerify == null)
- {
- //新增
- var evaluationGradeControl = new EM_EvaluationGradeControl();
- evaluationGradeControl.EvaluationGradeControlID = Guid.NewGuid();
- evaluationGradeControl.SchoolyearID = evaluationGradeControlView.SchoolyearID;
- evaluationGradeControl.GrademajorID = grademajorID;
- evaluationGradeControl.Number = evaluationGradeControlView.Number;
- evaluationGradeControl.StartTime = evaluationGradeControlView.StartTime;
- evaluationGradeControl.EndTime = evaluationGradeControlView.EndTime;
- SetNewStatus(evaluationGradeControl);
- evaluationGradeControlInList.Add(evaluationGradeControl);
- success++;
- }
- else
- {
- //表示已存在相同的评价控制信息
- fail++;
- }
- }
- else
- {
- //表示对应的年级专业中毕业学年学期小于当前选择的学年学期(不在毕业学年学期范围内)
- fail++;
- }
- }
- else
- {
- //表示对应的年级专业中入学学年学期大于当前选择的学年学期(不在入学学年学期范围内)
- fail++;
- }
- }
- UnitOfWork.BulkInsert(evaluationGradeControlInList);
- if (success > 0 && fail <= 0)
- {
- tipMessage = success + "条";
- }
- else
- {
- tipMessage = success + "条," + fail + "条失败,原因:不在入学学年学期范围内、不在毕业学年学期范围内或已存在相同的评价控制信息(学年学期、年级专业唯一),请检查";
- }
- return tipMessage;
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 查询年级专业评价控制中未新增年级专业信息View
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="campusID"></param>
- /// <param name="collegeID"></param>
- /// <param name="gradeID"></param>
- /// <param name="standardID"></param>
- /// <param name="educationID"></param>
- /// <param name="learningformID"></param>
- /// <param name="learnSystem"></param>
- /// <param name="inSchoolStatus"></param>
- /// <param name="schoolyearID"></param>
- /// <param name="pageIndex"></param>
- /// <param name="pageSize"></param>
- /// <returns></returns>
- public IGridResultSet<GrademajorView> GetGrademajorViewNoAddGrid(ConfiguretView configuretView, Guid? campusID, Guid? collegeID, int? gradeID, int? standardID,
- int? educationID, int? learningformID, string learnSystem, int? inSchoolStatus, Guid? schoolyearID, int pageIndex, int pageSize)
- {
- Expression<Func<EM_EvaluationGradeControl, bool>> expEvaluationGradeControl = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expEvaluationGradeControl = expEvaluationGradeControl.And(x => x.SchoolyearID == schoolyearID);
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (inSchoolStatus != null && inSchoolStatus > -1)
- {
- var inschoolStatusList = InSchoolSettingServices.Value.GetInschoolStatusList(true);
- if (inSchoolStatus == 1)
- {
- expStudent = expStudent.And(x => inschoolStatusList.Contains(x.InSchoolStatusID));
- }
- if (inSchoolStatus == 0)
- {
- expStudent = expStudent.And(x => !inschoolStatusList.Contains(x.InSchoolStatusID));
- }
- }
- var query = EvaluationGradeControlDAL.Value.GetGrademajorViewNoAddQueryable(expEvaluationGradeControl, expStudent);
- if (schoolyearID.HasValue)
- {
- var schoolyear = EvaluationGradeControlDAL.Value.SchoolyearRepository.GetList(x => x.SchoolyearID == schoolyearID).SingleOrDefault();
- query = query.Where(x => x.StartValue <= schoolyear.Value);
- query = query.Where(x => x.GraduateValue >= schoolyear.Value);
- }
- if (campusID.HasValue)
- {
- query = query.Where(x => x.CampusID == campusID);
- }
- if (collegeID.HasValue)
- {
- query = query.Where(x => x.CollegeID == collegeID);
- }
- if (gradeID.HasValue)
- {
- query = query.Where(x => x.GradeID == gradeID);
- }
- if (standardID.HasValue)
- {
- query = query.Where(x => x.StandardID == standardID);
- }
- if (educationID.HasValue)
- {
- query = query.Where(x => x.EducationID == educationID);
- }
- if (learningformID.HasValue)
- {
- query = query.Where(x => x.LearningformID == learningformID);
- }
- if (!string.IsNullOrEmpty(learnSystem) && learnSystem != "-1")
- {
- var LearnSystems = Convert.ToDecimal(learnSystem);
- query = query.Where(x => x.LearnSystem == LearnSystems);
- }
- //查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- return this.GetQueryByDataRangeByCollege(query).OrderBy(x => x.CollegeCode.Length).ThenBy(x => x.CollegeCode).ThenBy(x => x.StandardID)
- .ThenBy(x => x.Code.Length).ThenBy(x => x.Code).ToGridResultSet<GrademajorView>(pageIndex, pageSize);
- }
- /// <summary>
- /// 查询年级专业评价控制中未新增年级专业信息List
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="campusID"></param>
- /// <param name="collegeID"></param>
- /// <param name="gradeID"></param>
- /// <param name="standardID"></param>
- /// <param name="educationID"></param>
- /// <param name="learningformID"></param>
- /// <param name="learnSystem"></param>
- /// <param name="inSchoolStatus"></param>
- /// <param name="schoolyearID"></param>
- /// <param name="pageIndex"></param>
- /// <param name="pageSize"></param>
- /// <returns></returns>
- public IList<GrademajorView> GetGrademajorViewNoAddList(ConfiguretView configuretView, Guid? campusID, Guid? collegeID, int? gradeID, int? standardID,
- int? educationID, int? learningformID, string learnSystem, int? inSchoolStatus, Guid? schoolyearID, int pageIndex, int pageSize)
- {
- Expression<Func<EM_EvaluationGradeControl, bool>> expEvaluationGradeControl = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expEvaluationGradeControl = expEvaluationGradeControl.And(x => x.SchoolyearID == schoolyearID);
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (inSchoolStatus != null && inSchoolStatus > -1)
- {
- var inschoolStatusList = InSchoolSettingServices.Value.GetInschoolStatusList(true);
- if (inSchoolStatus == 1)
- {
- expStudent = expStudent.And(x => inschoolStatusList.Contains(x.InSchoolStatusID));
- }
- if (inSchoolStatus == 0)
- {
- expStudent = expStudent.And(x => !inschoolStatusList.Contains(x.InSchoolStatusID));
- }
- }
- var query = EvaluationGradeControlDAL.Value.GetGrademajorViewNoAddQueryable(expEvaluationGradeControl, expStudent);
- if (schoolyearID.HasValue)
- {
- var schoolyear = EvaluationGradeControlDAL.Value.SchoolyearRepository.GetList(x => x.SchoolyearID == schoolyearID).SingleOrDefault();
- query = query.Where(x => x.StartValue <= schoolyear.Value);
- query = query.Where(x => x.GraduateValue >= schoolyear.Value);
- }
- if (campusID.HasValue)
- {
- query = query.Where(x => x.CampusID == campusID);
- }
- if (collegeID.HasValue)
- {
- query = query.Where(x => x.CollegeID == collegeID);
- }
- if (gradeID.HasValue)
- {
- query = query.Where(x => x.GradeID == gradeID);
- }
- if (standardID.HasValue)
- {
- query = query.Where(x => x.StandardID == standardID);
- }
- if (educationID.HasValue)
- {
- query = query.Where(x => x.EducationID == educationID);
- }
- if (learningformID.HasValue)
- {
- query = query.Where(x => x.LearningformID == learningformID);
- }
- if (!string.IsNullOrEmpty(learnSystem) && learnSystem != "-1")
- {
- var LearnSystems = Convert.ToDecimal(learnSystem);
- query = query.Where(x => x.LearnSystem == LearnSystems);
- }
- //查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- return this.GetQueryByDataRangeByCollege(query).OrderBy(x => x.CollegeCode.Length).ThenBy(x => x.CollegeCode).ThenBy(x => x.StandardID)
- .ThenBy(x => x.Code.Length).ThenBy(x => x.Code).ToList();
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="evaluationGradeControlIDs"></param>
- /// <returns></returns>
- public bool EvaluationGradeControlDelete(List<Guid?> evaluationGradeControlIDs)
- {
- try
- {
- UnitOfWork.Delete<EM_EvaluationGradeControl>(x => evaluationGradeControlIDs.Contains(x.EvaluationGradeControlID));
- return true;
- }
- catch (Exception)
- {
- throw;
- }
- }
- }
- }
|