123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Linq.Expressions;
- using Bowin.Common.Linq;
- using Bowin.Common.Linq.Entity;
- using EMIS.Entities;
- using EMIS.ViewModel;
- using EMIS.DataLogic.ExaminationApply;
- using EMIS.ViewModel.ExaminationApply;
- using Bowin.Common.Utility;
- using System.Text.RegularExpressions;
- namespace EMIS.CommonLogic.ExaminationApply
- {
- public class ExaminationSubjectServices : BaseServices, IExaminationSubjectServices
- {
- public ExaminationSubjectDAL ExaminationSubjectDAL { get; set; }
- public Bowin.Common.Linq.Entity.IGridResultSet<ViewModel.ExaminationApply.ExaminationSubjectView> GetExaminationSubjectViewList(ViewModel.ConfiguretView examinationSubjectView,
- Guid? examinationTypeID, Guid? examinationSubjectID, Guid? schoolYearID, int pageIndex, int pageSize)
- {
- Expression<Func<EX_ExaminationSubject, bool>> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (examinationTypeID.HasValue)
- {
- exp = exp.And(x => x.ExaminationTypeID == examinationTypeID);
- }
- //要排除的科目,考试科目的要求通过科目下拉,一般排除当前科目,如英语四级选择要求通过科目时,不能选择英语四级
- if (examinationSubjectID.HasValue)
- {
- exp = exp.And(x => x.ExaminationSubjectID != examinationSubjectID);
- }
- if (schoolYearID.HasValue)
- {
- exp = exp.And(x => x.SchoolyearID == schoolYearID);
- }
- var q = ExaminationSubjectDAL.GetExaminationSubjectView(exp);
- if (!string.IsNullOrEmpty(examinationSubjectView.ConditionValue) && !string.IsNullOrEmpty(examinationSubjectView.Attribute))
- q = q.DynamicWhere(examinationSubjectView.Attribute, examinationSubjectView.Condition, examinationSubjectView.ConditionValue);
- return q.OrderBy(x => x.Name).ToGridResultSet<ExaminationSubjectView>(pageIndex, pageSize);
- }
- public IList<ViewModel.ExaminationApply.ExaminationSubjectView> GetExaminationSubjectViewList(ViewModel.ConfiguretView examinationSubjectView, Guid? examinationTypeID, Guid? examinationSubjectID)
- {
- Expression<Func<EX_ExaminationSubject, bool>> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (examinationTypeID.HasValue)
- {
- exp = exp.And(x => x.ExaminationTypeID == examinationTypeID);
- }
- //要排除的科目,考试科目的要求通过科目下拉,一般排除当前科目,如英语四级选择要求通过科目时,不能选择英语四级
- if (examinationSubjectID.HasValue)
- {
- exp = exp.And(x => x.ExaminationSubjectID != examinationSubjectID);
- }
- var q = ExaminationSubjectDAL.GetExaminationSubjectView(exp);
- if (!string.IsNullOrEmpty(examinationSubjectView.ConditionValue) && !string.IsNullOrEmpty(examinationSubjectView.Attribute))
- q = q.DynamicWhere(examinationSubjectView.Attribute, examinationSubjectView.Condition, examinationSubjectView.ConditionValue);
- return q.OrderBy(x => x.Name).ToList();
- }
- public ViewModel.ExaminationApply.ExaminationSubjectView GetExaminationSubjectViewInfo(Guid? examinationSubjectID)
- {
- return ExaminationSubjectDAL.GetExaminationSubjectView(x => x.ExaminationSubjectID == examinationSubjectID).FirstOrDefault();
- }
- public void Save(ViewModel.ExaminationApply.ExaminationSubjectView examinationSubjectView)
- {
- if (examinationSubjectView.PreposeSubjectName == examinationSubjectView.Name)
- throw new Exception("考试科目和要求通过科目不能相同,请核查");
- if (examinationSubjectView.PreposeSubjectID!=null && examinationSubjectView.PreposeScoreLimit==null)
- throw new Exception("要求通过最低成绩不能为空,请核查");
- var examinationSubjectEntity = ExaminationSubjectDAL.ExaminationSubjectRepository.GetSingle(x => x.ExaminationSubjectID == examinationSubjectView.ExaminationSubjectID);
- //考试科目名字唯一
- var RepeatSubject= ExaminationSubjectDAL.ExaminationSubjectRepository.GetSingle(x =>
- //x.ExaminationTypeID == examinationSubjectView.ExaminationTypeID &&
- //x.ExaminationFormID == examinationSubjectView.ExaminationFormID &&
- //x.SchoolyearID == examinationSubjectView.SchoolyearID &&
- x.Name == examinationSubjectView.Name);
-
- if (examinationSubjectEntity != null)
- {
- if (RepeatSubject != null && examinationSubjectEntity.ExaminationSubjectID != RepeatSubject.ExaminationSubjectID)
- { //考试科目,判断考试类型、考试类别、学年学期、考试科目名称不能重复
- throw new Exception("已存在【" + RepeatSubject.Name + "】考试科目,请核查");
- }
- examinationSubjectEntity.ExaminationTypeID = examinationSubjectView.ExaminationTypeID;
- examinationSubjectEntity.SchoolyearID = examinationSubjectView.SchoolyearID;
- examinationSubjectEntity.ExaminationFormID = examinationSubjectView.ExaminationFormID;
- examinationSubjectEntity.Name = examinationSubjectView.Name;
- examinationSubjectEntity.PreposeSubjectID = examinationSubjectView.PreposeSubjectID;
- examinationSubjectEntity.PreposeScoreLimit = examinationSubjectView.PreposeScoreLimit;
- examinationSubjectEntity.ExaminationDate = examinationSubjectView.ExaminationDate;
- examinationSubjectEntity.PeopleNumLimit = examinationSubjectView.PeopleNumLimit;
- examinationSubjectEntity.Cost = examinationSubjectView.Cost;
- examinationSubjectEntity.Remark = examinationSubjectView.Remark;
- this.SetModifyStatus(examinationSubjectEntity);
- }
- else
- {
- if (RepeatSubject != null)
- { //考试科目,判断考试类型、考试类别、学年学期、名称不能重复
- throw new Exception("已存在【" + RepeatSubject.Name + "】考试科目,请核查");
- }
- examinationSubjectEntity = new EX_ExaminationSubject();
- examinationSubjectEntity.ExaminationSubjectID = Guid.NewGuid();
- examinationSubjectEntity.ExaminationTypeID = examinationSubjectView.ExaminationTypeID;
- examinationSubjectEntity.SchoolyearID = examinationSubjectView.SchoolyearID;
- examinationSubjectEntity.ExaminationFormID = examinationSubjectView.ExaminationFormID;
- examinationSubjectEntity.Name = examinationSubjectView.Name;
- examinationSubjectEntity.PreposeSubjectID = examinationSubjectView.PreposeSubjectID;
- examinationSubjectEntity.PreposeScoreLimit = examinationSubjectView.PreposeScoreLimit;
- examinationSubjectEntity.ExaminationDate = examinationSubjectView.ExaminationDate;
- examinationSubjectEntity.PeopleNumLimit = examinationSubjectView.PeopleNumLimit;
- examinationSubjectEntity.Cost = examinationSubjectView.Cost;
- examinationSubjectEntity.Remark = examinationSubjectView.Remark;
- this.SetNewStatus(examinationSubjectEntity);
- UnitOfWork.Add(examinationSubjectEntity);
- }
- UnitOfWork.Commit();
- }
- public void Delete(IList<Guid?> examinationSubjectID)
- {
- if (examinationSubjectID.Count > 0)
- {
- UnitOfWork.Delete<EX_ExaminationSubject>(x => examinationSubjectID.Contains(x.ExaminationSubjectID));
- }
- }
- public IList<StudentListView> GetExaminationSubjectStudentListView(ConfiguretView conditions,
- Guid? subjectID, Guid? collegeID, int? year, int? standardID, Guid? classmajorID, Guid? examinationTypeID, Guid? schoolYearID,bool? IsPay)
- {
- Expression<Func<EX_ExaminationRegistration, bool>> exr = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- Expression<Func<EX_ExaminationSubject, bool>> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- //if (schoolYearID.HasValue)
- //{
- // exr = exr.And(x => x.SchoolyearID == schoolYearID);
- //}
- //ExaminationSchoolyearID应该才是考试学年学期
- if (schoolYearID.HasValue)
- {
- exr = exr.And(x => x.ExaminationSchoolyearID == schoolYearID);
- }
- if (examinationTypeID.HasValue)
- {
- exp = exp.And(x => x.ExaminationTypeID == examinationTypeID);
- }
- if (subjectID.HasValue)
- {
- exp = exp.And(x => x.ExaminationSubjectID == subjectID.Value);
- }
- if (collegeID.HasValue)
- {
- expStudent = expStudent.And(x => x.CF_Classmajor.CF_Grademajor.CF_Facultymajor.CollegeID == collegeID);
- }
- if (year.HasValue)
- {
- expStudent = expStudent.And(x => x.CF_Classmajor.CF_Grademajor.GradeID == year);
- }
- if (standardID.HasValue)
- {
- expStudent = expStudent.And(x => x.CF_Classmajor.CF_Grademajor.CF_Facultymajor.StandardID == standardID);
- }
- if (classmajorID.HasValue)
- {
- expStudent = expStudent.And(x => x.ClassmajorID == classmajorID);
- }
- if (IsPay.HasValue)
- {
- if (IsPay == false)
- {
- exr = exr.And(x => x.IsPay == IsPay || x.IsPay == null);
- }
- else
- {
- exr = exr.And(x => x.IsPay == IsPay);
- }
- }
- var q = ExaminationSubjectDAL.GetRegistedListView(exp, expStudent, exr);
- if (!string.IsNullOrEmpty(conditions.ConditionValue) && !string.IsNullOrEmpty(conditions.Attribute))
- q = q.DynamicWhere(conditions.Attribute, conditions.Condition, conditions.ConditionValue);
- return GetQueryByDataRangeByCollege(q).OrderByDescending(x => x.SchoolyearCode).ThenBy(x => x.SubjectName).ThenBy(x => x.StudentNo).ToList();
- }
-
- IGridResultSet<StudentListView> IExaminationSubjectServices.GetExaminationSubjectStudentListView(ConfiguretView conditions,
- Guid? subjectID, Guid? collegeID, int? year, int? standardID, Guid? classmajorID, Guid? examinationTypeID, Guid? schoolYearID, bool? IsPay, int pageIndex, int pageSize)
- {
- Expression<Func<EX_ExaminationRegistration, bool>> exr = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- Expression<Func<EX_ExaminationSubject, bool>> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (schoolYearID.HasValue)
- {
- exr = exr.And(x => x.ExaminationSchoolyearID == schoolYearID);
-
- }
- if (examinationTypeID.HasValue)
- {
- exp = exp.And(x => x.ExaminationTypeID == examinationTypeID);
- }
- if (subjectID.HasValue)
- {
- exp = exp.And(x => x.ExaminationSubjectID == subjectID.Value);
- }
- if (collegeID.HasValue)
- {
- expStudent = expStudent.And(x => x.CF_Classmajor.CF_Grademajor.CF_Facultymajor.CollegeID == collegeID);
- }
- if (year.HasValue)
- {
- expStudent = expStudent.And(x => x.CF_Classmajor.CF_Grademajor.GradeID == year);
- }
- if (standardID.HasValue)
- {
- expStudent = expStudent.And(x => x.CF_Classmajor.CF_Grademajor.CF_Facultymajor.StandardID == standardID);
- }
- if (classmajorID.HasValue)
- {
- expStudent = expStudent.And(x => x.ClassmajorID == classmajorID);
- }
- if (IsPay.HasValue)
- {
- if(IsPay==false){
- exr = exr.And(x => x.IsPay == IsPay||x.IsPay==null);
- }
- else{
- exr = exr.And(x => x.IsPay == IsPay);
- }
- }
- var q = ExaminationSubjectDAL.GetRegistedListView(exp, expStudent,exr);
- if (!string.IsNullOrEmpty(conditions.ConditionValue) && !string.IsNullOrEmpty(conditions.Attribute))
- q = q.DynamicWhere(conditions.Attribute, conditions.Condition, conditions.ConditionValue);
- return GetQueryByDataRangeByCollege(q).OrderByDescending(x => x.SchoolyearCode).ThenBy(x => x.SubjectName).ThenBy(x => x.StudentNo).ToGridResultSet(pageIndex, pageSize);
- }
- public Bowin.Common.Linq.Entity.IGridResultSet<ViewModel.ExaminationApply.ExaminationSubjectView> GetExaminationSubjectNameViewList(ViewModel.ConfiguretView examinationSubjectView,
- int pageIndex, int pageSize)
- {
- Expression<Func<EX_ExaminationSubject, bool>> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- var q = ExaminationSubjectDAL.GetExaminationSubjectView1(exp);
- if (!string.IsNullOrEmpty(examinationSubjectView.ConditionValue) && !string.IsNullOrEmpty(examinationSubjectView.Attribute))
- q = q.DynamicWhere(examinationSubjectView.Attribute, examinationSubjectView.Condition, examinationSubjectView.ConditionValue);
- return q.OrderBy(x=>x.Name).ToGridResultSet<ExaminationSubjectView>(pageIndex, pageSize);
- }
- /// <summary>
- /// 考试报名班级学生统计
- /// </summary>
- /// <param name="subjectID"></param>
- /// <param name="schoolYearID"></param>
- /// <param name="pageIndex"></param>
- /// <param name="pageSize"></param>
- /// <returns></returns>
- public IGridResultSet<ExaminationClassStudentStatisticsView> GetExaminationSubjectClassStudentStatisticsListView(Guid? subjectID, int? schoolYear, Guid? schoolYearID, int pageIndex, int pageSize, Guid? campusID, Guid? collegeID, Guid? classmajorID, int? standardID)
- {
- Expression<Func<EX_ExaminationRegistration, bool>> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (campusID.HasValue)
- expStudent = expStudent.And(x => x.CF_Classmajor.CF_Grademajor.CF_Facultymajor.CF_College.CampusID == campusID);
- if (collegeID.HasValue)
- expStudent = expStudent.And(x => x.CF_Classmajor.CF_Grademajor.CF_Facultymajor.CollegeID == collegeID);
- if (classmajorID.HasValue)
- expStudent = expStudent.And(x => x.ClassmajorID == classmajorID);
- if (standardID.HasValue)
- expStudent = expStudent.And(x => x.CF_Classmajor.CF_Grademajor.CF_Facultymajor.StandardID == standardID);
- if(schoolYear.HasValue&&schoolYear!=-1)
- {
- expStudent = expStudent.And(x => x.CF_Classmajor.CF_Grademajor.GradeID == schoolYear);
- }
- if (schoolYearID.HasValue)
- {
- exp = exp.And(x => x.ExaminationSchoolyearID == schoolYearID);
- }
- if (subjectID.HasValue)
- {
- exp = exp.And(x => x.ExaminationSubjectID == subjectID.Value);
- }
- var q = ExaminationSubjectDAL.GetRegistedClassStudentStatisticsListView(exp, expStudent);
- return q.OrderByDescending(x => x.SchoolyearCode).ThenBy(x => x.ExaminationSchoolyearCode).ThenBy(x => x.Year).ThenBy(x => x.SubjectName).ThenBy(x => x.ClassmajorName).ThenBy(x => x.Cost).ToGridResultSet(pageIndex, pageSize);
- }
- /// <summary>
- /// 考试报名班级学生统计
- /// </summary>
- /// <param name="subjectID"></param>
- /// <param name="schoolYearID"></param>
- /// <returns></returns>
- public List<ExaminationClassStudentStatisticsView> GetExaminationSubjectClassStudentStatisticsList(Guid? subjectID, Guid? schoolYearID)
- {
- Expression<Func<EX_ExaminationRegistration, bool>> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (schoolYearID.HasValue)
- {
- exp = exp.And(x => x.SchoolyearID == schoolYearID);
- }
- if (subjectID.HasValue)
- {
- exp = exp.And(x => x.ExaminationSubjectID == subjectID.Value);
- }
- var q = ExaminationSubjectDAL.GetRegistedClassStudentStatisticsListView(exp, expStudent);
- return q.OrderByDescending(x => x.SchoolyearCode).ThenBy(x => x.SubjectName).ThenBy(x => x.ClassmajorName).ThenBy(x => x.Cost).ToList();
- }
- public string[] Validation(List<Guid?> ExaminationTypeIDs, List<Guid?> SchoolyearIDs, List<int?> ExaminationFormIDs, List<string> names)
- {
- try
- {
- for (int i = 0; i < ExaminationTypeIDs.Count; i++)
- {
- Guid? ExaminationTypeID = ExaminationTypeIDs[0];
- Guid? SchoolyearID = SchoolyearIDs[0];
- int? ExaminationFormID = ExaminationFormIDs[0];
- string name = names[0];
- //var SubjectCountLimit = SubjectCountLimitDAL.ExaminationSubjectCountLimitRepository.Entities.Where(x =>
- // x.ExaminationTypeID == examinationType.Value && x.FacultymajorID == facultymajorIDs[0].Value &&
- // x.Years == years[0].Value).FirstOrDefault();
- var Subject = ExaminationSubjectDAL.GetExaminationSubjectView(x =>
- x.ExaminationTypeID == ExaminationTypeID && x.SchoolyearID == SchoolyearID &&
- x.ExaminationFormID == ExaminationFormID && x.Name == name).FirstOrDefault();
- if (Subject != null)
- return new[] { "false", "科目【" + Subject.Name + "】" + Subject.SchoolyearCode + "学年学期的" + Subject.ExaminationTypeName + "类型、" + Subject.ExaminationFormName + "类别数据已存在。" };
- }
- }
- catch (Exception ex)
- {
- return new[] { "false", ex.Message };
- }
- return new[] { "true", "成功" };
- }
- public void ExaminationSubjectStudentImport(Dictionary<string, string> cellheader, out int OkCount, out List<StudentListView> errdataList, out int ErrCount, string sourcePhysicalPath)
- {
- StringBuilder errorMsg = new StringBuilder(); // 错误信息
- List<StudentListView> errList = new List<StudentListView>();
- #region 1.1解析文件,存放到一个List集合里
- cellheader.Remove("ErrorMessage");//去除异常列、导入操作不需要
- // 1.1解析文件,存放到一个List集合里
- List<StudentListView> enlist =
- NpoiExcelHelper.ExcelToEntityList<StudentListView>(cellheader, sourcePhysicalPath, out errorMsg, out errList);
- cellheader.Add("ErrorMessage", "错误信息");//还原字典项
- if (enlist.Count() <= 0)
- {
- throw new Exception("请填写Excel模板信息数据。");
- }
- List<string> SchoolYear = enlist.Select(x => x.SchoolyearCode).ToList();
- List<string> StudentNoList = enlist.Select(x => x.StudentNo).ToList();
- //List<string> StudentID = enlist.Select(x => x.IDNumber).ToList();
- List<string> SubjectNameList = enlist.Select(x => x.SubjectName).ToList();
- #endregion
- var SchoolYearList = ExaminationSubjectDAL.SchoolyearRepository.Entities.Where(x => SchoolYear.Contains(x.Code)).ToList();
- List<Guid> SchoolYearId = ExaminationSubjectDAL.SchoolyearRepository.Entities.Where(x => SchoolYear.Contains(x.Code)).Select(w=>w.SchoolyearID).ToList();
- List<EX_ExaminationRegistration> exaList = new List<EX_ExaminationRegistration>();
- Expression<Func<EX_ExaminationRegistration, bool>> exr = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE&&SchoolYearId.Contains((Guid)x.ExaminationSchoolyearID));
- Expression<Func<EX_ExaminationSubject, bool>> exp = x => SubjectNameList.Contains(x.Name);
- Expression<Func<CF_Student, bool>> studentExp = x => StudentNoList.Contains(x.Sys_User.LoginID);
- List<StudentListView> dbList = ExaminationSubjectDAL.GetRegistedStudentListView(exp, studentExp,exr).ToList();
- var examiantionRegistIDList = dbList.Select(x => x.ExaminationRegistrationID).ToList();
- exaList = ExaminationSubjectDAL.ExaminationRegistrationRepository.GetList(x => examiantionRegistIDList.Contains(x.ExaminationRegistrationID)).ToList();
- for (int i = 0; i < enlist.Count();i++ )
- {
- string errorMsgStr = "第" + (i + 2) + "行数据检测异常:";
- StudentListView en = enlist[i];
- bool isHaveNoInputValue = false;
- en.IsExcelVaildateOK = true;
- #region 检查是否有未填的值
- if (string.IsNullOrEmpty(en.StudentNo))
- {
- errorMsgStr += "学号不能为空;";
- isHaveNoInputValue = true;
- }
- if (string.IsNullOrEmpty(en.IsPay))
- {
- errorMsgStr += "是否交费不能为空;";
- isHaveNoInputValue = true;
- }
- if (string.IsNullOrEmpty(en.SchoolyearCode))
- {
- errorMsgStr += "考试学年学期不能为空;";
- isHaveNoInputValue = true;
- }
- if (string.IsNullOrEmpty(en.SubjectName))
- {
- errorMsgStr += "科目名称不能为空;";
- isHaveNoInputValue = true;
- }
- #endregion
- #region 检查数据是否存在
- var enSchoolYear=SchoolYearList.Where(x=>x.Code==en.SchoolyearCode).Select(w=>w.SchoolyearID).FirstOrDefault();
- if (enSchoolYear != null)
- {
- var Students = dbList.Where(x => x.StudentNo == en.StudentNo && x.SubjectName == en.SubjectName&&x.ExaminationSchoolyearID==enSchoolYear).FirstOrDefault();
- if (Students == null)
- {
- errorMsgStr += "无法匹配对应的数据,请检查;";
- isHaveNoInputValue = true;
- }
- else
- {
- enlist[i] = Students;
- }
- }
- else
- {
- errorMsgStr += "考试学年学期不存在;";
- isHaveNoInputValue = true;
- }
- if (en.IsPay != "是" && en.IsPay != "否")
- {
- errorMsgStr += "是否交费填写的字段不正确;";
- isHaveNoInputValue = true;
- }
- else
- {
- enlist[i].IsPay = en.IsPay;
- }
- #endregion
- if (isHaveNoInputValue)
- {
- en.IsExcelVaildateOK = false;
- en.ErrorMessage = errorMsgStr;
- errList.Add(en);
- }
- else
- {
- enlist[i].IsExcelVaildateOK = true;
- }
- }
- for (int i = 0; i < enlist.Count(); i++)
- {
- StudentListView enA = enlist[i];
- if (enA.IsExcelVaildateOK == false)
- {
- continue;
- }
- var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- bool ispay = enA.IsPay=="是"?true:false;
- EX_ExaminationRegistration examinationRegistration = exaList.FirstOrDefault(x => x.ExaminationRegistrationID == enA.ExaminationRegistrationID);
- examinationRegistration.ExaminationSubjectID = enA.ExaminationSubjectID;
- //报名学年学期
- examinationRegistration.SchoolyearID = enA.SchoolyearID;
- examinationRegistration.UserID = enA.UserID;
- examinationRegistration.CertificatesType = enA.CertificatesType;
- examinationRegistration.IDNumber = enA.IDNumber;
- //考试学年学期
- examinationRegistration.ExaminationSchoolyearID = enA.ExaminationSchoolyearID;
- examinationRegistration.IsPay = ispay;
- examinationRegistration.RecordStatus=(int)SYS_STATUS.USABLE;
- this.SetModifyStatus(examinationRegistration);
- //UnitOfWork.Update(examinationRegistration);
- }
- ErrCount = errList.Distinct().Count();//共条数减去失败条数
- errdataList = errList.Distinct().ToList();
- OkCount = enlist.Distinct().Count() - errList.Distinct().Count();
- //UnitOfWork.Commit();
- UnitOfWork.BatchUpdate(exaList);
- }
- }
- }
|