using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; using System.Linq.Expressions; using System.Transactions; using Bowin.Common.Linq; using Bowin.Common.Linq.Entity; using EMIS.Entities; using EMIS.ViewModel; using EMIS.ViewModel.StudentManage.InfoCenter; using EMIS.DataLogic.StudentManage.StudentProfile; using EMIS.DataLogic.StudentManage.OnlineChecking; using EMIS.CommonLogic.SystemServices; using EMIS.CommonLogic.StudentManage.StudentStatistics; namespace EMIS.CommonLogic.StudentWeb.InfoCenter { public class PersonalInfoServices : BaseWorkflowServices, IPersonalInfoServices { public StudentDAL StudentDAL { get; set; } public OpenObjectDAL OpenObjectDAL { get; set; } public CheckingControlDAL CheckingControlDAL { get; set; } public CheckingApproveDAL CheckingApproveDAL { get; set; } public Lazy InSchoolSettingServices { get; set; } /// /// 根据学生信息ID查询对应的网上校对开放对象信息 /// 可校对条件:在校状态为在校且在开放对象范围内 /// /// public void StudentOpenObject(Guid? userID) { try { var studentBaseView = StudentDAL.GetStudentBaseViewQueryable(x => x.UserID == userID).SingleOrDefault(); if (studentBaseView != null) { if (!InSchoolSettingServices.Value.GetInschoolStatusList(true).Contains(studentBaseView.InSchoolStatusID)) { throw new Exception("只允许在校生对个人信息进行网上校对。"); } var currentSchoolYear = StudentDAL.SchoolyearRepository.GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE && x.IsCurrent == true).SingleOrDefault(); if (currentSchoolYear == null) { throw new Exception("未设置启用的学年学期,请设置。"); } var nowSchoolyearNumID = (currentSchoolYear.Value - (currentSchoolYear.SchoolcodeID == studentBaseView.SemesterID ? 0 : 1) - studentBaseView.StartSchoolyearValue.Value) / 2 + 1; var studentOpenObject = OpenObjectDAL.StudentEditObjectsRepository.GetList(x => x.SchoolyearNumID == nowSchoolyearNumID && x.EducationID == studentBaseView.EducationID).SingleOrDefault(); if (studentOpenObject == null) { throw new Exception("未设置对应的网上校对开放对象信息,请设置(入学学年学期:" + studentBaseView.StartSchoolyearCode + ")。"); } else { if (System.DateTime.Now < studentOpenObject.Starttime || System.DateTime.Now > studentOpenObject.Endtime) { throw new Exception("对应的网上校对时间不在开放范围内(" + "开放时间:" + studentOpenObject.Starttime.Value.ToString("yyyy-MM-dd HH:mm") + "--" + studentOpenObject.Endtime.Value.ToString("yyyy-MM-dd HH:mm") + ")。"); } } } else { throw new Exception("数据有误,请重新刷新加载。"); } } catch (Exception ex) { throw new Exception(ex.Message); } } /// /// 查询对应的校对控制信息List /// /// public List GetStudentEditFeildList() { Expression> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE); var editFeildViewList = CheckingControlDAL.GetStudentEditFeildQueryable(exp).OrderBy(x => x.OrderNo).ToList(); return editFeildViewList; } /// /// 学生个人信息校对 /// /// /// public void StudentCheckEdit(Dictionary studentViewDataList, Guid? userID) { try { this.StudentOpenObject(userID); var workflowStatusViewList = this.GetStatusViewList(); if (workflowStatusViewList == null || workflowStatusViewList.Count() <= 0) { throw new Exception("工作流平台中,网上校对流程未配置,请核查。"); } var startStatusID = this.GetStartStatus(); if (startStatusID == null) { throw new Exception("工作流平台中,网上校对流程开始环节未配置,请核查。"); } var startActionViewList = this.GetStartActionView().ToList(); var endStatusID = this.GetCorrectEndStatus(); if (endStatusID == null) { throw new Exception("工作流平台中,网上校对流程结束环节未配置,请核查。"); } var approveStatusIDList = this.GetApproveStatusViewList().Select(x => x.ID).ToList(); Expression> expStudentContrast = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE); expStudentContrast = expStudentContrast.And(x => approveStatusIDList.Contains(x.ApprovalStatus)); expStudentContrast = expStudentContrast.And(x => x.UserID == userID); var approveColumnNameList = CheckingApproveDAL.GetCheckingHistoryViewQueryable(expStudentContrast).ToDictionary(x => x.ColumnName, x => x.Description); var checkingControlEditList = CheckingControlDAL.StudentEditControlRepository.GetList(x => x.CheckingTypeID != (int)CF_CheckingType.Close).ToList(); if (checkingControlEditList != null && checkingControlEditList.Count() > 0) { var checkingColumnDescriptionList = CheckingControlDAL.StudentEditColumnDescriptionRepository.GetList(x => true).ToList(); if (checkingColumnDescriptionList != null && checkingColumnDescriptionList.Count() > 0) { List studentContrastInList = new List(); List studentSourceInList = new List(); List userContrastInList = new List(); List userSourceInList = new List(); List studentProfileContrastInList = new List(); List studentProfileSourceInList = new List(); List studentContactContrastInList = new List(); List studentContactSourceInList = new List(); List studentAccountContrastInList = new List(); List studentAccountSourceInList = new List(); List recruitstudentsContrastInList = new List(); List recruitstudentsSourceInList = new List(); List needEditIDList = new List(); List needSubmitIDList = new List(); List userUpList = new List(); List studentUpList = new List(); List studentProfileUpList = new List(); List studentContactUpList = new List(); List studentAccountUpList = new List(); List recruitstudentsUpList = new List(); List studentRecordChangeHistoryInList = new List(); bool isUserCheck = false; bool isStudentCheck = false; bool isStuProfileCheck = false; bool isStuContactCheck = false; bool isStuAccountCheck = false; bool isStuRecruitCheck = false; var student = StudentDAL.StudentRepository.GetList(x => x.UserID == userID, (x => x.CF_StudentProfile), (x => x.CF_StudentContact), (x => x.CF_StudentAccount), (x => x.CF_Recruitstudents), (x => x.Sys_User)).SingleOrDefault(); var checkingControlGroupByDictionary = checkingControlEditList.GroupBy(x => x.CheckingTypeID).ToDictionary(x => x.Key, x => x.DefaultIfEmpty()); foreach (var checkingControlGroupBy in checkingControlGroupByDictionary) { #region isUserCheck = false; isStudentCheck = false; isStuProfileCheck = false; isStuContactCheck = false; isStuAccountCheck = false; isStuRecruitCheck = false; var studentContrast = new CF_StudentContrast(); studentContrast.StudentContrastID = Guid.NewGuid(); studentContrast.UserID = student.UserID; studentContrast.ClassmajorID = student.ClassmajorID; studentContrast.SexID = student.SexID; studentContrast.BirthDate = student.BirthDate; studentContrast.NationID = student.NationID; studentContrast.PoliticsID = student.PoliticsID; studentContrast.CertificatesType = student.CertificatesType; studentContrast.IDNumber = student.IDNumber; studentContrast.StudentType = student.StudentType; studentContrast.InSchoolStatusID = student.InSchoolStatusID; studentContrast.StudentStatus = student.StudentStatus; studentContrast.StudentCardNo = student.StudentCardNo; studentContrast.PhotoUrl = student.PhotoUrl; studentContrast.PlanningGraduateDate = student.PlanningGraduateDate; studentContrast.GraduateDate = student.GraduateDate; studentContrast.GraduateCardNo = student.GraduateCardNo; studentContrast.ReplaceGraduateNo = student.ReplaceGraduateNo; studentContrast.DegreeStatus = student.DegreeStatus; studentContrast.GraduationPictureUrl = student.GraduationPictureUrl; studentContrast.Career = student.Career; studentContrast.IsPhotoComparison = student.IsPhotoComparison; studentContrast.IsProofread = student.IsProofread; studentContrast.Remark = student.Remark; studentContrast.IP = HttpContext.Current.Request.UserHostAddress; studentContrast.ApprovalStatus = startStatusID; studentContrast.Comment = null; studentContrast.RecordStatus = (int)SYS_STATUS.USABLE; studentContrast.CreateUserID = userID; studentContrast.CreateTime = DateTime.Now; studentContrast.ModifyUserID = userID; studentContrast.ModifyTime = DateTime.Now; var studentSource = new CF_StudentSource(); studentSource.StudentContrastID = studentContrast.StudentContrastID; studentSource.ClassmajorID = student.ClassmajorID; studentSource.SexID = student.SexID; studentSource.BirthDate = student.BirthDate; studentSource.NationID = student.NationID; studentSource.PoliticsID = student.PoliticsID; studentSource.CertificatesType = student.CertificatesType; studentSource.IDNumber = student.IDNumber; studentSource.StudentType = student.StudentType; studentSource.InSchoolStatusID = student.InSchoolStatusID; studentSource.StudentStatus = student.StudentStatus; studentSource.StudentCardNo = student.StudentCardNo; studentSource.PhotoUrl = student.PhotoUrl; studentSource.PlanningGraduateDate = student.PlanningGraduateDate; studentSource.GraduateDate = student.GraduateDate; studentSource.GraduateCardNo = student.GraduateCardNo; studentSource.ReplaceGraduateNo = student.ReplaceGraduateNo; studentSource.DegreeStatus = student.DegreeStatus; studentSource.GraduationPictureUrl = student.GraduationPictureUrl; studentSource.Career = student.Career; studentSource.IsPhotoComparison = student.IsPhotoComparison; studentSource.IsProofread = student.IsProofread; studentSource.Remark = student.Remark; var userContrast = new Sys_UserContrast(); userContrast.StudentContrastID = studentContrast.StudentContrastID; userContrast.LoginID = student.Sys_User.LoginID; userContrast.Name = student.Sys_User.Name; userContrast.RecordStatus = (int)SYS_STATUS.USABLE; userContrast.CreateUserID = userID; userContrast.CreateTime = DateTime.Now; userContrast.ModifyUserID = userID; userContrast.ModifyTime = DateTime.Now; var userSource = new Sys_UserSource(); userSource.StudentContrastID = studentContrast.StudentContrastID; userSource.LoginID = student.Sys_User.LoginID; userSource.Name = student.Sys_User.Name; var studentProfileContrast = new CF_StudentProfileContrast(); studentProfileContrast.StudentContrastID = studentContrast.StudentContrastID; studentProfileContrast.UsedName = student.CF_StudentProfile.UsedName; studentProfileContrast.LiteracyLevelID = student.CF_StudentProfile.LiteracyLevelID; studentProfileContrast.CultureModelID = student.CF_StudentProfile.CultureModelID; studentProfileContrast.IsDreamProject = student.CF_StudentProfile.IsDreamProject; studentProfileContrast.Country = student.CF_StudentProfile.Country; studentProfileContrast.Place = student.CF_StudentProfile.Place; studentProfileContrast.BornPlace = student.CF_StudentProfile.BornPlace; studentProfileContrast.HealthStateID = student.CF_StudentProfile.HealthStateID; studentProfileContrast.BloodGroup = student.CF_StudentProfile.BloodGroup; studentProfileContrast.Specialty = student.CF_StudentProfile.Specialty; studentProfileContrast.Height = student.CF_StudentProfile.Height; studentProfileContrast.Weight = student.CF_StudentProfile.Weight; studentProfileContrast.DirectorName = student.CF_StudentProfile.DirectorName; studentProfileContrast.RecordStatus = (int)SYS_STATUS.USABLE; studentProfileContrast.CreateUserID = userID; studentProfileContrast.CreateTime = DateTime.Now; studentProfileContrast.ModifyUserID = userID; studentProfileContrast.ModifyTime = DateTime.Now; var studentProfileSource = new CF_StudentProfileSource(); studentProfileSource.StudentContrastID = studentContrast.StudentContrastID; studentProfileSource.UsedName = student.CF_StudentProfile.UsedName; studentProfileSource.LiteracyLevelID = student.CF_StudentProfile.LiteracyLevelID; studentProfileSource.CultureModelID = student.CF_StudentProfile.CultureModelID; studentProfileSource.IsDreamProject = student.CF_StudentProfile.IsDreamProject; studentProfileSource.Country = student.CF_StudentProfile.Country; studentProfileSource.Place = student.CF_StudentProfile.Place; studentProfileSource.BornPlace = student.CF_StudentProfile.BornPlace; studentProfileSource.HealthStateID = student.CF_StudentProfile.HealthStateID; studentProfileSource.BloodGroup = student.CF_StudentProfile.BloodGroup; studentProfileSource.Specialty = student.CF_StudentProfile.Specialty; studentProfileSource.Height = student.CF_StudentProfile.Height; studentProfileSource.Weight = student.CF_StudentProfile.Weight; studentProfileSource.DirectorName = student.CF_StudentProfile.DirectorName; var studentContactContrast = new CF_StudentContactContrast(); studentContactContrast.StudentContrastID = studentContrast.StudentContrastID; studentContactContrast.Email = student.CF_StudentContact.Email; studentContactContrast.Telephone = student.CF_StudentContact.Telephone; studentContactContrast.Mobile = student.CF_StudentContact.Mobile; studentContactContrast.ZIPCode = student.CF_StudentContact.ZIPCode; studentContactContrast.WeChatNum = student.CF_StudentContact.WeChatNum; studentContactContrast.QQ = student.CF_StudentContact.QQ; studentContactContrast.HomeAddress = student.CF_StudentContact.HomeAddress; studentContactContrast.WorkUnit = student.CF_StudentContact.WorkUnit; studentContactContrast.Address = student.CF_StudentContact.Address; studentContactContrast.Recipient = student.CF_StudentContact.Recipient; studentContactContrast.Dormitory = student.CF_StudentContact.Dormitory; studentContactContrast.RecordStatus = (int)SYS_STATUS.USABLE; studentContactContrast.CreateUserID = userID; studentContactContrast.CreateTime = DateTime.Now; studentContactContrast.ModifyUserID = userID; studentContactContrast.ModifyTime = DateTime.Now; var studentContactSource = new CF_StudentContactSource(); studentContactSource.StudentContrastID = studentContrast.StudentContrastID; studentContactSource.Email = student.CF_StudentContact.Email; studentContactSource.Telephone = student.CF_StudentContact.Telephone; studentContactSource.Mobile = student.CF_StudentContact.Mobile; studentContactSource.ZIPCode = student.CF_StudentContact.ZIPCode; studentContactSource.WeChatNum = student.CF_StudentContact.WeChatNum; studentContactSource.QQ = student.CF_StudentContact.QQ; studentContactSource.HomeAddress = student.CF_StudentContact.HomeAddress; studentContactSource.WorkUnit = student.CF_StudentContact.WorkUnit; studentContactSource.Address = student.CF_StudentContact.Address; studentContactSource.Recipient = student.CF_StudentContact.Recipient; studentContactSource.Dormitory = student.CF_StudentContact.Dormitory; var studentAccountContrast = new CF_StudentAccountContrast(); studentAccountContrast.StudentContrastID = studentContrast.StudentContrastID; studentAccountContrast.CardNo = student.CF_StudentAccount.CardNo; studentAccountContrast.BankName = student.CF_StudentAccount.BankName; studentAccountContrast.RecordStatus = (int)SYS_STATUS.USABLE; studentAccountContrast.CreateUserID = userID; studentAccountContrast.CreateTime = DateTime.Now; studentAccountContrast.ModifyUserID = userID; studentAccountContrast.ModifyTime = DateTime.Now; var studentAccountSource = new CF_StudentAccountSource(); studentAccountSource.StudentContrastID = studentContrast.StudentContrastID; studentAccountSource.CardNo = student.CF_StudentAccount.CardNo; studentAccountSource.BankName = student.CF_StudentAccount.BankName; var recruitstudentsContrast = new CF_RecruitstudentsContrast(); recruitstudentsContrast.StudentContrastID = studentContrast.StudentContrastID; recruitstudentsContrast.ExamineeNum = student.CF_Recruitstudents.ExamineeNum; recruitstudentsContrast.AdmissionTicketNo = student.CF_Recruitstudents.AdmissionTicketNo; recruitstudentsContrast.ExamineeType = student.CF_Recruitstudents.ExamineeType; recruitstudentsContrast.EnteringSchoolYearID = student.CF_Recruitstudents.EnteringSchoolYearID; recruitstudentsContrast.EntranceDate = student.CF_Recruitstudents.EntranceDate; recruitstudentsContrast.Score = student.CF_Recruitstudents.Score; recruitstudentsContrast.EntranceWayID = student.CF_Recruitstudents.EntranceWayID; recruitstudentsContrast.FeaturesID = student.CF_Recruitstudents.FeaturesID; recruitstudentsContrast.TerritorialID = student.CF_Recruitstudents.TerritorialID; recruitstudentsContrast.Area = student.CF_Recruitstudents.Area; recruitstudentsContrast.RecruitPictureUrl = student.CF_Recruitstudents.RecruitPictureUrl; recruitstudentsContrast.RecordStatus = (int)SYS_STATUS.USABLE; recruitstudentsContrast.CreateUserID = userID; recruitstudentsContrast.CreateTime = DateTime.Now; recruitstudentsContrast.ModifyUserID = userID; recruitstudentsContrast.ModifyTime = DateTime.Now; var recruitstudentsSource = new CF_RecruitstudentsSource(); recruitstudentsSource.StudentContrastID = studentContrast.StudentContrastID; recruitstudentsSource.ExamineeNum = student.CF_Recruitstudents.ExamineeNum; recruitstudentsSource.AdmissionTicketNo = student.CF_Recruitstudents.AdmissionTicketNo; recruitstudentsSource.ExamineeType = student.CF_Recruitstudents.ExamineeType; recruitstudentsSource.EnteringSchoolYearID = student.CF_Recruitstudents.EnteringSchoolYearID; recruitstudentsSource.EntranceDate = student.CF_Recruitstudents.EntranceDate; recruitstudentsSource.Score = student.CF_Recruitstudents.Score; recruitstudentsSource.EntranceWayID = student.CF_Recruitstudents.EntranceWayID; recruitstudentsSource.FeaturesID = student.CF_Recruitstudents.FeaturesID; recruitstudentsSource.TerritorialID = student.CF_Recruitstudents.TerritorialID; recruitstudentsSource.Area = student.CF_Recruitstudents.Area; recruitstudentsSource.RecruitPictureUrl = student.CF_Recruitstudents.RecruitPictureUrl; #endregion if (checkingControlGroupBy.Key == (int)CF_CheckingType.AllOpen) { foreach (var checkingControl in checkingControlGroupBy.Value) { #region var keyValuePair = studentViewDataList.Where(x => x.Key == checkingControl.ColumnName).SingleOrDefault(); var approveColumnName = approveColumnNameList.Where(x => x.Key.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); var userProperty = typeof(Sys_User).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (userProperty != null) { if (!(userProperty.GetValue(student.Sys_User, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? ""))) { if (approveColumnName.Key == null) { var userContrastProperty = typeof(Sys_UserContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (userContrastProperty != null) { userContrastProperty.SetValue(userContrast, studentViewDataList[keyValuePair.Key], null); userContrast.ModifyUserID = userID; userContrast.ModifyTime = DateTime.Now; userProperty.SetValue(student.Sys_User, studentViewDataList[keyValuePair.Key], null); isUserCheck = true; var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault(); if (checkingColumnDescription != null) { var studentRecordChangeHistory = new CF_StudentRecordChangeHistory(); studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid(); studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID; studentRecordChangeHistory.TableName = checkingColumnDescription.TableName; studentRecordChangeHistory.ColumnName = keyValuePair.Key; studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key; studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.UNUSABLE; studentRecordChangeHistory.CreateUserID = userID; studentRecordChangeHistory.CreateTime = DateTime.Now; studentRecordChangeHistory.ModifyUserID = userID; studentRecordChangeHistory.ModifyTime = DateTime.Now; studentRecordChangeHistoryInList.Add(studentRecordChangeHistory); } else { throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。"); } } } var studentProperty = typeof(CF_Student).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentProperty != null) { if (!(studentProperty.GetValue(student, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? ""))) { if (approveColumnName.Key == null) { var studentContrastProperty = typeof(CF_StudentContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentContrastProperty != null) { studentContrastProperty.SetValue(studentContrast, studentViewDataList[keyValuePair.Key], null); studentContrast.ModifyUserID = userID; studentContrast.ModifyTime = DateTime.Now; studentProperty.SetValue(student, studentViewDataList[keyValuePair.Key], null); isStudentCheck = true; var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault(); if (checkingColumnDescription != null) { var studentRecordChangeHistory = new CF_StudentRecordChangeHistory(); studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid(); studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID; studentRecordChangeHistory.TableName = checkingColumnDescription.TableName; studentRecordChangeHistory.ColumnName = keyValuePair.Key; studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key; studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.UNUSABLE; studentRecordChangeHistory.CreateUserID = userID; studentRecordChangeHistory.CreateTime = DateTime.Now; studentRecordChangeHistory.ModifyUserID = userID; studentRecordChangeHistory.ModifyTime = DateTime.Now; studentRecordChangeHistoryInList.Add(studentRecordChangeHistory); } else { throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。"); } } } var studentProfileProperty = typeof(CF_StudentProfile).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentProfileProperty != null) { if (!(studentProfileProperty.GetValue(student.CF_StudentProfile, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? ""))) { if (approveColumnName.Key == null) { var studentProfileContrastProperty = typeof(CF_StudentProfileContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentProfileContrastProperty != null) { studentProfileContrastProperty.SetValue(studentProfileContrast, studentViewDataList[keyValuePair.Key], null); studentProfileContrast.ModifyUserID = userID; studentProfileContrast.ModifyTime = DateTime.Now; studentProfileProperty.SetValue(student.CF_StudentProfile, studentViewDataList[keyValuePair.Key], null); isStuProfileCheck = true; var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault(); if (checkingColumnDescription != null) { var studentRecordChangeHistory = new CF_StudentRecordChangeHistory(); studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid(); studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID; studentRecordChangeHistory.TableName = checkingColumnDescription.TableName; studentRecordChangeHistory.ColumnName = keyValuePair.Key; studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key; studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.UNUSABLE; studentRecordChangeHistory.CreateUserID = userID; studentRecordChangeHistory.CreateTime = DateTime.Now; studentRecordChangeHistory.ModifyUserID = userID; studentRecordChangeHistory.ModifyTime = DateTime.Now; studentRecordChangeHistoryInList.Add(studentRecordChangeHistory); } else { throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。"); } } } var studentContactProperty = typeof(CF_StudentContact).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentContactProperty != null) { if (!(studentContactProperty.GetValue(student.CF_StudentContact, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? ""))) { if (approveColumnName.Key == null) { var studentContactContrastProperty = typeof(CF_StudentContactContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentContactContrastProperty != null) { studentContactContrastProperty.SetValue(studentContactContrast, studentViewDataList[keyValuePair.Key], null); studentContactContrast.ModifyUserID = userID; studentContactContrast.ModifyTime = DateTime.Now; studentContactProperty.SetValue(student.CF_StudentContact, studentViewDataList[keyValuePair.Key], null); isStuContactCheck = true; var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault(); if (checkingColumnDescription != null) { var studentRecordChangeHistory = new CF_StudentRecordChangeHistory(); studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid(); studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID; studentRecordChangeHistory.TableName = checkingColumnDescription.TableName; studentRecordChangeHistory.ColumnName = keyValuePair.Key; studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key; studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.UNUSABLE; studentRecordChangeHistory.CreateUserID = userID; studentRecordChangeHistory.CreateTime = DateTime.Now; studentRecordChangeHistory.ModifyUserID = userID; studentRecordChangeHistory.ModifyTime = DateTime.Now; studentRecordChangeHistoryInList.Add(studentRecordChangeHistory); } else { throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。"); } } } var studentAccountProperty = typeof(CF_StudentAccount).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentAccountProperty != null) { if (!(studentAccountProperty.GetValue(student.CF_StudentAccount, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? ""))) { if (approveColumnName.Key == null) { var studentAccountContrastProperty = typeof(CF_StudentAccountContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentAccountContrastProperty != null) { studentAccountContrastProperty.SetValue(studentAccountContrast, studentViewDataList[keyValuePair.Key], null); studentAccountContrast.ModifyUserID = userID; studentAccountContrast.ModifyTime = DateTime.Now; studentAccountProperty.SetValue(student.CF_StudentAccount, studentViewDataList[keyValuePair.Key], null); isStuAccountCheck = true; var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault(); if (checkingColumnDescription != null) { var studentRecordChangeHistory = new CF_StudentRecordChangeHistory(); studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid(); studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID; studentRecordChangeHistory.TableName = checkingColumnDescription.TableName; studentRecordChangeHistory.ColumnName = keyValuePair.Key; studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key; studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.UNUSABLE; studentRecordChangeHistory.CreateUserID = userID; studentRecordChangeHistory.CreateTime = DateTime.Now; studentRecordChangeHistory.ModifyUserID = userID; studentRecordChangeHistory.ModifyTime = DateTime.Now; studentRecordChangeHistoryInList.Add(studentRecordChangeHistory); } else { throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。"); } } } var recruitstudentsProperty = typeof(CF_Recruitstudents).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (recruitstudentsProperty != null) { if (!(recruitstudentsProperty.GetValue(student.CF_Recruitstudents, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? ""))) { if (approveColumnName.Key == null) { var recruitstudentsContrastProperty = typeof(CF_RecruitstudentsContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (recruitstudentsContrastProperty != null) { recruitstudentsContrastProperty.SetValue(recruitstudentsContrast, studentViewDataList[keyValuePair.Key], null); recruitstudentsContrast.ModifyUserID = userID; recruitstudentsContrast.ModifyTime = DateTime.Now; recruitstudentsProperty.SetValue(student.CF_Recruitstudents, studentViewDataList[keyValuePair.Key], null); isStuRecruitCheck = true; var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault(); if (checkingColumnDescription != null) { var studentRecordChangeHistory = new CF_StudentRecordChangeHistory(); studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid(); studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID; studentRecordChangeHistory.TableName = checkingColumnDescription.TableName; studentRecordChangeHistory.ColumnName = keyValuePair.Key; studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key; studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.UNUSABLE; studentRecordChangeHistory.CreateUserID = userID; studentRecordChangeHistory.CreateTime = DateTime.Now; studentRecordChangeHistory.ModifyUserID = userID; studentRecordChangeHistory.ModifyTime = DateTime.Now; studentRecordChangeHistoryInList.Add(studentRecordChangeHistory); } else { throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。"); } } } #endregion } if (isUserCheck || isStudentCheck || isStuProfileCheck || isStuContactCheck || isStuAccountCheck || isStuRecruitCheck) { #region studentContrastInList.Add(studentContrast); studentSourceInList.Add(studentSource); userContrastInList.Add(userContrast); userSourceInList.Add(userSource); studentProfileContrastInList.Add(studentProfileContrast); studentProfileSourceInList.Add(studentProfileSource); studentContactContrastInList.Add(studentContactContrast); studentContactSourceInList.Add(studentContactSource); studentAccountContrastInList.Add(studentAccountContrast); studentAccountSourceInList.Add(studentAccountSource); recruitstudentsContrastInList.Add(recruitstudentsContrast); recruitstudentsSourceInList.Add(recruitstudentsSource); needEditIDList.Add(studentContrast.StudentContrastID); if (isUserCheck) { student.Sys_User.ModifyUserID = userID; student.Sys_User.ModifyTime = DateTime.Now; userUpList.Add(student.Sys_User); } if (isStudentCheck) { student.ModifyUserID = userID; student.ModifyTime = DateTime.Now; studentUpList.Add(student); } if (isStuProfileCheck) { student.CF_StudentProfile.ModifyUserID = userID; student.CF_StudentProfile.ModifyTime = DateTime.Now; studentProfileUpList.Add(student.CF_StudentProfile); } if (isStuContactCheck) { student.CF_StudentContact.ModifyUserID = userID; student.CF_StudentContact.ModifyTime = DateTime.Now; studentContactUpList.Add(student.CF_StudentContact); } if (isStuAccountCheck) { student.CF_StudentAccount.ModifyUserID = userID; student.CF_StudentAccount.ModifyTime = DateTime.Now; studentAccountUpList.Add(student.CF_StudentAccount); } if (isStuRecruitCheck) { student.CF_Recruitstudents.ModifyUserID = userID; student.CF_Recruitstudents.ModifyTime = DateTime.Now; recruitstudentsUpList.Add(student.CF_Recruitstudents); } #endregion } } else if (checkingControlGroupBy.Key == (int)CF_CheckingType.OpenRecord) { foreach (var checkingControl in checkingControlGroupBy.Value) { #region var keyValuePair = studentViewDataList.Where(x => x.Key == checkingControl.ColumnName).SingleOrDefault(); var approveColumnName = approveColumnNameList.Where(x => x.Key.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); var userProperty = typeof(Sys_User).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (userProperty != null) { if (!(userProperty.GetValue(student.Sys_User, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? ""))) { if (approveColumnName.Key == null) { var userContrastProperty = typeof(Sys_UserContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (userContrastProperty != null) { userContrastProperty.SetValue(userContrast, studentViewDataList[keyValuePair.Key], null); userContrast.ModifyUserID = userID; userContrast.ModifyTime = DateTime.Now; userProperty.SetValue(student.Sys_User, studentViewDataList[keyValuePair.Key], null); isUserCheck = true; var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault(); if (checkingColumnDescription != null) { var studentRecordChangeHistory = new CF_StudentRecordChangeHistory(); studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid(); studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID; studentRecordChangeHistory.TableName = checkingColumnDescription.TableName; studentRecordChangeHistory.ColumnName = keyValuePair.Key; studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key; studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE; studentRecordChangeHistory.CreateUserID = userID; studentRecordChangeHistory.CreateTime = DateTime.Now; studentRecordChangeHistory.ModifyUserID = userID; studentRecordChangeHistory.ModifyTime = DateTime.Now; studentRecordChangeHistoryInList.Add(studentRecordChangeHistory); } else { throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。"); } } } var studentProperty = typeof(CF_Student).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentProperty != null) { if (!(studentProperty.GetValue(student, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? ""))) { if (approveColumnName.Key == null) { var studentContrastProperty = typeof(CF_StudentContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentContrastProperty != null) { studentContrastProperty.SetValue(studentContrast, studentViewDataList[keyValuePair.Key], null); studentContrast.ModifyUserID = userID; studentContrast.ModifyTime = DateTime.Now; studentProperty.SetValue(student, studentViewDataList[keyValuePair.Key], null); isStudentCheck = true; var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault(); if (checkingColumnDescription != null) { var studentRecordChangeHistory = new CF_StudentRecordChangeHistory(); studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid(); studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID; studentRecordChangeHistory.TableName = checkingColumnDescription.TableName; studentRecordChangeHistory.ColumnName = keyValuePair.Key; studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key; studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE; studentRecordChangeHistory.CreateUserID = userID; studentRecordChangeHistory.CreateTime = DateTime.Now; studentRecordChangeHistory.ModifyUserID = userID; studentRecordChangeHistory.ModifyTime = DateTime.Now; studentRecordChangeHistoryInList.Add(studentRecordChangeHistory); } else { throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。"); } } } var studentProfileProperty = typeof(CF_StudentProfile).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentProfileProperty != null) { if (!(studentProfileProperty.GetValue(student.CF_StudentProfile, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? ""))) { if (approveColumnName.Key == null) { var studentProfileContrastProperty = typeof(CF_StudentProfileContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentProfileContrastProperty != null) { studentProfileContrastProperty.SetValue(studentProfileContrast, studentViewDataList[keyValuePair.Key], null); studentProfileContrast.ModifyUserID = userID; studentProfileContrast.ModifyTime = DateTime.Now; studentProfileProperty.SetValue(student.CF_StudentProfile, studentViewDataList[keyValuePair.Key], null); isStuProfileCheck = true; var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault(); if (checkingColumnDescription != null) { var studentRecordChangeHistory = new CF_StudentRecordChangeHistory(); studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid(); studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID; studentRecordChangeHistory.TableName = checkingColumnDescription.TableName; studentRecordChangeHistory.ColumnName = keyValuePair.Key; studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key; studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE; studentRecordChangeHistory.CreateUserID = userID; studentRecordChangeHistory.CreateTime = DateTime.Now; studentRecordChangeHistory.ModifyUserID = userID; studentRecordChangeHistory.ModifyTime = DateTime.Now; studentRecordChangeHistoryInList.Add(studentRecordChangeHistory); } else { throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。"); } } } var studentContactProperty = typeof(CF_StudentContact).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentContactProperty != null) { if (!(studentContactProperty.GetValue(student.CF_StudentContact, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? ""))) { if (approveColumnName.Key == null) { var studentContactContrastProperty = typeof(CF_StudentContactContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentContactContrastProperty != null) { studentContactContrastProperty.SetValue(studentContactContrast, studentViewDataList[keyValuePair.Key], null); studentContactContrast.ModifyUserID = userID; studentContactContrast.ModifyTime = DateTime.Now; studentContactProperty.SetValue(student.CF_StudentContact, studentViewDataList[keyValuePair.Key], null); isStuContactCheck = true; var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault(); if (checkingColumnDescription != null) { var studentRecordChangeHistory = new CF_StudentRecordChangeHistory(); studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid(); studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID; studentRecordChangeHistory.TableName = checkingColumnDescription.TableName; studentRecordChangeHistory.ColumnName = keyValuePair.Key; studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key; studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE; studentRecordChangeHistory.CreateUserID = userID; studentRecordChangeHistory.CreateTime = DateTime.Now; studentRecordChangeHistory.ModifyUserID = userID; studentRecordChangeHistory.ModifyTime = DateTime.Now; studentRecordChangeHistoryInList.Add(studentRecordChangeHistory); } else { throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。"); } } } var studentAccountProperty = typeof(CF_StudentAccount).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentAccountProperty != null) { if (!(studentAccountProperty.GetValue(student.CF_StudentAccount, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? ""))) { if (approveColumnName.Key == null) { var studentAccountContrastProperty = typeof(CF_StudentAccountContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentAccountContrastProperty != null) { studentAccountContrastProperty.SetValue(studentAccountContrast, studentViewDataList[keyValuePair.Key], null); studentAccountContrast.ModifyUserID = userID; studentAccountContrast.ModifyTime = DateTime.Now; studentAccountProperty.SetValue(student.CF_StudentAccount, studentViewDataList[keyValuePair.Key], null); isStuAccountCheck = true; var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault(); if (checkingColumnDescription != null) { var studentRecordChangeHistory = new CF_StudentRecordChangeHistory(); studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid(); studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID; studentRecordChangeHistory.TableName = checkingColumnDescription.TableName; studentRecordChangeHistory.ColumnName = keyValuePair.Key; studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key; studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE; studentRecordChangeHistory.CreateUserID = userID; studentRecordChangeHistory.CreateTime = DateTime.Now; studentRecordChangeHistory.ModifyUserID = userID; studentRecordChangeHistory.ModifyTime = DateTime.Now; studentRecordChangeHistoryInList.Add(studentRecordChangeHistory); } else { throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。"); } } } var recruitstudentsProperty = typeof(CF_Recruitstudents).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (recruitstudentsProperty != null) { if (!(recruitstudentsProperty.GetValue(student.CF_Recruitstudents, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? ""))) { if (approveColumnName.Key == null) { var recruitstudentsContrastProperty = typeof(CF_RecruitstudentsContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (recruitstudentsContrastProperty != null) { recruitstudentsContrastProperty.SetValue(recruitstudentsContrast, studentViewDataList[keyValuePair.Key], null); recruitstudentsContrast.ModifyUserID = userID; recruitstudentsContrast.ModifyTime = DateTime.Now; recruitstudentsProperty.SetValue(student.CF_Recruitstudents, studentViewDataList[keyValuePair.Key], null); isStuRecruitCheck = true; var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault(); if (checkingColumnDescription != null) { var studentRecordChangeHistory = new CF_StudentRecordChangeHistory(); studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid(); studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID; studentRecordChangeHistory.TableName = checkingColumnDescription.TableName; studentRecordChangeHistory.ColumnName = keyValuePair.Key; studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key; studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE; studentRecordChangeHistory.CreateUserID = userID; studentRecordChangeHistory.CreateTime = DateTime.Now; studentRecordChangeHistory.ModifyUserID = userID; studentRecordChangeHistory.ModifyTime = DateTime.Now; studentRecordChangeHistoryInList.Add(studentRecordChangeHistory); } else { throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。"); } } } #endregion } if (isUserCheck || isStudentCheck || isStuProfileCheck || isStuContactCheck || isStuAccountCheck || isStuRecruitCheck) { #region studentContrastInList.Add(studentContrast); studentSourceInList.Add(studentSource); userContrastInList.Add(userContrast); userSourceInList.Add(userSource); studentProfileContrastInList.Add(studentProfileContrast); studentProfileSourceInList.Add(studentProfileSource); studentContactContrastInList.Add(studentContactContrast); studentContactSourceInList.Add(studentContactSource); studentAccountContrastInList.Add(studentAccountContrast); studentAccountSourceInList.Add(studentAccountSource); recruitstudentsContrastInList.Add(recruitstudentsContrast); recruitstudentsSourceInList.Add(recruitstudentsSource); needEditIDList.Add(studentContrast.StudentContrastID); if (isUserCheck) { student.Sys_User.ModifyUserID = userID; student.Sys_User.ModifyTime = DateTime.Now; userUpList.Add(student.Sys_User); } if (isStudentCheck) { student.ModifyUserID = userID; student.ModifyTime = DateTime.Now; studentUpList.Add(student); } if (isStuProfileCheck) { student.CF_StudentProfile.ModifyUserID = userID; student.CF_StudentProfile.ModifyTime = DateTime.Now; studentProfileUpList.Add(student.CF_StudentProfile); } if (isStuContactCheck) { student.CF_StudentContact.ModifyUserID = userID; student.CF_StudentContact.ModifyTime = DateTime.Now; studentContactUpList.Add(student.CF_StudentContact); } if (isStuAccountCheck) { student.CF_StudentAccount.ModifyUserID = userID; student.CF_StudentAccount.ModifyTime = DateTime.Now; studentAccountUpList.Add(student.CF_StudentAccount); } if (isStuRecruitCheck) { student.CF_Recruitstudents.ModifyUserID = userID; student.CF_Recruitstudents.ModifyTime = DateTime.Now; recruitstudentsUpList.Add(student.CF_Recruitstudents); } #endregion } } else { foreach (var checkingControl in checkingControlGroupBy.Value) { #region var keyValuePair = studentViewDataList.Where(x => x.Key == checkingControl.ColumnName).SingleOrDefault(); var approveColumnName = approveColumnNameList.Where(x => x.Key.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); var userProperty = typeof(Sys_User).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (userProperty != null) { if (!(userProperty.GetValue(student.Sys_User, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? ""))) { if (approveColumnName.Key == null) { var userContrastProperty = typeof(Sys_UserContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (userContrastProperty != null) { userContrastProperty.SetValue(userContrast, studentViewDataList[keyValuePair.Key], null); userContrast.ModifyUserID = userID; userContrast.ModifyTime = DateTime.Now; isUserCheck = true; var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault(); if (checkingColumnDescription != null) { var studentRecordChangeHistory = new CF_StudentRecordChangeHistory(); studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid(); studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID; studentRecordChangeHistory.TableName = checkingColumnDescription.TableName; studentRecordChangeHistory.ColumnName = keyValuePair.Key; studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key; studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE; studentRecordChangeHistory.CreateUserID = userID; studentRecordChangeHistory.CreateTime = DateTime.Now; studentRecordChangeHistory.ModifyUserID = userID; studentRecordChangeHistory.ModifyTime = DateTime.Now; studentRecordChangeHistoryInList.Add(studentRecordChangeHistory); } else { throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。"); } } } var studentProperty = typeof(CF_Student).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentProperty != null) { if (!(studentProperty.GetValue(student, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? ""))) { if (approveColumnName.Key == null) { var studentContrastProperty = typeof(CF_StudentContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentContrastProperty != null) { studentContrastProperty.SetValue(studentContrast, studentViewDataList[keyValuePair.Key], null); studentContrast.ModifyUserID = userID; studentContrast.ModifyTime = DateTime.Now; isStudentCheck = true; var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault(); if (checkingColumnDescription != null) { var studentRecordChangeHistory = new CF_StudentRecordChangeHistory(); studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid(); studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID; studentRecordChangeHistory.TableName = checkingColumnDescription.TableName; studentRecordChangeHistory.ColumnName = keyValuePair.Key; studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key; studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE; studentRecordChangeHistory.CreateUserID = userID; studentRecordChangeHistory.CreateTime = DateTime.Now; studentRecordChangeHistory.ModifyUserID = userID; studentRecordChangeHistory.ModifyTime = DateTime.Now; studentRecordChangeHistoryInList.Add(studentRecordChangeHistory); } else { throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。"); } } } var studentProfileProperty = typeof(CF_StudentProfile).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentProfileProperty != null) { if (!(studentProfileProperty.GetValue(student.CF_StudentProfile, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? ""))) { if (approveColumnName.Key == null) { var studentProfileContrastProperty = typeof(CF_StudentProfileContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentProfileContrastProperty != null) { studentProfileContrastProperty.SetValue(studentProfileContrast, studentViewDataList[keyValuePair.Key], null); studentProfileContrast.ModifyUserID = userID; studentProfileContrast.ModifyTime = DateTime.Now; isStuProfileCheck = true; var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault(); if (checkingColumnDescription != null) { var studentRecordChangeHistory = new CF_StudentRecordChangeHistory(); studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid(); studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID; studentRecordChangeHistory.TableName = checkingColumnDescription.TableName; studentRecordChangeHistory.ColumnName = keyValuePair.Key; studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key; studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE; studentRecordChangeHistory.CreateUserID = userID; studentRecordChangeHistory.CreateTime = DateTime.Now; studentRecordChangeHistory.ModifyUserID = userID; studentRecordChangeHistory.ModifyTime = DateTime.Now; studentRecordChangeHistoryInList.Add(studentRecordChangeHistory); } else { throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。"); } } } var studentContactProperty = typeof(CF_StudentContact).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentContactProperty != null) { if (!(studentContactProperty.GetValue(student.CF_StudentContact, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? ""))) { if (approveColumnName.Key == null) { var studentContactContrastProperty = typeof(CF_StudentContactContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentContactContrastProperty != null) { studentContactContrastProperty.SetValue(studentContactContrast, studentViewDataList[keyValuePair.Key], null); studentContactContrast.ModifyUserID = userID; studentContactContrast.ModifyTime = DateTime.Now; isStuContactCheck = true; var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault(); if (checkingColumnDescription != null) { var studentRecordChangeHistory = new CF_StudentRecordChangeHistory(); studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid(); studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID; studentRecordChangeHistory.TableName = checkingColumnDescription.TableName; studentRecordChangeHistory.ColumnName = keyValuePair.Key; studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key; studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE; studentRecordChangeHistory.CreateUserID = userID; studentRecordChangeHistory.CreateTime = DateTime.Now; studentRecordChangeHistory.ModifyUserID = userID; studentRecordChangeHistory.ModifyTime = DateTime.Now; studentRecordChangeHistoryInList.Add(studentRecordChangeHistory); } else { throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。"); } } } var studentAccountProperty = typeof(CF_StudentAccount).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentAccountProperty != null) { if (!(studentAccountProperty.GetValue(student.CF_StudentAccount, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? ""))) { if (approveColumnName.Key == null) { var studentAccountContrastProperty = typeof(CF_StudentAccountContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (studentAccountContrastProperty != null) { studentAccountContrastProperty.SetValue(studentAccountContrast, studentViewDataList[keyValuePair.Key], null); studentAccountContrast.ModifyUserID = userID; studentAccountContrast.ModifyTime = DateTime.Now; isStuAccountCheck = true; var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault(); if (checkingColumnDescription != null) { var studentRecordChangeHistory = new CF_StudentRecordChangeHistory(); studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid(); studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID; studentRecordChangeHistory.TableName = checkingColumnDescription.TableName; studentRecordChangeHistory.ColumnName = keyValuePair.Key; studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key; studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE; studentRecordChangeHistory.CreateUserID = userID; studentRecordChangeHistory.CreateTime = DateTime.Now; studentRecordChangeHistory.ModifyUserID = userID; studentRecordChangeHistory.ModifyTime = DateTime.Now; studentRecordChangeHistoryInList.Add(studentRecordChangeHistory); } else { throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。"); } } } var recruitstudentsProperty = typeof(CF_Recruitstudents).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (recruitstudentsProperty != null) { if (!(recruitstudentsProperty.GetValue(student.CF_Recruitstudents, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? ""))) { if (approveColumnName.Key == null) { var recruitstudentsContrastProperty = typeof(CF_RecruitstudentsContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault(); if (recruitstudentsContrastProperty != null) { recruitstudentsContrastProperty.SetValue(recruitstudentsContrast, studentViewDataList[keyValuePair.Key], null); recruitstudentsContrast.ModifyUserID = userID; recruitstudentsContrast.ModifyTime = DateTime.Now; isStuRecruitCheck = true; var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault(); if (checkingColumnDescription != null) { var studentRecordChangeHistory = new CF_StudentRecordChangeHistory(); studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid(); studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID; studentRecordChangeHistory.TableName = checkingColumnDescription.TableName; studentRecordChangeHistory.ColumnName = keyValuePair.Key; studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key; studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE; studentRecordChangeHistory.CreateUserID = userID; studentRecordChangeHistory.CreateTime = DateTime.Now; studentRecordChangeHistory.ModifyUserID = userID; studentRecordChangeHistory.ModifyTime = DateTime.Now; studentRecordChangeHistoryInList.Add(studentRecordChangeHistory); } else { throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。"); } } else { throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。"); } } } #endregion } if (isUserCheck || isStudentCheck || isStuProfileCheck || isStuContactCheck || isStuAccountCheck || isStuRecruitCheck) { #region studentContrastInList.Add(studentContrast); studentSourceInList.Add(studentSource); userContrastInList.Add(userContrast); userSourceInList.Add(userSource); studentProfileContrastInList.Add(studentProfileContrast); studentProfileSourceInList.Add(studentProfileSource); studentContactContrastInList.Add(studentContactContrast); studentContactSourceInList.Add(studentContactSource); studentAccountContrastInList.Add(studentAccountContrast); studentAccountSourceInList.Add(studentAccountSource); recruitstudentsContrastInList.Add(recruitstudentsContrast); recruitstudentsSourceInList.Add(recruitstudentsSource); needSubmitIDList.Add(studentContrast.StudentContrastID); #endregion } } } if (studentContrastInList != null && studentContrastInList.Count() > 0) { TransactionOptions transactionOption = new TransactionOptions(); transactionOption.IsolationLevel = System.Transactions.IsolationLevel.Serializable; transactionOption.Timeout = new TimeSpan(0, 3, 0); using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required, transactionOption)) { UnitOfWork.BulkInsert(studentContrastInList); UnitOfWork.BulkInsert(studentSourceInList); UnitOfWork.BulkInsert(userContrastInList); UnitOfWork.BulkInsert(userSourceInList); UnitOfWork.BulkInsert(studentProfileContrastInList); UnitOfWork.BulkInsert(studentProfileSourceInList); UnitOfWork.BulkInsert(studentContactContrastInList); UnitOfWork.BulkInsert(studentContactSourceInList); UnitOfWork.BulkInsert(studentAccountContrastInList); UnitOfWork.BulkInsert(studentAccountSourceInList); UnitOfWork.BulkInsert(recruitstudentsContrastInList); UnitOfWork.BulkInsert(recruitstudentsSourceInList); UnitOfWork.BulkInsert(studentRecordChangeHistoryInList); if (needEditIDList.Count > 0) { var startActionEditID = startActionViewList.Where(x => (x.Description ?? "").Contains("[ET]")).Select(x => x.ActionID).SingleOrDefault(); if (startActionEditID == null) { throw new Exception("对应的流程动作未配置(修改)。"); } else { foreach (var needEditID in needEditIDList) { this.StartUp(needEditID, userID.Value, startActionEditID, null); } } } if (needSubmitIDList.Count > 0) { var startActionSubmitID = startActionViewList.Where(x => (x.Description ?? "").Contains("[ST]")).Select(x => x.ActionID).SingleOrDefault(); if (startActionSubmitID == null) { throw new Exception("对应的流程动作未配置(提交)。"); } else { foreach (var needSubmitID in needSubmitIDList) { this.StartUp(needSubmitID, userID.Value, startActionSubmitID, null); } } } if (userUpList != null && userUpList.Count() > 0) { UnitOfWork.BatchUpdate(userUpList); } if (studentUpList != null && studentUpList.Count() > 0) { UnitOfWork.BatchUpdate(studentUpList); } if (studentProfileUpList != null && studentProfileUpList.Count() > 0) { UnitOfWork.BatchUpdate(studentProfileUpList); } if (studentContactUpList != null && studentContactUpList.Count() > 0) { UnitOfWork.BatchUpdate(studentContactUpList); } if (studentAccountUpList != null && studentAccountUpList.Count() > 0) { UnitOfWork.BatchUpdate(studentAccountUpList); } if (recruitstudentsUpList != null && recruitstudentsUpList.Count() > 0) { UnitOfWork.BatchUpdate(recruitstudentsUpList); } ts.Complete(); } } else { throw new Exception("未对任何信息进行校对。"); } } else { throw new Exception("对应的校对字段说明未配置(为空)。"); } } else { throw new Exception("对应的可校对控制信息为空(不可修改)。"); } } catch (Exception ex) { throw new Exception(ex.Message); } } /// /// 学生个人信息核对 /// /// public void StudentProofread(Guid? userID) { try { var student = StudentDAL.StudentRepository.GetList(x => x.UserID == userID).SingleOrDefault(); if (student != null) { student.IsProofread = true; student.ModifyUserID = userID; student.ModifyTime = DateTime.Now; UnitOfWork.Commit(); } else { throw new Exception("数据有误,请重新刷新加载。"); } } catch (Exception ex) { throw new Exception(ex.Message); } } } }