12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Linq.Expressions;
- using System.Transactions;
- using Bowin.Common.Linq;
- using Bowin.Common.Data;
- using Bowin.Common.Linq.Entity;
- using EMIS.Entities;
- using EMIS.ViewModel;
- using EMIS.ViewModel.EvaluationManage.StudentEvaluation;
- using EMIS.ViewModel.EducationManage.EducationArrange;
- using EMIS.DataLogic.EvaluationManage.StudentEvaluation;
- using EMIS.DataLogic.EvaluationManage.EvaluationTable;
- using EMIS.CommonLogic.StudentManage.StudentStatistics;
- namespace EMIS.CommonLogic.EvaluationManage.StudentEvaluation
- {
- public class EvaluationStudentSettingServices : BaseServices, IEvaluationStudentSettingServices
- {
- public EvaluationStudentSettingDAL EvaluationStudentSettingDAL { get; set; }
- public EvaluationTableDAL EvaluationTableDAL { 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="departmentID"></param>
- /// <param name="coursematerialID"></param>
- /// <param name="courseTypeID"></param>
- /// <param name="teachingModeID"></param>
- /// <param name="staffID"></param>
- /// <param name="teachingMethodID"></param>
- /// <param name="evaluationTableID"></param>
- /// <param name="openState"></param>
- /// <param name="pageIndex"></param>
- /// <param name="pageSize"></param>
- /// <returns></returns>
- public IGridResultSet<EvaluationStudentSettingView> GetEvaluationStudentSettingViewGrid(ConfiguretView configuretView, Guid? schoolyearID, Guid? campusID, Guid? collegeID,
- Guid? departmentID, Guid? coursematerialID, int? courseTypeID, int? handleModeID, int? teachingModeID, Guid? staffID, int? teachingMethodID, Guid? evaluationTableID, int? openState, int pageIndex, int pageSize)
- {
- Expression<Func<EM_EvaluationStudentSetting, bool>> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (staffID.HasValue)
- {
- exp = exp.And(x => x.UserID == staffID);
- }
- if (teachingMethodID.HasValue)
- {
- exp = exp.And(x => x.TeachingMethodID == teachingMethodID);
- }
- if (evaluationTableID.HasValue)
- {
- exp = exp.And(x => x.EvaluationTableID == evaluationTableID);
- }
- if (openState.HasValue)
- {
- if (openState.Value == (int)CF_GeneralPurpose.IsYes)
- {
- exp = exp.And(x => x.OpenState == true);
- }
- if (openState.Value == (int)CF_GeneralPurpose.IsNo)
- {
- exp = exp.And(x => x.OpenState != true);
- }
- }
- var query = EvaluationStudentSettingDAL.GetEvaluationStudentSettingViewQueryable(exp);
- if (schoolyearID.HasValue)
- {
- query = query.Where(x => x.SchoolyearID == schoolyearID);
- }
- if (campusID.HasValue)
- {
- query = query.Where(x => x.CampusID == campusID);
- }
- if (collegeID.HasValue)
- {
- query = query.Where(x => x.CollegeID == collegeID);
- }
- if (departmentID.HasValue)
- {
- query = query.Where(x => x.DepartmentID == departmentID);
- }
- if (coursematerialID.HasValue)
- {
- query = query.Where(x => x.CoursematerialID == coursematerialID);
- }
- if (courseTypeID.HasValue)
- {
- query = query.Where(x => x.CourseTypeID == courseTypeID);
- }
- if (handleModeID.HasValue)
- {
- query = query.Where(x => x.HandleModeID == handleModeID);
- }
- if (teachingModeID.HasValue)
- {
- query = query.Where(x => x.TeachingModeID == teachingModeID);
- }
- //查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- return this.GetQueryByDataRangeByDepartment(query, x => x.DepartmentID).OrderBy(x => x.SchoolyearValue).ThenBy(x => x.DepartmentNo.Length)
- .ThenBy(x => x.DepartmentNo).ThenBy(x => x.CourseCode.Length).ThenBy(x => x.CourseCode).ThenBy(x => x.CourseTypeID).ThenBy(x => x.TeachingModeID).ToGridResultSet<EvaluationStudentSettingView>(pageIndex, pageSize);
- }
- /// <summary>
- /// 查询对应的学评设定信息List
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="schoolyearID"></param>
- /// <param name="campusID"></param>
- /// <param name="collegeID"></param>
- /// <param name="departmentID"></param>
- /// <param name="coursematerialID"></param>
- /// <param name="courseTypeID"></param>
- /// <param name="teachingModeID"></param>
- /// <param name="staffID"></param>
- /// <param name="teachingMethodID"></param>
- /// <param name="evaluationTableID"></param>
- /// <param name="openState"></param>
- /// <returns></returns>
- public IList<EvaluationStudentSettingView> GetEvaluationStudentSettingViewList(ConfiguretView configuretView, Guid? schoolyearID, Guid? campusID, Guid? collegeID,
- Guid? departmentID, Guid? coursematerialID, int? courseTypeID, int? handleModeID, int? teachingModeID, Guid? staffID, int? teachingMethodID, Guid? evaluationTableID, int? openState)
- {
- Expression<Func<EM_EvaluationStudentSetting, bool>> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (staffID.HasValue)
- {
- exp = exp.And(x => x.UserID == staffID);
- }
- if (teachingMethodID.HasValue)
- {
- exp = exp.And(x => x.TeachingMethodID == teachingMethodID);
- }
- if (evaluationTableID.HasValue)
- {
- exp = exp.And(x => x.EvaluationTableID == evaluationTableID);
- }
- if (openState.HasValue)
- {
- if (openState.Value == (int)CF_GeneralPurpose.IsYes)
- {
- exp = exp.And(x => x.OpenState == true);
- }
- if (openState.Value == (int)CF_GeneralPurpose.IsNo)
- {
- exp = exp.And(x => x.OpenState != true);
- }
- }
- var query = EvaluationStudentSettingDAL.GetEvaluationStudentSettingViewQueryable(exp);
- if (schoolyearID.HasValue)
- {
- query = query.Where(x => x.SchoolyearID == schoolyearID);
- }
- if (campusID.HasValue)
- {
- query = query.Where(x => x.CampusID == campusID);
- }
- if (collegeID.HasValue)
- {
- query = query.Where(x => x.CollegeID == collegeID);
- }
- if (departmentID.HasValue)
- {
- query = query.Where(x => x.DepartmentID == departmentID);
- }
- if (coursematerialID.HasValue)
- {
- query = query.Where(x => x.CoursematerialID == coursematerialID);
- }
- if (courseTypeID.HasValue)
- {
- query = query.Where(x => x.CourseTypeID == courseTypeID);
- }
- if (handleModeID.HasValue)
- {
- query = query.Where(x => x.HandleModeID == handleModeID);
- }
- if (teachingModeID.HasValue)
- {
- query = query.Where(x => x.TeachingModeID == teachingModeID);
- }
- //查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- return this.GetQueryByDataRangeByDepartment(query, x => x.DepartmentID).OrderBy(x => x.SchoolyearValue).ThenBy(x => x.DepartmentNo.Length)
- .ThenBy(x => x.DepartmentNo).ThenBy(x => x.CourseCode.Length).ThenBy(x => x.CourseCode).ThenBy(x => x.CourseTypeID).ThenBy(x => x.TeachingModeID).ToList();
- }
- /// <summary>
- /// 查询对应的学评设定信息EvaluationStudentSettingView
- /// </summary>
- /// <param name="evaluationStudentSettingID"></param>
- /// <returns></returns>
- public EvaluationStudentSettingView GetEvaluationStudentSettingView(Guid? evaluationStudentSettingID)
- {
- try
- {
- Expression<Func<EM_EvaluationStudentSetting, bool>> exp = (x => x.EvaluationStudentSettingID == evaluationStudentSettingID);
- var query = EvaluationStudentSettingDAL.GetEvaluationStudentSettingViewQueryable(exp).SingleOrDefault();
- return query;
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 评价生成
- /// </summary>
- /// <param name="campusID"></param>
- /// <param name="collegeID"></param>
- /// <param name="departmentID"></param>
- /// <param name="gradeID"></param>
- /// <param name="standardID"></param>
- /// <param name="coursematerialID"></param>
- /// <param name="courseTypeID"></param>
- /// <param name="handleModeID"></param>
- /// <param name="teachingModeID"></param>
- /// <param name="staffID"></param>
- /// <param name="teachingMethodID"></param>
- /// <param name="schoolyearID"></param>
- /// <returns></returns>
- public string EvaluationStudentSettingCreate(Guid? campusID, Guid? collegeID, Guid? departmentID, int? gradeID, int? standardID, Guid? coursematerialID, int? courseTypeID, int? handleModeID,
- int? teachingModeID, Guid? staffID, int? teachingMethodID, Guid? schoolyearID)
- {
- try
- {
- var schoolyear = EvaluationStudentSettingDAL.SchoolyearRepository.GetList(x => x.SchoolyearID == schoolyearID).SingleOrDefault();
- if (schoolyear == null)
- {
- throw new Exception("选择的学年学期有误,请核查。");
- }
- var evaluationParticipateType = EvaluationStudentSettingDAL.EvaluationParticipateTypeRepository.GetList(x => x.ParticipateTypeID == (int)EM_ParticipateType.Student).SingleOrDefault();
- if (evaluationParticipateType == null)
- {
- throw new Exception("对应的参评类型不存在,请核查。");
- }
- Expression<Func<EM_EvaluationTable, bool>> expEvaluationTable = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expEvaluationTable = expEvaluationTable.And(x => x.IsEnabled == true);
- expEvaluationTable = expEvaluationTable.And(x => x.EvaluationParticipateTypeID == evaluationParticipateType.EvaluationParticipateTypeID);
- var evaluationTableViewList = EvaluationTableDAL.GetEvaluationTableViewQueryable(expEvaluationTable).ToList();
- Expression<Func<EM_EducationMissionClass, bool>> expEducationMissionClass = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expEducationMissionClass = expEducationMissionClass.And(x => x.RecordStatus == (int)EM_EducationMissionClassStatus.Submitted || x.RecordStatus == (int)EM_EducationMissionClassStatus.Scheduled);
- Expression<Func<CF_Classmajor, bool>> expClassmajor = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- bool classmajorHasValue = false;
- if (gradeID.HasValue)
- {
- expClassmajor = expClassmajor.And(x => x.CF_Grademajor.GradeID == gradeID);
- classmajorHasValue = true;
- }
- if (standardID.HasValue)
- {
- expClassmajor = expClassmajor.And(x => x.CF_Grademajor.CF_Facultymajor.StandardID == standardID);
- classmajorHasValue = true;
- }
- if (classmajorHasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.CF_Classmajor.AsQueryable().Any(expClassmajor));
- }
- if (coursematerialID.HasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.CoursematerialID == coursematerialID);
- }
- if (courseTypeID.HasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.CourseTypeID == courseTypeID);
- }
- if (handleModeID.HasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.HandleModeID == handleModeID);
- }
- if (teachingModeID.HasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.TeachingModeID == teachingModeID);
- }
- var query = EvaluationStudentSettingDAL.GetEducationMissionClassViewQueryable(expEducationMissionClass);
- if (campusID.HasValue)
- {
- query = query.Where(x => x.CampusID == campusID);
- }
- if (collegeID.HasValue)
- {
- query = query.Where(x => x.CollegeID == collegeID);
- }
- if (departmentID.HasValue)
- {
- query = query.Where(x => x.DepartmentID == departmentID);
- }
- if (staffID.HasValue)
- {
- query = query.Where(x => x.UserID == staffID);
- }
- if (teachingMethodID.HasValue)
- {
- query = query.Where(x => x.TeachingMethodID == teachingMethodID);
- }
- if (schoolyearID.HasValue)
- {
- query = query.Where(x => x.SchoolyearID == schoolyearID);
- }
- var educationMissionClassViewList = this.GetQueryByDataRangeByDepartment(query).ToList();
- if (educationMissionClassViewList == null || educationMissionClassViewList.Count() <= 0)
- {
- throw new Exception("对应的教学任务班评价信息为空,请核查(如:任务状态为未提交)。");
- }
- var educationMissionClassIDList = educationMissionClassViewList.Select(x => x.EducationMissionClassID).Distinct().ToList();
- var evaluationStudentSettingList = EvaluationStudentSettingDAL.EvaluationStudentSettingRepository.GetList(x => educationMissionClassIDList.Contains(x.EducationMissionClassID.Value)).ToList();
- int inSuccess = 0;
- int upSuccess = 0;
- int fail = 0;
- string tipMessage = null;
- var evaluationStudentSettingInList = new List<EM_EvaluationStudentSetting>();
- var evaluationStudentSettingUpList = new List<EM_EvaluationStudentSetting>();
- foreach (var educationMissionClassView in educationMissionClassViewList)
- {
- var evaluationTableList = evaluationTableViewList.Where(x => x.TeachingModeIDList.Contains(educationMissionClassView.TeachingModeID)).ToList();
- if (evaluationTableList == null || evaluationTableList.Count() <= 0)
- {
- fail++;
- }
- else if (evaluationTableList != null && evaluationTableList.Count() > 1)
- {
- fail++;
- }
- else
- {
- var evaluationTable = evaluationTableList.Where(x => true).SingleOrDefault();
- var educlStudentList = EvaluationStudentSettingDAL.GetEducationMissionClassStudentQueryable(x => x.EducationMissionClassID == educationMissionClassView.EducationMissionClassID).ToList();
- var evaluationStudentSettingVerify = evaluationStudentSettingList.Where(x => x.EducationMissionClassID == educationMissionClassView.EducationMissionClassID && x.UserID == educationMissionClassView.UserID).SingleOrDefault();
- if (evaluationStudentSettingVerify == null)
- {
- var newEvaluationStudentSetting = new EM_EvaluationStudentSetting();
- newEvaluationStudentSetting.EvaluationStudentSettingID = Guid.NewGuid();
- newEvaluationStudentSetting.EducationMissionClassID = educationMissionClassView.EducationMissionClassID;
- newEvaluationStudentSetting.EvaluationTableID = evaluationTable.EvaluationTableID;
- newEvaluationStudentSetting.UserID = educationMissionClassView.UserID;
- newEvaluationStudentSetting.TeachingMethodID = educationMissionClassView.TeachingMethodID;
- newEvaluationStudentSetting.OpenState = false;
- newEvaluationStudentSetting.Remark = educationMissionClassView.Remark;
- SetNewStatus(newEvaluationStudentSetting);
- evaluationStudentSettingInList.Add(newEvaluationStudentSetting);
- educlStudentList.ForEach(x => newEvaluationStudentSetting.CF_Student.Add(x));
- inSuccess++;
- }
- else
- {
- if (evaluationStudentSettingVerify.OpenState != true)
- {
- evaluationStudentSettingVerify.EvaluationTableID = evaluationTable.EvaluationTableID;
- }
- evaluationStudentSettingVerify.TeachingMethodID = educationMissionClassView.TeachingMethodID;
- SetModifyStatus(evaluationStudentSettingVerify);
- evaluationStudentSettingUpList.Add(evaluationStudentSettingVerify);
- var evaluationStudentList = EvaluationStudentSettingDAL.GetEvaluationStudentSettingStudentQueryable(x => x.EvaluationStudentSettingID == evaluationStudentSettingVerify.EvaluationStudentSettingID).ToList();
- foreach (var educlStudent in educlStudentList)
- {
- var student = evaluationStudentList.Where(x => x.UserID == educlStudent.UserID).SingleOrDefault();
- if (student == null)
- {
- evaluationStudentSettingVerify.CF_Student.Add(educlStudent);
- }
- }
- upSuccess++;
- }
- }
- }
- using (TransactionScope ts = new TransactionScope())
- {
- UnitOfWork.BulkInsert(evaluationStudentSettingInList);
- UnitOfWork.BulkInsert(evaluationStudentSettingInList, (x => x.CF_Student));
- if (evaluationStudentSettingUpList != null && evaluationStudentSettingUpList.Count() > 0)
- {
- UnitOfWork.BatchUpdate(evaluationStudentSettingUpList);
- }
- UnitOfWork.BulkInsert(evaluationStudentSettingUpList, (x => x.CF_Student));
- ts.Complete();
- }
- if (upSuccess <= 0 && fail <= 0)
- {
- tipMessage = inSuccess + "条";
- }
- else
- {
- if (upSuccess > 0 && fail <= 0)
- {
- tipMessage = inSuccess + "条,更新成功" + upSuccess + "条";
- }
- else
- {
- tipMessage = inSuccess + "条,更新成功" + upSuccess + "条,失败" + fail + "条,原因:对应的评价表无法匹配,请检查";
- }
- }
- return tipMessage;
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 编辑
- /// </summary>
- /// <param name="evaluationStudentSettingView"></param>
- public void EvaluationStudentSettingEdit(EvaluationStudentSettingView evaluationStudentSettingView)
- {
- try
- {
- if (!evaluationStudentSettingView.EducationMissionClassID.HasValue || evaluationStudentSettingView.EducationMissionClassID == Guid.Empty)
- {
- throw new Exception("对应的教学任务数据有误,请核查。");
- }
- var evaluationStudentSettingVerify = EvaluationStudentSettingDAL.EvaluationStudentSettingRepository.GetList(x => x.EvaluationStudentSettingID != evaluationStudentSettingView.EvaluationStudentSettingID
- && x.EducationMissionClassID == evaluationStudentSettingView.EducationMissionClassID && x.UserID == evaluationStudentSettingView.UserID).SingleOrDefault();
- if (evaluationStudentSettingVerify == null)
- {
- var evaluationStudentSettingInList = new List<EM_EvaluationStudentSetting>();
- var evaluationStudentSettingUpList = new List<EM_EvaluationStudentSetting>();
- var educlStudentList = EvaluationStudentSettingDAL.GetEducationMissionClassStudentQueryable(x => x.EducationMissionClassID == evaluationStudentSettingView.EducationMissionClassID).ToList();
- if (evaluationStudentSettingView.EvaluationStudentSettingID != Guid.Empty)
- {
- var evaluationStudentSetting = EvaluationStudentSettingDAL.EvaluationStudentSettingRepository.GetList(x => x.EvaluationStudentSettingID == evaluationStudentSettingView.EvaluationStudentSettingID).SingleOrDefault();
- if (evaluationStudentSetting == null)
- {
- throw new Exception("数据有误,请核查。");
- }
- else
- {
- //表示修改
- evaluationStudentSetting.EvaluationTableID = evaluationStudentSettingView.EvaluationTableID;
- evaluationStudentSetting.UserID = evaluationStudentSettingView.UserID;
- evaluationStudentSetting.TeachingMethodID = evaluationStudentSettingView.TeachingMethodID;
- evaluationStudentSetting.Remark = evaluationStudentSettingView.Remark;
- SetModifyStatus(evaluationStudentSetting);
- evaluationStudentSettingUpList.Add(evaluationStudentSetting);
- var evaluationStudentList = EvaluationStudentSettingDAL.GetEvaluationStudentSettingStudentQueryable(x => x.EvaluationStudentSettingID == evaluationStudentSetting.EvaluationStudentSettingID).ToList();
- foreach (var educlStudent in educlStudentList)
- {
- var student = evaluationStudentList.Where(x => x.UserID == educlStudent.UserID).SingleOrDefault();
- if (student == null)
- {
- evaluationStudentSetting.CF_Student.Add(educlStudent);
- }
- }
- }
- }
- else
- {
- //表示新增
- var newEvaluationStudentSetting = new EM_EvaluationStudentSetting();
- newEvaluationStudentSetting.EvaluationStudentSettingID = Guid.NewGuid();
- newEvaluationStudentSetting.EducationMissionClassID = evaluationStudentSettingView.EducationMissionClassID;
- newEvaluationStudentSetting.EvaluationTableID = evaluationStudentSettingView.EvaluationTableID;
- newEvaluationStudentSetting.UserID = evaluationStudentSettingView.UserID;
- newEvaluationStudentSetting.TeachingMethodID = evaluationStudentSettingView.TeachingMethodID;
- newEvaluationStudentSetting.OpenState = false;
- newEvaluationStudentSetting.Remark = evaluationStudentSettingView.Remark;
- SetNewStatus(newEvaluationStudentSetting);
- evaluationStudentSettingInList.Add(newEvaluationStudentSetting);
- educlStudentList.ForEach(x => newEvaluationStudentSetting.CF_Student.Add(x));
- }
- using (TransactionScope ts = new TransactionScope())
- {
- UnitOfWork.BulkInsert(evaluationStudentSettingInList);
- UnitOfWork.BulkInsert(evaluationStudentSettingInList, (x => x.CF_Student));
- if (evaluationStudentSettingUpList != null && evaluationStudentSettingUpList.Count() > 0)
- {
- UnitOfWork.BatchUpdate(evaluationStudentSettingUpList);
- }
- UnitOfWork.BulkInsert(evaluationStudentSettingUpList, (x => x.CF_Student));
- ts.Complete();
- }
- }
- else
- {
- throw new Exception("已存在相同的学生评价信息(教学任务班、任课教师唯一),请核查。");
- }
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 批量新增
- /// </summary>
- /// <param name="educationMissionClassViewList"></param>
- /// <param name="evaluationStudentSettingView"></param>
- /// <returns></returns>
- public string EvaluationStudentSettingBatchAdd(List<EducationMissionClassView> educationMissionClassViewList, EvaluationStudentSettingView evaluationStudentSettingView)
- {
- try
- {
- var schoolyear = EvaluationStudentSettingDAL.SchoolyearRepository.GetList(x => x.SchoolyearID == evaluationStudentSettingView.SchoolyearID).SingleOrDefault();
- if (schoolyear == null)
- {
- throw new Exception("选择的学年学期有误,请核查。");
- }
- var evaluationParticipateType = EvaluationStudentSettingDAL.EvaluationParticipateTypeRepository.GetList(x => x.ParticipateTypeID == (int)EM_ParticipateType.Student).SingleOrDefault();
- if (evaluationParticipateType == null)
- {
- throw new Exception("对应的参评类型不存在,请核查。");
- }
- Expression<Func<EM_EvaluationTable, bool>> expEvaluationTable = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expEvaluationTable = expEvaluationTable.And(x => x.IsEnabled == true);
- expEvaluationTable = expEvaluationTable.And(x => x.EvaluationParticipateTypeID == evaluationParticipateType.EvaluationParticipateTypeID);
- var evaluationTableViewList = EvaluationTableDAL.GetEvaluationTableViewQueryable(expEvaluationTable).ToList();
- var educationMissionClassIDList = educationMissionClassViewList.Select(x => x.EducationMissionClassID).Distinct().ToList();
- var evaluationStudentSettingList = EvaluationStudentSettingDAL.EvaluationStudentSettingRepository.GetList(x => educationMissionClassIDList.Contains(x.EducationMissionClassID.Value)).ToList();
- int success = 0;
- int fail = 0;
- string tipMessage = null;
- var evaluationStudentSettingInList = new List<EM_EvaluationStudentSetting>();
- foreach (var educationMissionClassView in educationMissionClassViewList)
- {
- var evaluationTableList = evaluationTableViewList.Where(x => x.TeachingModeIDList.Contains(educationMissionClassView.TeachingModeID)).ToList();
- if (evaluationTableList == null || evaluationTableList.Count() <= 0)
- {
- fail++;
- }
- else if (evaluationTableList != null && evaluationTableList.Count() > 1)
- {
- fail++;
- }
- else
- {
- var evaluationTable = evaluationTableList.Where(x => true).SingleOrDefault();
- var educlStudentList = EvaluationStudentSettingDAL.GetEducationMissionClassStudentQueryable(x => x.EducationMissionClassID == educationMissionClassView.EducationMissionClassID).ToList();
- var evaluationStudentSettingVerify = evaluationStudentSettingList.Where(x => x.EducationMissionClassID == educationMissionClassView.EducationMissionClassID && x.UserID == educationMissionClassView.UserID).SingleOrDefault();
- if (evaluationStudentSettingVerify == null)
- {
- var newEvaluationStudentSetting = new EM_EvaluationStudentSetting();
- newEvaluationStudentSetting.EvaluationStudentSettingID = Guid.NewGuid();
- newEvaluationStudentSetting.EducationMissionClassID = educationMissionClassView.EducationMissionClassID;
- newEvaluationStudentSetting.EvaluationTableID = evaluationTable.EvaluationTableID;
- newEvaluationStudentSetting.UserID = educationMissionClassView.UserID;
- newEvaluationStudentSetting.TeachingMethodID = educationMissionClassView.TeachingMethodID;
- newEvaluationStudentSetting.OpenState = false;
- newEvaluationStudentSetting.Remark = educationMissionClassView.Remark;
- SetNewStatus(newEvaluationStudentSetting);
- evaluationStudentSettingInList.Add(newEvaluationStudentSetting);
- educlStudentList.ForEach(x => newEvaluationStudentSetting.CF_Student.Add(x));
- success++;
- }
- else
- {
- fail++;
- }
- }
- }
- using (TransactionScope ts = new TransactionScope())
- {
- UnitOfWork.BulkInsert(evaluationStudentSettingInList);
- UnitOfWork.BulkInsert(evaluationStudentSettingInList, (x => x.CF_Student));
- ts.Complete();
- }
- 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="departmentID"></param>
- /// <param name="gradeID"></param>
- /// <param name="standardID"></param>
- /// <param name="coursematerialID"></param>
- /// <param name="courseTypeID"></param>
- /// <param name="handleModeID"></param>
- /// <param name="teachingModeID"></param>
- /// <param name="staffID"></param>
- /// <param name="teachingMethodID"></param>
- /// <param name="schoolyearID"></param>
- /// <param name="pageIndex"></param>
- /// <param name="pageSize"></param>
- /// <returns></returns>
- public IGridResultSet<EducationMissionClassView> GetEducationMissionClassViewNoAddGrid(ConfiguretView configuretView, Guid? campusID, Guid? collegeID, Guid? departmentID,
- int? gradeID, int? standardID, Guid? coursematerialID, int? courseTypeID, int? handleModeID, int? teachingModeID, Guid? staffID, int? teachingMethodID, Guid? schoolyearID, int pageIndex, int pageSize)
- {
- Expression<Func<EM_EducationMission, bool>> expEducationMission = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expEducationMission = expEducationMission.And(x => x.SchoolyearID == schoolyearID);
- if (collegeID.HasValue)
- {
- expEducationMission = expEducationMission.And(x => x.CollegeID == collegeID);
- }
- if (departmentID.HasValue)
- {
- expEducationMission = expEducationMission.And(x => x.DepartmentID == departmentID);
- }
- Expression<Func<EM_EducationMissionClass, bool>> expEducationMissionClass = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expEducationMissionClass = expEducationMissionClass.And(x => x.RecordStatus == (int)EM_EducationMissionClassStatus.Submitted || x.RecordStatus == (int)EM_EducationMissionClassStatus.Scheduled);
- Expression<Func<CF_Classmajor, bool>> expClassmajor = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- bool classmajorHasValue = false;
- if (gradeID.HasValue)
- {
- expClassmajor = expClassmajor.And(x => x.CF_Grademajor.GradeID == gradeID);
- classmajorHasValue = true;
- }
- if (standardID.HasValue)
- {
- expClassmajor = expClassmajor.And(x => x.CF_Grademajor.CF_Facultymajor.StandardID == standardID);
- classmajorHasValue = true;
- }
- if (classmajorHasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.CF_Classmajor.AsQueryable().Any(expClassmajor));
- }
- if (coursematerialID.HasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.CoursematerialID == coursematerialID);
- }
- if (courseTypeID.HasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.CourseTypeID == courseTypeID);
- }
- if (handleModeID.HasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.HandleModeID == handleModeID);
- }
- if (teachingModeID.HasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.TeachingModeID == teachingModeID);
- }
- var query = EvaluationStudentSettingDAL.GetEducationMissionClassViewNoAddQueryable(expEducationMission, expEducationMissionClass);
- if (campusID.HasValue)
- {
- query = query.Where(x => x.CampusID == campusID);
- }
- if (staffID.HasValue)
- {
- query = query.Where(x => x.UserID == staffID);
- }
- if (teachingMethodID.HasValue)
- {
- query = query.Where(x => x.TeachingMethodID == teachingMethodID);
- }
- //查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- return this.GetQueryByDataRangeByDepartment(query, x => x.DepartmentID).OrderBy(x => x.SchoolyearValue).ThenBy(x => x.DepartmentNo.Length)
- .ThenBy(x => x.DepartmentNo).ThenBy(x => x.CourseCode.Length).ThenBy(x => x.CourseCode).ThenBy(x => x.CourseTypeID).ThenBy(x => x.TeachingModeID).ToGridResultSet<EducationMissionClassView>(pageIndex, pageSize);
- }
- /// <summary>
- /// 查询教学任务班中未新增学生评价信息List
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="campusID"></param>
- /// <param name="collegeID"></param>
- /// <param name="departmentID"></param>
- /// <param name="gradeID"></param>
- /// <param name="standardID"></param>
- /// <param name="coursematerialID"></param>
- /// <param name="courseTypeID"></param>
- /// <param name="handleModeID"></param>
- /// <param name="teachingModeID"></param>
- /// <param name="staffID"></param>
- /// <param name="teachingMethodID"></param>
- /// <param name="schoolyearID"></param>
- /// <returns></returns>
- public IList<EducationMissionClassView> GetEducationMissionClassViewNoAddList(ConfiguretView configuretView, Guid? campusID, Guid? collegeID, Guid? departmentID,
- int? gradeID, int? standardID, Guid? coursematerialID, int? courseTypeID, int? handleModeID, int? teachingModeID, Guid? staffID, int? teachingMethodID, Guid? schoolyearID)
- {
- Expression<Func<EM_EducationMission, bool>> expEducationMission = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expEducationMission = expEducationMission.And(x => x.SchoolyearID == schoolyearID);
- if (collegeID.HasValue)
- {
- expEducationMission = expEducationMission.And(x => x.CollegeID == collegeID);
- }
- if (departmentID.HasValue)
- {
- expEducationMission = expEducationMission.And(x => x.DepartmentID == departmentID);
- }
- Expression<Func<EM_EducationMissionClass, bool>> expEducationMissionClass = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expEducationMissionClass = expEducationMissionClass.And(x => x.RecordStatus == (int)EM_EducationMissionClassStatus.Submitted || x.RecordStatus == (int)EM_EducationMissionClassStatus.Scheduled);
- Expression<Func<CF_Classmajor, bool>> expClassmajor = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- bool classmajorHasValue = false;
- if (gradeID.HasValue)
- {
- expClassmajor = expClassmajor.And(x => x.CF_Grademajor.GradeID == gradeID);
- classmajorHasValue = true;
- }
- if (standardID.HasValue)
- {
- expClassmajor = expClassmajor.And(x => x.CF_Grademajor.CF_Facultymajor.StandardID == standardID);
- classmajorHasValue = true;
- }
- if (classmajorHasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.CF_Classmajor.AsQueryable().Any(expClassmajor));
- }
- if (coursematerialID.HasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.CoursematerialID == coursematerialID);
- }
- if (courseTypeID.HasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.CourseTypeID == courseTypeID);
- }
- if (handleModeID.HasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.HandleModeID == handleModeID);
- }
- if (teachingModeID.HasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.TeachingModeID == teachingModeID);
- }
- var query = EvaluationStudentSettingDAL.GetEducationMissionClassViewNoAddQueryable(expEducationMission, expEducationMissionClass);
- if (campusID.HasValue)
- {
- query = query.Where(x => x.CampusID == campusID);
- }
- if (staffID.HasValue)
- {
- query = query.Where(x => x.UserID == staffID);
- }
- if (teachingMethodID.HasValue)
- {
- query = query.Where(x => x.TeachingMethodID == teachingMethodID);
- }
- //查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- return this.GetQueryByDataRangeByDepartment(query, x => x.DepartmentID).OrderBy(x => x.SchoolyearValue).ThenBy(x => x.DepartmentNo.Length)
- .ThenBy(x => x.DepartmentNo).ThenBy(x => x.CourseCode.Length).ThenBy(x => x.CourseCode).ThenBy(x => x.CourseTypeID).ThenBy(x => x.TeachingModeID).ToList();
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="evaluationStudentSettingIDs"></param>
- /// <returns></returns>
- public bool EvaluationStudentSettingDelete(List<Guid?> evaluationStudentSettingIDs)
- {
- try
- {
- var evaluationStudentList = EvaluationStudentSettingDAL.EvaluationStudentRepository.GetList(x => evaluationStudentSettingIDs.Contains(x.EvaluationStudentSettingID)).ToList();
- if (evaluationStudentList == null || evaluationStudentList.Count() <= 0)
- {
- var evaluationStudentSettingList = EvaluationStudentSettingDAL.EvaluationStudentSettingRepository.GetList(x => evaluationStudentSettingIDs.Contains(x.EvaluationStudentSettingID), (x => x.CF_Student)).ToList();
- using (TransactionScope ts = new TransactionScope())
- {
- foreach (var evaluationStudentSetting in evaluationStudentSettingList)
- {
- //evaluationStudentSetting.CF_Student = new HashSet<CF_Student>();
- UnitOfWork.Delete(evaluationStudentSetting, (x => x.CF_Student));
- UnitOfWork.Delete<EM_EvaluationStudentSetting>(x => x.EvaluationStudentSettingID == evaluationStudentSetting.EvaluationStudentSettingID);
- //evaluationStudentSetting.CF_Student.RemoveWhere(x => true);
- //UnitOfWork.RemoveRange(evaluationStudentSetting.CF_Student);
- //UnitOfWork.Remove(evaluationStudentSetting);
- }
- //this.UnitOfWork.Commit();
- ts.Complete();
- return true;
- }
- }
- else
- {
- throw new Exception("选择删除的信息中,存在已评价信息无法删除。");
- }
- }
- catch (Exception)
- {
- throw;
- }
- }
- /// <summary>
- /// 查询学生评价中对应的学生名单信息View
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="evaluationStudentSettingID"></param>
- /// <param name="isEvaluation"></param>
- /// <param name="inSchoolStatus"></param>
- /// <param name="pageIndex"></param>
- /// <param name="pageSize"></param>
- /// <returns></returns>
- public IGridResultSet<EvaluationStudentSettingDetailView> GetEvaluationStudentSettingDetailViewGrid(ConfiguretView configuretView, Guid? evaluationStudentSettingID, int? isEvaluation, int? inSchoolStatus, int pageIndex, int pageSize)
- {
- Expression<Func<EM_EvaluationStudentSetting, bool>> expEvaluationStudentSetting = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expEvaluationStudentSetting = expEvaluationStudentSetting.And(x => x.EvaluationStudentSettingID == evaluationStudentSettingID);
- Expression<Func<EM_EducationMissionClass, bool>> expEducationMissionClass = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- Expression<Func<EM_EducationMission, bool>> expEducationMission = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- 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 = EvaluationStudentSettingDAL.GetEvaluationStudentSettingDetailViewQueryable(expEvaluationStudentSetting, expEducationMissionClass, expEducationMission, expStudent);
- if (isEvaluation.HasValue)
- {
- if (isEvaluation.Value == (int)CF_GeneralPurpose.IsYes)
- {
- query = query.Where(x => x.IsEvaluation == true);
- }
- if (isEvaluation.Value == (int)CF_GeneralPurpose.IsNo)
- {
- query = query.Where(x => x.IsEvaluation != true);
- }
- }
- //查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- return query.OrderBy(x => x.StudentNo).ThenBy(x => x.ClassmajorNo.Length).ThenBy(x => x.ClassmajorNo).ToGridResultSet<EvaluationStudentSettingDetailView>(pageIndex, pageSize);
- }
- /// <summary>
- /// 查询学生评价中对应的学生名单信息List
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="evaluationStudentSettingID"></param>
- /// <param name="isEvaluation"></param>
- /// <param name="inSchoolStatus"></param>
- /// <returns></returns>
- public IList<EvaluationStudentSettingDetailView> GetEvaluationStudentSettingDetailViewList(ConfiguretView configuretView, Guid? evaluationStudentSettingID, int? isEvaluation, int? inSchoolStatus)
- {
- Expression<Func<EM_EvaluationStudentSetting, bool>> expEvaluationStudentSetting = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expEvaluationStudentSetting = expEvaluationStudentSetting.And(x => x.EvaluationStudentSettingID == evaluationStudentSettingID);
- Expression<Func<EM_EducationMissionClass, bool>> expEducationMissionClass = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- Expression<Func<EM_EducationMission, bool>> expEducationMission = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- 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 = EvaluationStudentSettingDAL.GetEvaluationStudentSettingDetailViewQueryable(expEvaluationStudentSetting, expEducationMissionClass, expEducationMission, expStudent);
- if (isEvaluation.HasValue)
- {
- if (isEvaluation.Value == (int)CF_GeneralPurpose.IsYes)
- {
- query = query.Where(x => x.IsEvaluation == true);
- }
- if (isEvaluation.Value == (int)CF_GeneralPurpose.IsNo)
- {
- query = query.Where(x => x.IsEvaluation != true);
- }
- }
- //查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- return query.OrderBy(x => x.StudentNo).ThenBy(x => x.ClassmajorNo.Length).ThenBy(x => x.ClassmajorNo).ToList();
- }
- /// <summary>
- /// 编辑学生
- /// </summary>
- /// <param name="evaluationStudentSettingID"></param>
- /// <param name="userID"></param>
- public void EvaluationStudentEdit(Guid? evaluationStudentSettingID, Guid? userID)
- {
- try
- {
- var evaluationStudentSetting = EvaluationStudentSettingDAL.EvaluationStudentSettingRepository.GetList(x => x.EvaluationStudentSettingID == evaluationStudentSettingID, (x => x.CF_Student)).SingleOrDefault();
- if (evaluationStudentSetting == null)
- {
- throw new Exception("数据有误,请核查。");
- }
- else
- {
- var evaluationStudentVerify = evaluationStudentSetting.CF_Student.Where(x => x.UserID == userID).SingleOrDefault();
- var student = EvaluationStudentSettingDAL.StudentRepository.GetList(x => x.UserID == userID).SingleOrDefault();
- if (evaluationStudentVerify == null)
- {
- evaluationStudentSetting.CF_Student.Add(student);
- }
- else
- {
- throw new Exception("已存在相同的学生名单信息,请核查。");
- }
- }
- UnitOfWork.Commit();
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 删除学生
- /// </summary>
- /// <param name="evaluationStudentSettingID"></param>
- /// <param name="userIDs"></param>
- /// <returns></returns>
- public bool EvaluationStudentDelete(Guid? evaluationStudentSettingID, List<Guid?> userIDs)
- {
- try
- {
- var evaluationStudentSetting = EvaluationStudentSettingDAL.EvaluationStudentSettingRepository.GetList(x => x.EvaluationStudentSettingID == evaluationStudentSettingID, (x => x.CF_Student), (x => x.EM_EvaluationStudent)).SingleOrDefault();
- using (TransactionScope ts = new TransactionScope())
- {
- var evaluationStudentList = evaluationStudentSetting.EM_EvaluationStudent.Where(x => userIDs.Contains(x.UserID)).ToList();
- if (evaluationStudentList == null || evaluationStudentList.Count() <= 0)
- {
- evaluationStudentSetting.CF_Student.RemoveWhere(x => userIDs.Contains(x.UserID));
- }
- else
- {
- throw new Exception("选择删除的学生中,存在已评价信息无法删除。");
- }
- UnitOfWork.Commit();
- ts.Complete();
- return true;
- }
- }
- catch (Exception)
- {
- throw;
- }
- }
- /// <summary>
- /// 取消
- /// </summary>
- /// <param name="evaluationStudentSettingIDList"></param>
- /// <returns></returns>
- public bool EvaluationStudentSettingCancel(List<Guid?> evaluationStudentSettingIDList)
- {
- try
- {
- var evaluationStudentSettingUpList = new List<EM_EvaluationStudentSetting>();
- var evaluationStudentSettingList = EvaluationStudentSettingDAL.EvaluationStudentSettingRepository.GetList(x => evaluationStudentSettingIDList.Contains(x.EvaluationStudentSettingID)).ToList();
- foreach (var evaluationStudentSetting in evaluationStudentSettingList)
- {
- evaluationStudentSetting.OpenState = false;
- this.SetModifyStatus(evaluationStudentSetting);
- evaluationStudentSettingUpList.Add(evaluationStudentSetting);
- }
- if (evaluationStudentSettingUpList != null && evaluationStudentSettingUpList.Count() > 0)
- {
- UnitOfWork.BatchUpdate(evaluationStudentSettingUpList);
- }
- return true;
- }
- catch (Exception)
- {
- throw;
- }
- }
- /// <summary>
- /// 开放
- /// </summary>
- /// <param name="evaluationStudentSettingIDList"></param>
- /// <returns></returns>
- public bool EvaluationStudentSettingOpen(List<Guid?> evaluationStudentSettingIDList)
- {
- try
- {
- var evaluationStudentSettingUpList = new List<EM_EvaluationStudentSetting>();
- var evaluationStudentSettingList = EvaluationStudentSettingDAL.EvaluationStudentSettingRepository.GetList(x => evaluationStudentSettingIDList.Contains(x.EvaluationStudentSettingID)).ToList();
- foreach (var evaluationStudentSetting in evaluationStudentSettingList)
- {
- evaluationStudentSetting.OpenState = true;
- this.SetModifyStatus(evaluationStudentSetting);
- evaluationStudentSettingUpList.Add(evaluationStudentSetting);
- }
- if (evaluationStudentSettingUpList != null && evaluationStudentSettingUpList.Count() > 0)
- {
- UnitOfWork.BatchUpdate(evaluationStudentSettingUpList);
- }
- return true;
- }
- catch (Exception)
- {
- throw;
- }
- }
- }
- }
|