PersonalInfoServices.cs 122 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Web;
  6. using System.Linq.Expressions;
  7. using System.Transactions;
  8. using Bowin.Common.Linq;
  9. using Bowin.Common.Linq.Entity;
  10. using EMIS.Entities;
  11. using EMIS.ViewModel;
  12. using EMIS.ViewModel.StudentManage.InfoCenter;
  13. using EMIS.DataLogic.StudentManage.StudentProfile;
  14. using EMIS.DataLogic.StudentManage.OnlineChecking;
  15. using EMIS.CommonLogic.SystemServices;
  16. using EMIS.CommonLogic.StudentManage.StudentStatistics;
  17. namespace EMIS.CommonLogic.StudentWeb.InfoCenter
  18. {
  19. public class PersonalInfoServices : BaseWorkflowServices<CF_StudentContrast>, IPersonalInfoServices
  20. {
  21. public StudentDAL StudentDAL { get; set; }
  22. public OpenObjectDAL OpenObjectDAL { get; set; }
  23. public CheckingControlDAL CheckingControlDAL { get; set; }
  24. public CheckingApproveDAL CheckingApproveDAL { get; set; }
  25. public Lazy<IInSchoolSettingServices> InSchoolSettingServices { get; set; }
  26. /// <summary>
  27. /// 根据学生信息ID查询对应的网上校对开放对象信息
  28. /// 可校对条件:在校状态为在校且在开放对象范围内
  29. /// </summary>
  30. /// <param name="userID"></param>
  31. public void StudentOpenObject(Guid? userID)
  32. {
  33. try
  34. {
  35. var studentBaseView = StudentDAL.GetStudentBaseViewQueryable(x => x.UserID == userID).SingleOrDefault();
  36. if (studentBaseView != null)
  37. {
  38. if (!InSchoolSettingServices.Value.GetInschoolStatusList(true).Contains(studentBaseView.InSchoolStatusID))
  39. {
  40. throw new Exception("只允许在校生对个人信息进行网上校对。");
  41. }
  42. var currentSchoolYear = StudentDAL.SchoolyearRepository.GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE && x.IsCurrent == true).SingleOrDefault();
  43. if (currentSchoolYear == null)
  44. {
  45. throw new Exception("未设置启用的学年学期,请设置。");
  46. }
  47. var nowSchoolyearNumID = (currentSchoolYear.Value - (currentSchoolYear.SchoolcodeID == studentBaseView.SemesterID ? 0 : 1) - studentBaseView.StartSchoolyearValue.Value) / 2 + 1;
  48. var studentOpenObject = OpenObjectDAL.StudentEditObjectsRepository.GetList(x => x.SchoolyearNumID == nowSchoolyearNumID && x.EducationID == studentBaseView.EducationID).SingleOrDefault();
  49. if (studentOpenObject == null)
  50. {
  51. throw new Exception("未设置对应的网上校对开放对象信息,请设置(入学学年学期:" + studentBaseView.StartSchoolyearCode + ")。");
  52. }
  53. else
  54. {
  55. if (System.DateTime.Now < studentOpenObject.Starttime || System.DateTime.Now > studentOpenObject.Endtime)
  56. {
  57. throw new Exception("对应的网上校对时间不在开放范围内(" + "开放时间:"
  58. + studentOpenObject.Starttime.Value.ToString("yyyy-MM-dd HH:mm") + "--"
  59. + studentOpenObject.Endtime.Value.ToString("yyyy-MM-dd HH:mm") + ")。");
  60. }
  61. }
  62. }
  63. else
  64. {
  65. throw new Exception("数据有误,请重新刷新加载。");
  66. }
  67. }
  68. catch (Exception ex)
  69. {
  70. throw new Exception(ex.Message);
  71. }
  72. }
  73. /// <summary>
  74. /// 查询对应的校对控制信息List
  75. /// </summary>
  76. /// <returns></returns>
  77. public List<EditFeildView> GetStudentEditFeildList()
  78. {
  79. Expression<Func<CF_StudentEditControl, bool>> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  80. var editFeildViewList = CheckingControlDAL.GetStudentEditFeildQueryable(exp).OrderBy(x => x.OrderNo).ToList();
  81. return editFeildViewList;
  82. }
  83. /// <summary>
  84. /// 学生个人信息校对
  85. /// </summary>
  86. /// <param name="studentViewDataList"></param>
  87. /// <param name="userID"></param>
  88. public void StudentCheckEdit(Dictionary<string, object> studentViewDataList, Guid? userID)
  89. {
  90. try
  91. {
  92. this.StudentOpenObject(userID);
  93. var workflowStatusViewList = this.GetStatusViewList();
  94. if (workflowStatusViewList == null || workflowStatusViewList.Count() <= 0)
  95. {
  96. throw new Exception("工作流平台中,网上校对流程未配置,请核查。");
  97. }
  98. var startStatusID = this.GetStartStatus();
  99. if (startStatusID == null)
  100. {
  101. throw new Exception("工作流平台中,网上校对流程开始环节未配置,请核查。");
  102. }
  103. var startActionViewList = this.GetStartActionView().ToList();
  104. var endStatusID = this.GetCorrectEndStatus();
  105. if (endStatusID == null)
  106. {
  107. throw new Exception("工作流平台中,网上校对流程结束环节未配置,请核查。");
  108. }
  109. var approveStatusIDList = this.GetApproveStatusViewList().Select(x => x.ID).ToList();
  110. Expression<Func<CF_StudentContrast, bool>> expStudentContrast = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  111. expStudentContrast = expStudentContrast.And(x => approveStatusIDList.Contains(x.ApprovalStatus));
  112. expStudentContrast = expStudentContrast.And(x => x.UserID == userID);
  113. var approveColumnNameList = CheckingApproveDAL.GetCheckingHistoryViewQueryable(expStudentContrast).ToDictionary(x => x.ColumnName, x => x.Description);
  114. var checkingControlEditList = CheckingControlDAL.StudentEditControlRepository.GetList(x => x.CheckingTypeID != (int)CF_CheckingType.Close).ToList();
  115. if (checkingControlEditList != null && checkingControlEditList.Count() > 0)
  116. {
  117. var checkingColumnDescriptionList = CheckingControlDAL.StudentEditColumnDescriptionRepository.GetList(x => true).ToList();
  118. if (checkingColumnDescriptionList != null && checkingColumnDescriptionList.Count() > 0)
  119. {
  120. List<CF_StudentContrast> studentContrastInList = new List<CF_StudentContrast>();
  121. List<CF_StudentSource> studentSourceInList = new List<CF_StudentSource>();
  122. List<Sys_UserContrast> userContrastInList = new List<Sys_UserContrast>();
  123. List<Sys_UserSource> userSourceInList = new List<Sys_UserSource>();
  124. List<CF_StudentProfileContrast> studentProfileContrastInList = new List<CF_StudentProfileContrast>();
  125. List<CF_StudentProfileSource> studentProfileSourceInList = new List<CF_StudentProfileSource>();
  126. List<CF_StudentContactContrast> studentContactContrastInList = new List<CF_StudentContactContrast>();
  127. List<CF_StudentContactSource> studentContactSourceInList = new List<CF_StudentContactSource>();
  128. List<CF_StudentAccountContrast> studentAccountContrastInList = new List<CF_StudentAccountContrast>();
  129. List<CF_StudentAccountSource> studentAccountSourceInList = new List<CF_StudentAccountSource>();
  130. List<CF_RecruitstudentsContrast> recruitstudentsContrastInList = new List<CF_RecruitstudentsContrast>();
  131. List<CF_RecruitstudentsSource> recruitstudentsSourceInList = new List<CF_RecruitstudentsSource>();
  132. List<Guid> needEditIDList = new List<Guid>();
  133. List<Guid> needSubmitIDList = new List<Guid>();
  134. List<Sys_User> userUpList = new List<Sys_User>();
  135. List<CF_Student> studentUpList = new List<CF_Student>();
  136. List<CF_StudentProfile> studentProfileUpList = new List<CF_StudentProfile>();
  137. List<CF_StudentContact> studentContactUpList = new List<CF_StudentContact>();
  138. List<CF_StudentAccount> studentAccountUpList = new List<CF_StudentAccount>();
  139. List<CF_Recruitstudents> recruitstudentsUpList = new List<CF_Recruitstudents>();
  140. List<CF_StudentRecordChangeHistory> studentRecordChangeHistoryInList = new List<CF_StudentRecordChangeHistory>();
  141. bool isUserCheck = false;
  142. bool isStudentCheck = false;
  143. bool isStuProfileCheck = false;
  144. bool isStuContactCheck = false;
  145. bool isStuAccountCheck = false;
  146. bool isStuRecruitCheck = false;
  147. 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();
  148. var checkingControlGroupByDictionary = checkingControlEditList.GroupBy(x => x.CheckingTypeID).ToDictionary(x => x.Key, x => x.DefaultIfEmpty());
  149. foreach (var checkingControlGroupBy in checkingControlGroupByDictionary)
  150. {
  151. #region
  152. isUserCheck = false;
  153. isStudentCheck = false;
  154. isStuProfileCheck = false;
  155. isStuContactCheck = false;
  156. isStuAccountCheck = false;
  157. isStuRecruitCheck = false;
  158. var studentContrast = new CF_StudentContrast();
  159. studentContrast.StudentContrastID = Guid.NewGuid();
  160. studentContrast.UserID = student.UserID;
  161. studentContrast.ClassmajorID = student.ClassmajorID;
  162. studentContrast.SexID = student.SexID;
  163. studentContrast.BirthDate = student.BirthDate;
  164. studentContrast.NationID = student.NationID;
  165. studentContrast.PoliticsID = student.PoliticsID;
  166. studentContrast.CertificatesType = student.CertificatesType;
  167. studentContrast.IDNumber = student.IDNumber;
  168. studentContrast.StudentType = student.StudentType;
  169. studentContrast.InSchoolStatusID = student.InSchoolStatusID;
  170. studentContrast.StudentStatus = student.StudentStatus;
  171. studentContrast.StudentCardNo = student.StudentCardNo;
  172. studentContrast.PhotoUrl = student.PhotoUrl;
  173. studentContrast.PlanningGraduateDate = student.PlanningGraduateDate;
  174. studentContrast.GraduateDate = student.GraduateDate;
  175. studentContrast.GraduateCardNo = student.GraduateCardNo;
  176. studentContrast.ReplaceGraduateNo = student.ReplaceGraduateNo;
  177. studentContrast.DegreeStatus = student.DegreeStatus;
  178. studentContrast.GraduationPictureUrl = student.GraduationPictureUrl;
  179. studentContrast.Career = student.Career;
  180. studentContrast.IsPhotoComparison = student.IsPhotoComparison;
  181. studentContrast.IsProofread = student.IsProofread;
  182. studentContrast.Remark = student.Remark;
  183. studentContrast.IP = HttpContext.Current.Request.UserHostAddress;
  184. studentContrast.ApprovalStatus = startStatusID;
  185. studentContrast.Comment = null;
  186. studentContrast.RecordStatus = (int)SYS_STATUS.USABLE;
  187. studentContrast.CreateUserID = userID;
  188. studentContrast.CreateTime = DateTime.Now;
  189. studentContrast.ModifyUserID = userID;
  190. studentContrast.ModifyTime = DateTime.Now;
  191. var studentSource = new CF_StudentSource();
  192. studentSource.StudentContrastID = studentContrast.StudentContrastID;
  193. studentSource.ClassmajorID = student.ClassmajorID;
  194. studentSource.SexID = student.SexID;
  195. studentSource.BirthDate = student.BirthDate;
  196. studentSource.NationID = student.NationID;
  197. studentSource.PoliticsID = student.PoliticsID;
  198. studentSource.CertificatesType = student.CertificatesType;
  199. studentSource.IDNumber = student.IDNumber;
  200. studentSource.StudentType = student.StudentType;
  201. studentSource.InSchoolStatusID = student.InSchoolStatusID;
  202. studentSource.StudentStatus = student.StudentStatus;
  203. studentSource.StudentCardNo = student.StudentCardNo;
  204. studentSource.PhotoUrl = student.PhotoUrl;
  205. studentSource.PlanningGraduateDate = student.PlanningGraduateDate;
  206. studentSource.GraduateDate = student.GraduateDate;
  207. studentSource.GraduateCardNo = student.GraduateCardNo;
  208. studentSource.ReplaceGraduateNo = student.ReplaceGraduateNo;
  209. studentSource.DegreeStatus = student.DegreeStatus;
  210. studentSource.GraduationPictureUrl = student.GraduationPictureUrl;
  211. studentSource.Career = student.Career;
  212. studentSource.IsPhotoComparison = student.IsPhotoComparison;
  213. studentSource.IsProofread = student.IsProofread;
  214. studentSource.Remark = student.Remark;
  215. var userContrast = new Sys_UserContrast();
  216. userContrast.StudentContrastID = studentContrast.StudentContrastID;
  217. userContrast.LoginID = student.Sys_User.LoginID;
  218. userContrast.Name = student.Sys_User.Name;
  219. userContrast.RecordStatus = (int)SYS_STATUS.USABLE;
  220. userContrast.CreateUserID = userID;
  221. userContrast.CreateTime = DateTime.Now;
  222. userContrast.ModifyUserID = userID;
  223. userContrast.ModifyTime = DateTime.Now;
  224. var userSource = new Sys_UserSource();
  225. userSource.StudentContrastID = studentContrast.StudentContrastID;
  226. userSource.LoginID = student.Sys_User.LoginID;
  227. userSource.Name = student.Sys_User.Name;
  228. var studentProfileContrast = new CF_StudentProfileContrast();
  229. studentProfileContrast.StudentContrastID = studentContrast.StudentContrastID;
  230. studentProfileContrast.UsedName = student.CF_StudentProfile.UsedName;
  231. studentProfileContrast.LiteracyLevelID = student.CF_StudentProfile.LiteracyLevelID;
  232. studentProfileContrast.CultureModelID = student.CF_StudentProfile.CultureModelID;
  233. studentProfileContrast.IsDreamProject = student.CF_StudentProfile.IsDreamProject;
  234. studentProfileContrast.Country = student.CF_StudentProfile.Country;
  235. studentProfileContrast.Place = student.CF_StudentProfile.Place;
  236. studentProfileContrast.BornPlace = student.CF_StudentProfile.BornPlace;
  237. studentProfileContrast.HealthStateID = student.CF_StudentProfile.HealthStateID;
  238. studentProfileContrast.BloodGroup = student.CF_StudentProfile.BloodGroup;
  239. studentProfileContrast.Specialty = student.CF_StudentProfile.Specialty;
  240. studentProfileContrast.Height = student.CF_StudentProfile.Height;
  241. studentProfileContrast.Weight = student.CF_StudentProfile.Weight;
  242. studentProfileContrast.DirectorName = student.CF_StudentProfile.DirectorName;
  243. studentProfileContrast.RecordStatus = (int)SYS_STATUS.USABLE;
  244. studentProfileContrast.CreateUserID = userID;
  245. studentProfileContrast.CreateTime = DateTime.Now;
  246. studentProfileContrast.ModifyUserID = userID;
  247. studentProfileContrast.ModifyTime = DateTime.Now;
  248. var studentProfileSource = new CF_StudentProfileSource();
  249. studentProfileSource.StudentContrastID = studentContrast.StudentContrastID;
  250. studentProfileSource.UsedName = student.CF_StudentProfile.UsedName;
  251. studentProfileSource.LiteracyLevelID = student.CF_StudentProfile.LiteracyLevelID;
  252. studentProfileSource.CultureModelID = student.CF_StudentProfile.CultureModelID;
  253. studentProfileSource.IsDreamProject = student.CF_StudentProfile.IsDreamProject;
  254. studentProfileSource.Country = student.CF_StudentProfile.Country;
  255. studentProfileSource.Place = student.CF_StudentProfile.Place;
  256. studentProfileSource.BornPlace = student.CF_StudentProfile.BornPlace;
  257. studentProfileSource.HealthStateID = student.CF_StudentProfile.HealthStateID;
  258. studentProfileSource.BloodGroup = student.CF_StudentProfile.BloodGroup;
  259. studentProfileSource.Specialty = student.CF_StudentProfile.Specialty;
  260. studentProfileSource.Height = student.CF_StudentProfile.Height;
  261. studentProfileSource.Weight = student.CF_StudentProfile.Weight;
  262. studentProfileSource.DirectorName = student.CF_StudentProfile.DirectorName;
  263. var studentContactContrast = new CF_StudentContactContrast();
  264. studentContactContrast.StudentContrastID = studentContrast.StudentContrastID;
  265. studentContactContrast.Email = student.CF_StudentContact.Email;
  266. studentContactContrast.Telephone = student.CF_StudentContact.Telephone;
  267. studentContactContrast.Mobile = student.CF_StudentContact.Mobile;
  268. studentContactContrast.ZIPCode = student.CF_StudentContact.ZIPCode;
  269. studentContactContrast.WeChatNum = student.CF_StudentContact.WeChatNum;
  270. studentContactContrast.QQ = student.CF_StudentContact.QQ;
  271. studentContactContrast.HomeAddress = student.CF_StudentContact.HomeAddress;
  272. studentContactContrast.WorkUnit = student.CF_StudentContact.WorkUnit;
  273. studentContactContrast.Address = student.CF_StudentContact.Address;
  274. studentContactContrast.Recipient = student.CF_StudentContact.Recipient;
  275. studentContactContrast.Dormitory = student.CF_StudentContact.Dormitory;
  276. studentContactContrast.RecordStatus = (int)SYS_STATUS.USABLE;
  277. studentContactContrast.CreateUserID = userID;
  278. studentContactContrast.CreateTime = DateTime.Now;
  279. studentContactContrast.ModifyUserID = userID;
  280. studentContactContrast.ModifyTime = DateTime.Now;
  281. var studentContactSource = new CF_StudentContactSource();
  282. studentContactSource.StudentContrastID = studentContrast.StudentContrastID;
  283. studentContactSource.Email = student.CF_StudentContact.Email;
  284. studentContactSource.Telephone = student.CF_StudentContact.Telephone;
  285. studentContactSource.Mobile = student.CF_StudentContact.Mobile;
  286. studentContactSource.ZIPCode = student.CF_StudentContact.ZIPCode;
  287. studentContactSource.WeChatNum = student.CF_StudentContact.WeChatNum;
  288. studentContactSource.QQ = student.CF_StudentContact.QQ;
  289. studentContactSource.HomeAddress = student.CF_StudentContact.HomeAddress;
  290. studentContactSource.WorkUnit = student.CF_StudentContact.WorkUnit;
  291. studentContactSource.Address = student.CF_StudentContact.Address;
  292. studentContactSource.Recipient = student.CF_StudentContact.Recipient;
  293. studentContactSource.Dormitory = student.CF_StudentContact.Dormitory;
  294. var studentAccountContrast = new CF_StudentAccountContrast();
  295. studentAccountContrast.StudentContrastID = studentContrast.StudentContrastID;
  296. studentAccountContrast.CardNo = student.CF_StudentAccount.CardNo;
  297. studentAccountContrast.BankName = student.CF_StudentAccount.BankName;
  298. studentAccountContrast.RecordStatus = (int)SYS_STATUS.USABLE;
  299. studentAccountContrast.CreateUserID = userID;
  300. studentAccountContrast.CreateTime = DateTime.Now;
  301. studentAccountContrast.ModifyUserID = userID;
  302. studentAccountContrast.ModifyTime = DateTime.Now;
  303. var studentAccountSource = new CF_StudentAccountSource();
  304. studentAccountSource.StudentContrastID = studentContrast.StudentContrastID;
  305. studentAccountSource.CardNo = student.CF_StudentAccount.CardNo;
  306. studentAccountSource.BankName = student.CF_StudentAccount.BankName;
  307. var recruitstudentsContrast = new CF_RecruitstudentsContrast();
  308. recruitstudentsContrast.StudentContrastID = studentContrast.StudentContrastID;
  309. recruitstudentsContrast.ExamineeNum = student.CF_Recruitstudents.ExamineeNum;
  310. recruitstudentsContrast.AdmissionTicketNo = student.CF_Recruitstudents.AdmissionTicketNo;
  311. recruitstudentsContrast.ExamineeType = student.CF_Recruitstudents.ExamineeType;
  312. recruitstudentsContrast.EnteringSchoolYearID = student.CF_Recruitstudents.EnteringSchoolYearID;
  313. recruitstudentsContrast.EntranceDate = student.CF_Recruitstudents.EntranceDate;
  314. recruitstudentsContrast.Score = student.CF_Recruitstudents.Score;
  315. recruitstudentsContrast.EntranceWayID = student.CF_Recruitstudents.EntranceWayID;
  316. recruitstudentsContrast.FeaturesID = student.CF_Recruitstudents.FeaturesID;
  317. recruitstudentsContrast.TerritorialID = student.CF_Recruitstudents.TerritorialID;
  318. recruitstudentsContrast.Area = student.CF_Recruitstudents.Area;
  319. recruitstudentsContrast.RecruitPictureUrl = student.CF_Recruitstudents.RecruitPictureUrl;
  320. recruitstudentsContrast.RecordStatus = (int)SYS_STATUS.USABLE;
  321. recruitstudentsContrast.CreateUserID = userID;
  322. recruitstudentsContrast.CreateTime = DateTime.Now;
  323. recruitstudentsContrast.ModifyUserID = userID;
  324. recruitstudentsContrast.ModifyTime = DateTime.Now;
  325. var recruitstudentsSource = new CF_RecruitstudentsSource();
  326. recruitstudentsSource.StudentContrastID = studentContrast.StudentContrastID;
  327. recruitstudentsSource.ExamineeNum = student.CF_Recruitstudents.ExamineeNum;
  328. recruitstudentsSource.AdmissionTicketNo = student.CF_Recruitstudents.AdmissionTicketNo;
  329. recruitstudentsSource.ExamineeType = student.CF_Recruitstudents.ExamineeType;
  330. recruitstudentsSource.EnteringSchoolYearID = student.CF_Recruitstudents.EnteringSchoolYearID;
  331. recruitstudentsSource.EntranceDate = student.CF_Recruitstudents.EntranceDate;
  332. recruitstudentsSource.Score = student.CF_Recruitstudents.Score;
  333. recruitstudentsSource.EntranceWayID = student.CF_Recruitstudents.EntranceWayID;
  334. recruitstudentsSource.FeaturesID = student.CF_Recruitstudents.FeaturesID;
  335. recruitstudentsSource.TerritorialID = student.CF_Recruitstudents.TerritorialID;
  336. recruitstudentsSource.Area = student.CF_Recruitstudents.Area;
  337. recruitstudentsSource.RecruitPictureUrl = student.CF_Recruitstudents.RecruitPictureUrl;
  338. #endregion
  339. if (checkingControlGroupBy.Key == (int)CF_CheckingType.AllOpen)
  340. {
  341. foreach (var checkingControl in checkingControlGroupBy.Value)
  342. {
  343. #region
  344. var keyValuePair = studentViewDataList.Where(x => x.Key == checkingControl.ColumnName).SingleOrDefault();
  345. var approveColumnName = approveColumnNameList.Where(x => x.Key.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  346. var userProperty = typeof(Sys_User).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  347. if (userProperty != null)
  348. {
  349. if (!(userProperty.GetValue(student.Sys_User, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? "")))
  350. {
  351. if (approveColumnName.Key == null)
  352. {
  353. var userContrastProperty = typeof(Sys_UserContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  354. if (userContrastProperty != null)
  355. {
  356. userContrastProperty.SetValue(userContrast, studentViewDataList[keyValuePair.Key], null);
  357. userContrast.ModifyUserID = userID;
  358. userContrast.ModifyTime = DateTime.Now;
  359. userProperty.SetValue(student.Sys_User, studentViewDataList[keyValuePair.Key], null);
  360. isUserCheck = true;
  361. var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault();
  362. if (checkingColumnDescription != null)
  363. {
  364. var studentRecordChangeHistory = new CF_StudentRecordChangeHistory();
  365. studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid();
  366. studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID;
  367. studentRecordChangeHistory.TableName = checkingColumnDescription.TableName;
  368. studentRecordChangeHistory.ColumnName = keyValuePair.Key;
  369. studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key;
  370. studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.UNUSABLE;
  371. studentRecordChangeHistory.CreateUserID = userID;
  372. studentRecordChangeHistory.CreateTime = DateTime.Now;
  373. studentRecordChangeHistory.ModifyUserID = userID;
  374. studentRecordChangeHistory.ModifyTime = DateTime.Now;
  375. studentRecordChangeHistoryInList.Add(studentRecordChangeHistory);
  376. }
  377. else
  378. {
  379. throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。");
  380. }
  381. }
  382. else
  383. {
  384. throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。");
  385. }
  386. }
  387. else
  388. {
  389. throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。");
  390. }
  391. }
  392. }
  393. var studentProperty = typeof(CF_Student).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  394. if (studentProperty != null)
  395. {
  396. if (!(studentProperty.GetValue(student, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? "")))
  397. {
  398. if (approveColumnName.Key == null)
  399. {
  400. var studentContrastProperty = typeof(CF_StudentContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  401. if (studentContrastProperty != null)
  402. {
  403. studentContrastProperty.SetValue(studentContrast, studentViewDataList[keyValuePair.Key], null);
  404. studentContrast.ModifyUserID = userID;
  405. studentContrast.ModifyTime = DateTime.Now;
  406. studentProperty.SetValue(student, studentViewDataList[keyValuePair.Key], null);
  407. isStudentCheck = true;
  408. var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault();
  409. if (checkingColumnDescription != null)
  410. {
  411. var studentRecordChangeHistory = new CF_StudentRecordChangeHistory();
  412. studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid();
  413. studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID;
  414. studentRecordChangeHistory.TableName = checkingColumnDescription.TableName;
  415. studentRecordChangeHistory.ColumnName = keyValuePair.Key;
  416. studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key;
  417. studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.UNUSABLE;
  418. studentRecordChangeHistory.CreateUserID = userID;
  419. studentRecordChangeHistory.CreateTime = DateTime.Now;
  420. studentRecordChangeHistory.ModifyUserID = userID;
  421. studentRecordChangeHistory.ModifyTime = DateTime.Now;
  422. studentRecordChangeHistoryInList.Add(studentRecordChangeHistory);
  423. }
  424. else
  425. {
  426. throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。");
  427. }
  428. }
  429. else
  430. {
  431. throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。");
  432. }
  433. }
  434. else
  435. {
  436. throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。");
  437. }
  438. }
  439. }
  440. var studentProfileProperty = typeof(CF_StudentProfile).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  441. if (studentProfileProperty != null)
  442. {
  443. if (!(studentProfileProperty.GetValue(student.CF_StudentProfile, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? "")))
  444. {
  445. if (approveColumnName.Key == null)
  446. {
  447. var studentProfileContrastProperty = typeof(CF_StudentProfileContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  448. if (studentProfileContrastProperty != null)
  449. {
  450. studentProfileContrastProperty.SetValue(studentProfileContrast, studentViewDataList[keyValuePair.Key], null);
  451. studentProfileContrast.ModifyUserID = userID;
  452. studentProfileContrast.ModifyTime = DateTime.Now;
  453. studentProfileProperty.SetValue(student.CF_StudentProfile, studentViewDataList[keyValuePair.Key], null);
  454. isStuProfileCheck = true;
  455. var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault();
  456. if (checkingColumnDescription != null)
  457. {
  458. var studentRecordChangeHistory = new CF_StudentRecordChangeHistory();
  459. studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid();
  460. studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID;
  461. studentRecordChangeHistory.TableName = checkingColumnDescription.TableName;
  462. studentRecordChangeHistory.ColumnName = keyValuePair.Key;
  463. studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key;
  464. studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.UNUSABLE;
  465. studentRecordChangeHistory.CreateUserID = userID;
  466. studentRecordChangeHistory.CreateTime = DateTime.Now;
  467. studentRecordChangeHistory.ModifyUserID = userID;
  468. studentRecordChangeHistory.ModifyTime = DateTime.Now;
  469. studentRecordChangeHistoryInList.Add(studentRecordChangeHistory);
  470. }
  471. else
  472. {
  473. throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。");
  474. }
  475. }
  476. else
  477. {
  478. throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。");
  479. }
  480. }
  481. else
  482. {
  483. throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。");
  484. }
  485. }
  486. }
  487. var studentContactProperty = typeof(CF_StudentContact).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  488. if (studentContactProperty != null)
  489. {
  490. if (!(studentContactProperty.GetValue(student.CF_StudentContact, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? "")))
  491. {
  492. if (approveColumnName.Key == null)
  493. {
  494. var studentContactContrastProperty = typeof(CF_StudentContactContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  495. if (studentContactContrastProperty != null)
  496. {
  497. studentContactContrastProperty.SetValue(studentContactContrast, studentViewDataList[keyValuePair.Key], null);
  498. studentContactContrast.ModifyUserID = userID;
  499. studentContactContrast.ModifyTime = DateTime.Now;
  500. studentContactProperty.SetValue(student.CF_StudentContact, studentViewDataList[keyValuePair.Key], null);
  501. isStuContactCheck = true;
  502. var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault();
  503. if (checkingColumnDescription != null)
  504. {
  505. var studentRecordChangeHistory = new CF_StudentRecordChangeHistory();
  506. studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid();
  507. studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID;
  508. studentRecordChangeHistory.TableName = checkingColumnDescription.TableName;
  509. studentRecordChangeHistory.ColumnName = keyValuePair.Key;
  510. studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key;
  511. studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.UNUSABLE;
  512. studentRecordChangeHistory.CreateUserID = userID;
  513. studentRecordChangeHistory.CreateTime = DateTime.Now;
  514. studentRecordChangeHistory.ModifyUserID = userID;
  515. studentRecordChangeHistory.ModifyTime = DateTime.Now;
  516. studentRecordChangeHistoryInList.Add(studentRecordChangeHistory);
  517. }
  518. else
  519. {
  520. throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。");
  521. }
  522. }
  523. else
  524. {
  525. throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。");
  526. }
  527. }
  528. else
  529. {
  530. throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。");
  531. }
  532. }
  533. }
  534. var studentAccountProperty = typeof(CF_StudentAccount).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  535. if (studentAccountProperty != null)
  536. {
  537. if (!(studentAccountProperty.GetValue(student.CF_StudentAccount, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? "")))
  538. {
  539. if (approveColumnName.Key == null)
  540. {
  541. var studentAccountContrastProperty = typeof(CF_StudentAccountContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  542. if (studentAccountContrastProperty != null)
  543. {
  544. studentAccountContrastProperty.SetValue(studentAccountContrast, studentViewDataList[keyValuePair.Key], null);
  545. studentAccountContrast.ModifyUserID = userID;
  546. studentAccountContrast.ModifyTime = DateTime.Now;
  547. studentAccountProperty.SetValue(student.CF_StudentAccount, studentViewDataList[keyValuePair.Key], null);
  548. isStuAccountCheck = true;
  549. var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault();
  550. if (checkingColumnDescription != null)
  551. {
  552. var studentRecordChangeHistory = new CF_StudentRecordChangeHistory();
  553. studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid();
  554. studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID;
  555. studentRecordChangeHistory.TableName = checkingColumnDescription.TableName;
  556. studentRecordChangeHistory.ColumnName = keyValuePair.Key;
  557. studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key;
  558. studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.UNUSABLE;
  559. studentRecordChangeHistory.CreateUserID = userID;
  560. studentRecordChangeHistory.CreateTime = DateTime.Now;
  561. studentRecordChangeHistory.ModifyUserID = userID;
  562. studentRecordChangeHistory.ModifyTime = DateTime.Now;
  563. studentRecordChangeHistoryInList.Add(studentRecordChangeHistory);
  564. }
  565. else
  566. {
  567. throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。");
  568. }
  569. }
  570. else
  571. {
  572. throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。");
  573. }
  574. }
  575. else
  576. {
  577. throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。");
  578. }
  579. }
  580. }
  581. var recruitstudentsProperty = typeof(CF_Recruitstudents).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  582. if (recruitstudentsProperty != null)
  583. {
  584. if (!(recruitstudentsProperty.GetValue(student.CF_Recruitstudents, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? "")))
  585. {
  586. if (approveColumnName.Key == null)
  587. {
  588. var recruitstudentsContrastProperty = typeof(CF_RecruitstudentsContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  589. if (recruitstudentsContrastProperty != null)
  590. {
  591. recruitstudentsContrastProperty.SetValue(recruitstudentsContrast, studentViewDataList[keyValuePair.Key], null);
  592. recruitstudentsContrast.ModifyUserID = userID;
  593. recruitstudentsContrast.ModifyTime = DateTime.Now;
  594. recruitstudentsProperty.SetValue(student.CF_Recruitstudents, studentViewDataList[keyValuePair.Key], null);
  595. isStuRecruitCheck = true;
  596. var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault();
  597. if (checkingColumnDescription != null)
  598. {
  599. var studentRecordChangeHistory = new CF_StudentRecordChangeHistory();
  600. studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid();
  601. studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID;
  602. studentRecordChangeHistory.TableName = checkingColumnDescription.TableName;
  603. studentRecordChangeHistory.ColumnName = keyValuePair.Key;
  604. studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key;
  605. studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.UNUSABLE;
  606. studentRecordChangeHistory.CreateUserID = userID;
  607. studentRecordChangeHistory.CreateTime = DateTime.Now;
  608. studentRecordChangeHistory.ModifyUserID = userID;
  609. studentRecordChangeHistory.ModifyTime = DateTime.Now;
  610. studentRecordChangeHistoryInList.Add(studentRecordChangeHistory);
  611. }
  612. else
  613. {
  614. throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。");
  615. }
  616. }
  617. else
  618. {
  619. throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。");
  620. }
  621. }
  622. else
  623. {
  624. throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。");
  625. }
  626. }
  627. }
  628. #endregion
  629. }
  630. if (isUserCheck || isStudentCheck || isStuProfileCheck || isStuContactCheck || isStuAccountCheck || isStuRecruitCheck)
  631. {
  632. #region
  633. studentContrastInList.Add(studentContrast);
  634. studentSourceInList.Add(studentSource);
  635. userContrastInList.Add(userContrast);
  636. userSourceInList.Add(userSource);
  637. studentProfileContrastInList.Add(studentProfileContrast);
  638. studentProfileSourceInList.Add(studentProfileSource);
  639. studentContactContrastInList.Add(studentContactContrast);
  640. studentContactSourceInList.Add(studentContactSource);
  641. studentAccountContrastInList.Add(studentAccountContrast);
  642. studentAccountSourceInList.Add(studentAccountSource);
  643. recruitstudentsContrastInList.Add(recruitstudentsContrast);
  644. recruitstudentsSourceInList.Add(recruitstudentsSource);
  645. needEditIDList.Add(studentContrast.StudentContrastID);
  646. if (isUserCheck)
  647. {
  648. student.Sys_User.ModifyUserID = userID;
  649. student.Sys_User.ModifyTime = DateTime.Now;
  650. userUpList.Add(student.Sys_User);
  651. }
  652. if (isStudentCheck)
  653. {
  654. student.ModifyUserID = userID;
  655. student.ModifyTime = DateTime.Now;
  656. studentUpList.Add(student);
  657. }
  658. if (isStuProfileCheck)
  659. {
  660. student.CF_StudentProfile.ModifyUserID = userID;
  661. student.CF_StudentProfile.ModifyTime = DateTime.Now;
  662. studentProfileUpList.Add(student.CF_StudentProfile);
  663. }
  664. if (isStuContactCheck)
  665. {
  666. student.CF_StudentContact.ModifyUserID = userID;
  667. student.CF_StudentContact.ModifyTime = DateTime.Now;
  668. studentContactUpList.Add(student.CF_StudentContact);
  669. }
  670. if (isStuAccountCheck)
  671. {
  672. student.CF_StudentAccount.ModifyUserID = userID;
  673. student.CF_StudentAccount.ModifyTime = DateTime.Now;
  674. studentAccountUpList.Add(student.CF_StudentAccount);
  675. }
  676. if (isStuRecruitCheck)
  677. {
  678. student.CF_Recruitstudents.ModifyUserID = userID;
  679. student.CF_Recruitstudents.ModifyTime = DateTime.Now;
  680. recruitstudentsUpList.Add(student.CF_Recruitstudents);
  681. }
  682. #endregion
  683. }
  684. }
  685. else if (checkingControlGroupBy.Key == (int)CF_CheckingType.OpenRecord)
  686. {
  687. foreach (var checkingControl in checkingControlGroupBy.Value)
  688. {
  689. #region
  690. var keyValuePair = studentViewDataList.Where(x => x.Key == checkingControl.ColumnName).SingleOrDefault();
  691. var approveColumnName = approveColumnNameList.Where(x => x.Key.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  692. var userProperty = typeof(Sys_User).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  693. if (userProperty != null)
  694. {
  695. if (!(userProperty.GetValue(student.Sys_User, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? "")))
  696. {
  697. if (approveColumnName.Key == null)
  698. {
  699. var userContrastProperty = typeof(Sys_UserContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  700. if (userContrastProperty != null)
  701. {
  702. userContrastProperty.SetValue(userContrast, studentViewDataList[keyValuePair.Key], null);
  703. userContrast.ModifyUserID = userID;
  704. userContrast.ModifyTime = DateTime.Now;
  705. userProperty.SetValue(student.Sys_User, studentViewDataList[keyValuePair.Key], null);
  706. isUserCheck = true;
  707. var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault();
  708. if (checkingColumnDescription != null)
  709. {
  710. var studentRecordChangeHistory = new CF_StudentRecordChangeHistory();
  711. studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid();
  712. studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID;
  713. studentRecordChangeHistory.TableName = checkingColumnDescription.TableName;
  714. studentRecordChangeHistory.ColumnName = keyValuePair.Key;
  715. studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key;
  716. studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE;
  717. studentRecordChangeHistory.CreateUserID = userID;
  718. studentRecordChangeHistory.CreateTime = DateTime.Now;
  719. studentRecordChangeHistory.ModifyUserID = userID;
  720. studentRecordChangeHistory.ModifyTime = DateTime.Now;
  721. studentRecordChangeHistoryInList.Add(studentRecordChangeHistory);
  722. }
  723. else
  724. {
  725. throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。");
  726. }
  727. }
  728. else
  729. {
  730. throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。");
  731. }
  732. }
  733. else
  734. {
  735. throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。");
  736. }
  737. }
  738. }
  739. var studentProperty = typeof(CF_Student).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  740. if (studentProperty != null)
  741. {
  742. if (!(studentProperty.GetValue(student, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? "")))
  743. {
  744. if (approveColumnName.Key == null)
  745. {
  746. var studentContrastProperty = typeof(CF_StudentContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  747. if (studentContrastProperty != null)
  748. {
  749. studentContrastProperty.SetValue(studentContrast, studentViewDataList[keyValuePair.Key], null);
  750. studentContrast.ModifyUserID = userID;
  751. studentContrast.ModifyTime = DateTime.Now;
  752. studentProperty.SetValue(student, studentViewDataList[keyValuePair.Key], null);
  753. isStudentCheck = true;
  754. var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault();
  755. if (checkingColumnDescription != null)
  756. {
  757. var studentRecordChangeHistory = new CF_StudentRecordChangeHistory();
  758. studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid();
  759. studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID;
  760. studentRecordChangeHistory.TableName = checkingColumnDescription.TableName;
  761. studentRecordChangeHistory.ColumnName = keyValuePair.Key;
  762. studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key;
  763. studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE;
  764. studentRecordChangeHistory.CreateUserID = userID;
  765. studentRecordChangeHistory.CreateTime = DateTime.Now;
  766. studentRecordChangeHistory.ModifyUserID = userID;
  767. studentRecordChangeHistory.ModifyTime = DateTime.Now;
  768. studentRecordChangeHistoryInList.Add(studentRecordChangeHistory);
  769. }
  770. else
  771. {
  772. throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。");
  773. }
  774. }
  775. else
  776. {
  777. throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。");
  778. }
  779. }
  780. else
  781. {
  782. throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。");
  783. }
  784. }
  785. }
  786. var studentProfileProperty = typeof(CF_StudentProfile).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  787. if (studentProfileProperty != null)
  788. {
  789. if (!(studentProfileProperty.GetValue(student.CF_StudentProfile, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? "")))
  790. {
  791. if (approveColumnName.Key == null)
  792. {
  793. var studentProfileContrastProperty = typeof(CF_StudentProfileContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  794. if (studentProfileContrastProperty != null)
  795. {
  796. studentProfileContrastProperty.SetValue(studentProfileContrast, studentViewDataList[keyValuePair.Key], null);
  797. studentProfileContrast.ModifyUserID = userID;
  798. studentProfileContrast.ModifyTime = DateTime.Now;
  799. studentProfileProperty.SetValue(student.CF_StudentProfile, studentViewDataList[keyValuePair.Key], null);
  800. isStuProfileCheck = true;
  801. var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault();
  802. if (checkingColumnDescription != null)
  803. {
  804. var studentRecordChangeHistory = new CF_StudentRecordChangeHistory();
  805. studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid();
  806. studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID;
  807. studentRecordChangeHistory.TableName = checkingColumnDescription.TableName;
  808. studentRecordChangeHistory.ColumnName = keyValuePair.Key;
  809. studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key;
  810. studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE;
  811. studentRecordChangeHistory.CreateUserID = userID;
  812. studentRecordChangeHistory.CreateTime = DateTime.Now;
  813. studentRecordChangeHistory.ModifyUserID = userID;
  814. studentRecordChangeHistory.ModifyTime = DateTime.Now;
  815. studentRecordChangeHistoryInList.Add(studentRecordChangeHistory);
  816. }
  817. else
  818. {
  819. throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。");
  820. }
  821. }
  822. else
  823. {
  824. throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。");
  825. }
  826. }
  827. else
  828. {
  829. throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。");
  830. }
  831. }
  832. }
  833. var studentContactProperty = typeof(CF_StudentContact).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  834. if (studentContactProperty != null)
  835. {
  836. if (!(studentContactProperty.GetValue(student.CF_StudentContact, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? "")))
  837. {
  838. if (approveColumnName.Key == null)
  839. {
  840. var studentContactContrastProperty = typeof(CF_StudentContactContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  841. if (studentContactContrastProperty != null)
  842. {
  843. studentContactContrastProperty.SetValue(studentContactContrast, studentViewDataList[keyValuePair.Key], null);
  844. studentContactContrast.ModifyUserID = userID;
  845. studentContactContrast.ModifyTime = DateTime.Now;
  846. studentContactProperty.SetValue(student.CF_StudentContact, studentViewDataList[keyValuePair.Key], null);
  847. isStuContactCheck = true;
  848. var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault();
  849. if (checkingColumnDescription != null)
  850. {
  851. var studentRecordChangeHistory = new CF_StudentRecordChangeHistory();
  852. studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid();
  853. studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID;
  854. studentRecordChangeHistory.TableName = checkingColumnDescription.TableName;
  855. studentRecordChangeHistory.ColumnName = keyValuePair.Key;
  856. studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key;
  857. studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE;
  858. studentRecordChangeHistory.CreateUserID = userID;
  859. studentRecordChangeHistory.CreateTime = DateTime.Now;
  860. studentRecordChangeHistory.ModifyUserID = userID;
  861. studentRecordChangeHistory.ModifyTime = DateTime.Now;
  862. studentRecordChangeHistoryInList.Add(studentRecordChangeHistory);
  863. }
  864. else
  865. {
  866. throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。");
  867. }
  868. }
  869. else
  870. {
  871. throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。");
  872. }
  873. }
  874. else
  875. {
  876. throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。");
  877. }
  878. }
  879. }
  880. var studentAccountProperty = typeof(CF_StudentAccount).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  881. if (studentAccountProperty != null)
  882. {
  883. if (!(studentAccountProperty.GetValue(student.CF_StudentAccount, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? "")))
  884. {
  885. if (approveColumnName.Key == null)
  886. {
  887. var studentAccountContrastProperty = typeof(CF_StudentAccountContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  888. if (studentAccountContrastProperty != null)
  889. {
  890. studentAccountContrastProperty.SetValue(studentAccountContrast, studentViewDataList[keyValuePair.Key], null);
  891. studentAccountContrast.ModifyUserID = userID;
  892. studentAccountContrast.ModifyTime = DateTime.Now;
  893. studentAccountProperty.SetValue(student.CF_StudentAccount, studentViewDataList[keyValuePair.Key], null);
  894. isStuAccountCheck = true;
  895. var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault();
  896. if (checkingColumnDescription != null)
  897. {
  898. var studentRecordChangeHistory = new CF_StudentRecordChangeHistory();
  899. studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid();
  900. studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID;
  901. studentRecordChangeHistory.TableName = checkingColumnDescription.TableName;
  902. studentRecordChangeHistory.ColumnName = keyValuePair.Key;
  903. studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key;
  904. studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE;
  905. studentRecordChangeHistory.CreateUserID = userID;
  906. studentRecordChangeHistory.CreateTime = DateTime.Now;
  907. studentRecordChangeHistory.ModifyUserID = userID;
  908. studentRecordChangeHistory.ModifyTime = DateTime.Now;
  909. studentRecordChangeHistoryInList.Add(studentRecordChangeHistory);
  910. }
  911. else
  912. {
  913. throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。");
  914. }
  915. }
  916. else
  917. {
  918. throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。");
  919. }
  920. }
  921. else
  922. {
  923. throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。");
  924. }
  925. }
  926. }
  927. var recruitstudentsProperty = typeof(CF_Recruitstudents).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  928. if (recruitstudentsProperty != null)
  929. {
  930. if (!(recruitstudentsProperty.GetValue(student.CF_Recruitstudents, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? "")))
  931. {
  932. if (approveColumnName.Key == null)
  933. {
  934. var recruitstudentsContrastProperty = typeof(CF_RecruitstudentsContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  935. if (recruitstudentsContrastProperty != null)
  936. {
  937. recruitstudentsContrastProperty.SetValue(recruitstudentsContrast, studentViewDataList[keyValuePair.Key], null);
  938. recruitstudentsContrast.ModifyUserID = userID;
  939. recruitstudentsContrast.ModifyTime = DateTime.Now;
  940. recruitstudentsProperty.SetValue(student.CF_Recruitstudents, studentViewDataList[keyValuePair.Key], null);
  941. isStuRecruitCheck = true;
  942. var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault();
  943. if (checkingColumnDescription != null)
  944. {
  945. var studentRecordChangeHistory = new CF_StudentRecordChangeHistory();
  946. studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid();
  947. studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID;
  948. studentRecordChangeHistory.TableName = checkingColumnDescription.TableName;
  949. studentRecordChangeHistory.ColumnName = keyValuePair.Key;
  950. studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key;
  951. studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE;
  952. studentRecordChangeHistory.CreateUserID = userID;
  953. studentRecordChangeHistory.CreateTime = DateTime.Now;
  954. studentRecordChangeHistory.ModifyUserID = userID;
  955. studentRecordChangeHistory.ModifyTime = DateTime.Now;
  956. studentRecordChangeHistoryInList.Add(studentRecordChangeHistory);
  957. }
  958. else
  959. {
  960. throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。");
  961. }
  962. }
  963. else
  964. {
  965. throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。");
  966. }
  967. }
  968. else
  969. {
  970. throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。");
  971. }
  972. }
  973. }
  974. #endregion
  975. }
  976. if (isUserCheck || isStudentCheck || isStuProfileCheck || isStuContactCheck || isStuAccountCheck || isStuRecruitCheck)
  977. {
  978. #region
  979. studentContrastInList.Add(studentContrast);
  980. studentSourceInList.Add(studentSource);
  981. userContrastInList.Add(userContrast);
  982. userSourceInList.Add(userSource);
  983. studentProfileContrastInList.Add(studentProfileContrast);
  984. studentProfileSourceInList.Add(studentProfileSource);
  985. studentContactContrastInList.Add(studentContactContrast);
  986. studentContactSourceInList.Add(studentContactSource);
  987. studentAccountContrastInList.Add(studentAccountContrast);
  988. studentAccountSourceInList.Add(studentAccountSource);
  989. recruitstudentsContrastInList.Add(recruitstudentsContrast);
  990. recruitstudentsSourceInList.Add(recruitstudentsSource);
  991. needEditIDList.Add(studentContrast.StudentContrastID);
  992. if (isUserCheck)
  993. {
  994. student.Sys_User.ModifyUserID = userID;
  995. student.Sys_User.ModifyTime = DateTime.Now;
  996. userUpList.Add(student.Sys_User);
  997. }
  998. if (isStudentCheck)
  999. {
  1000. student.ModifyUserID = userID;
  1001. student.ModifyTime = DateTime.Now;
  1002. studentUpList.Add(student);
  1003. }
  1004. if (isStuProfileCheck)
  1005. {
  1006. student.CF_StudentProfile.ModifyUserID = userID;
  1007. student.CF_StudentProfile.ModifyTime = DateTime.Now;
  1008. studentProfileUpList.Add(student.CF_StudentProfile);
  1009. }
  1010. if (isStuContactCheck)
  1011. {
  1012. student.CF_StudentContact.ModifyUserID = userID;
  1013. student.CF_StudentContact.ModifyTime = DateTime.Now;
  1014. studentContactUpList.Add(student.CF_StudentContact);
  1015. }
  1016. if (isStuAccountCheck)
  1017. {
  1018. student.CF_StudentAccount.ModifyUserID = userID;
  1019. student.CF_StudentAccount.ModifyTime = DateTime.Now;
  1020. studentAccountUpList.Add(student.CF_StudentAccount);
  1021. }
  1022. if (isStuRecruitCheck)
  1023. {
  1024. student.CF_Recruitstudents.ModifyUserID = userID;
  1025. student.CF_Recruitstudents.ModifyTime = DateTime.Now;
  1026. recruitstudentsUpList.Add(student.CF_Recruitstudents);
  1027. }
  1028. #endregion
  1029. }
  1030. }
  1031. else
  1032. {
  1033. foreach (var checkingControl in checkingControlGroupBy.Value)
  1034. {
  1035. #region
  1036. var keyValuePair = studentViewDataList.Where(x => x.Key == checkingControl.ColumnName).SingleOrDefault();
  1037. var approveColumnName = approveColumnNameList.Where(x => x.Key.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  1038. var userProperty = typeof(Sys_User).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  1039. if (userProperty != null)
  1040. {
  1041. if (!(userProperty.GetValue(student.Sys_User, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? "")))
  1042. {
  1043. if (approveColumnName.Key == null)
  1044. {
  1045. var userContrastProperty = typeof(Sys_UserContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  1046. if (userContrastProperty != null)
  1047. {
  1048. userContrastProperty.SetValue(userContrast, studentViewDataList[keyValuePair.Key], null);
  1049. userContrast.ModifyUserID = userID;
  1050. userContrast.ModifyTime = DateTime.Now;
  1051. isUserCheck = true;
  1052. var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault();
  1053. if (checkingColumnDescription != null)
  1054. {
  1055. var studentRecordChangeHistory = new CF_StudentRecordChangeHistory();
  1056. studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid();
  1057. studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID;
  1058. studentRecordChangeHistory.TableName = checkingColumnDescription.TableName;
  1059. studentRecordChangeHistory.ColumnName = keyValuePair.Key;
  1060. studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key;
  1061. studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE;
  1062. studentRecordChangeHistory.CreateUserID = userID;
  1063. studentRecordChangeHistory.CreateTime = DateTime.Now;
  1064. studentRecordChangeHistory.ModifyUserID = userID;
  1065. studentRecordChangeHistory.ModifyTime = DateTime.Now;
  1066. studentRecordChangeHistoryInList.Add(studentRecordChangeHistory);
  1067. }
  1068. else
  1069. {
  1070. throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。");
  1071. }
  1072. }
  1073. else
  1074. {
  1075. throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。");
  1076. }
  1077. }
  1078. else
  1079. {
  1080. throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。");
  1081. }
  1082. }
  1083. }
  1084. var studentProperty = typeof(CF_Student).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  1085. if (studentProperty != null)
  1086. {
  1087. if (!(studentProperty.GetValue(student, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? "")))
  1088. {
  1089. if (approveColumnName.Key == null)
  1090. {
  1091. var studentContrastProperty = typeof(CF_StudentContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  1092. if (studentContrastProperty != null)
  1093. {
  1094. studentContrastProperty.SetValue(studentContrast, studentViewDataList[keyValuePair.Key], null);
  1095. studentContrast.ModifyUserID = userID;
  1096. studentContrast.ModifyTime = DateTime.Now;
  1097. isStudentCheck = true;
  1098. var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault();
  1099. if (checkingColumnDescription != null)
  1100. {
  1101. var studentRecordChangeHistory = new CF_StudentRecordChangeHistory();
  1102. studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid();
  1103. studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID;
  1104. studentRecordChangeHistory.TableName = checkingColumnDescription.TableName;
  1105. studentRecordChangeHistory.ColumnName = keyValuePair.Key;
  1106. studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key;
  1107. studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE;
  1108. studentRecordChangeHistory.CreateUserID = userID;
  1109. studentRecordChangeHistory.CreateTime = DateTime.Now;
  1110. studentRecordChangeHistory.ModifyUserID = userID;
  1111. studentRecordChangeHistory.ModifyTime = DateTime.Now;
  1112. studentRecordChangeHistoryInList.Add(studentRecordChangeHistory);
  1113. }
  1114. else
  1115. {
  1116. throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。");
  1117. }
  1118. }
  1119. else
  1120. {
  1121. throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。");
  1122. }
  1123. }
  1124. else
  1125. {
  1126. throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。");
  1127. }
  1128. }
  1129. }
  1130. var studentProfileProperty = typeof(CF_StudentProfile).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  1131. if (studentProfileProperty != null)
  1132. {
  1133. if (!(studentProfileProperty.GetValue(student.CF_StudentProfile, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? "")))
  1134. {
  1135. if (approveColumnName.Key == null)
  1136. {
  1137. var studentProfileContrastProperty = typeof(CF_StudentProfileContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  1138. if (studentProfileContrastProperty != null)
  1139. {
  1140. studentProfileContrastProperty.SetValue(studentProfileContrast, studentViewDataList[keyValuePair.Key], null);
  1141. studentProfileContrast.ModifyUserID = userID;
  1142. studentProfileContrast.ModifyTime = DateTime.Now;
  1143. isStuProfileCheck = true;
  1144. var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault();
  1145. if (checkingColumnDescription != null)
  1146. {
  1147. var studentRecordChangeHistory = new CF_StudentRecordChangeHistory();
  1148. studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid();
  1149. studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID;
  1150. studentRecordChangeHistory.TableName = checkingColumnDescription.TableName;
  1151. studentRecordChangeHistory.ColumnName = keyValuePair.Key;
  1152. studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key;
  1153. studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE;
  1154. studentRecordChangeHistory.CreateUserID = userID;
  1155. studentRecordChangeHistory.CreateTime = DateTime.Now;
  1156. studentRecordChangeHistory.ModifyUserID = userID;
  1157. studentRecordChangeHistory.ModifyTime = DateTime.Now;
  1158. studentRecordChangeHistoryInList.Add(studentRecordChangeHistory);
  1159. }
  1160. else
  1161. {
  1162. throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。");
  1163. }
  1164. }
  1165. else
  1166. {
  1167. throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。");
  1168. }
  1169. }
  1170. else
  1171. {
  1172. throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。");
  1173. }
  1174. }
  1175. }
  1176. var studentContactProperty = typeof(CF_StudentContact).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  1177. if (studentContactProperty != null)
  1178. {
  1179. if (!(studentContactProperty.GetValue(student.CF_StudentContact, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? "")))
  1180. {
  1181. if (approveColumnName.Key == null)
  1182. {
  1183. var studentContactContrastProperty = typeof(CF_StudentContactContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  1184. if (studentContactContrastProperty != null)
  1185. {
  1186. studentContactContrastProperty.SetValue(studentContactContrast, studentViewDataList[keyValuePair.Key], null);
  1187. studentContactContrast.ModifyUserID = userID;
  1188. studentContactContrast.ModifyTime = DateTime.Now;
  1189. isStuContactCheck = true;
  1190. var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault();
  1191. if (checkingColumnDescription != null)
  1192. {
  1193. var studentRecordChangeHistory = new CF_StudentRecordChangeHistory();
  1194. studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid();
  1195. studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID;
  1196. studentRecordChangeHistory.TableName = checkingColumnDescription.TableName;
  1197. studentRecordChangeHistory.ColumnName = keyValuePair.Key;
  1198. studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key;
  1199. studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE;
  1200. studentRecordChangeHistory.CreateUserID = userID;
  1201. studentRecordChangeHistory.CreateTime = DateTime.Now;
  1202. studentRecordChangeHistory.ModifyUserID = userID;
  1203. studentRecordChangeHistory.ModifyTime = DateTime.Now;
  1204. studentRecordChangeHistoryInList.Add(studentRecordChangeHistory);
  1205. }
  1206. else
  1207. {
  1208. throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。");
  1209. }
  1210. }
  1211. else
  1212. {
  1213. throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。");
  1214. }
  1215. }
  1216. else
  1217. {
  1218. throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。");
  1219. }
  1220. }
  1221. }
  1222. var studentAccountProperty = typeof(CF_StudentAccount).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  1223. if (studentAccountProperty != null)
  1224. {
  1225. if (!(studentAccountProperty.GetValue(student.CF_StudentAccount, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? "")))
  1226. {
  1227. if (approveColumnName.Key == null)
  1228. {
  1229. var studentAccountContrastProperty = typeof(CF_StudentAccountContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  1230. if (studentAccountContrastProperty != null)
  1231. {
  1232. studentAccountContrastProperty.SetValue(studentAccountContrast, studentViewDataList[keyValuePair.Key], null);
  1233. studentAccountContrast.ModifyUserID = userID;
  1234. studentAccountContrast.ModifyTime = DateTime.Now;
  1235. isStuAccountCheck = true;
  1236. var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault();
  1237. if (checkingColumnDescription != null)
  1238. {
  1239. var studentRecordChangeHistory = new CF_StudentRecordChangeHistory();
  1240. studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid();
  1241. studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID;
  1242. studentRecordChangeHistory.TableName = checkingColumnDescription.TableName;
  1243. studentRecordChangeHistory.ColumnName = keyValuePair.Key;
  1244. studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key;
  1245. studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE;
  1246. studentRecordChangeHistory.CreateUserID = userID;
  1247. studentRecordChangeHistory.CreateTime = DateTime.Now;
  1248. studentRecordChangeHistory.ModifyUserID = userID;
  1249. studentRecordChangeHistory.ModifyTime = DateTime.Now;
  1250. studentRecordChangeHistoryInList.Add(studentRecordChangeHistory);
  1251. }
  1252. else
  1253. {
  1254. throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。");
  1255. }
  1256. }
  1257. else
  1258. {
  1259. throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。");
  1260. }
  1261. }
  1262. else
  1263. {
  1264. throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。");
  1265. }
  1266. }
  1267. }
  1268. var recruitstudentsProperty = typeof(CF_Recruitstudents).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  1269. if (recruitstudentsProperty != null)
  1270. {
  1271. if (!(recruitstudentsProperty.GetValue(student.CF_Recruitstudents, null) ?? "").Equals((studentViewDataList[keyValuePair.Key] ?? "")))
  1272. {
  1273. if (approveColumnName.Key == null)
  1274. {
  1275. var recruitstudentsContrastProperty = typeof(CF_RecruitstudentsContrast).GetProperties().Where(x => x.Name.ToLower() == keyValuePair.Key.ToLower()).SingleOrDefault();
  1276. if (recruitstudentsContrastProperty != null)
  1277. {
  1278. recruitstudentsContrastProperty.SetValue(recruitstudentsContrast, studentViewDataList[keyValuePair.Key], null);
  1279. recruitstudentsContrast.ModifyUserID = userID;
  1280. recruitstudentsContrast.ModifyTime = DateTime.Now;
  1281. isStuRecruitCheck = true;
  1282. var checkingColumnDescription = checkingColumnDescriptionList.Where(x => x.ColumnName == keyValuePair.Key).SingleOrDefault();
  1283. if (checkingColumnDescription != null)
  1284. {
  1285. var studentRecordChangeHistory = new CF_StudentRecordChangeHistory();
  1286. studentRecordChangeHistory.StudentRecordChangeHistoryID = Guid.NewGuid();
  1287. studentRecordChangeHistory.StudentContrastID = studentContrast.StudentContrastID;
  1288. studentRecordChangeHistory.TableName = checkingColumnDescription.TableName;
  1289. studentRecordChangeHistory.ColumnName = keyValuePair.Key;
  1290. studentRecordChangeHistory.CheckingTypeID = checkingControlGroupBy.Key;
  1291. studentRecordChangeHistory.RecordStatus = (int)SYS_STATUS.USABLE;
  1292. studentRecordChangeHistory.CreateUserID = userID;
  1293. studentRecordChangeHistory.CreateTime = DateTime.Now;
  1294. studentRecordChangeHistory.ModifyUserID = userID;
  1295. studentRecordChangeHistory.ModifyTime = DateTime.Now;
  1296. studentRecordChangeHistoryInList.Add(studentRecordChangeHistory);
  1297. }
  1298. else
  1299. {
  1300. throw new Exception("对应的校对字段说明未配置(字段:" + keyValuePair.Key + ")。");
  1301. }
  1302. }
  1303. else
  1304. {
  1305. throw new Exception("对应的比对信息表属性不存在(字段:" + keyValuePair.Key + ")。");
  1306. }
  1307. }
  1308. else
  1309. {
  1310. throw new Exception("存在待审核的请求信息,如需继续请前往校对结果页面选择撤消对应的信息(校对名称:" + approveColumnName.Value + ")。");
  1311. }
  1312. }
  1313. }
  1314. #endregion
  1315. }
  1316. if (isUserCheck || isStudentCheck || isStuProfileCheck || isStuContactCheck || isStuAccountCheck || isStuRecruitCheck)
  1317. {
  1318. #region
  1319. studentContrastInList.Add(studentContrast);
  1320. studentSourceInList.Add(studentSource);
  1321. userContrastInList.Add(userContrast);
  1322. userSourceInList.Add(userSource);
  1323. studentProfileContrastInList.Add(studentProfileContrast);
  1324. studentProfileSourceInList.Add(studentProfileSource);
  1325. studentContactContrastInList.Add(studentContactContrast);
  1326. studentContactSourceInList.Add(studentContactSource);
  1327. studentAccountContrastInList.Add(studentAccountContrast);
  1328. studentAccountSourceInList.Add(studentAccountSource);
  1329. recruitstudentsContrastInList.Add(recruitstudentsContrast);
  1330. recruitstudentsSourceInList.Add(recruitstudentsSource);
  1331. needSubmitIDList.Add(studentContrast.StudentContrastID);
  1332. #endregion
  1333. }
  1334. }
  1335. }
  1336. if (studentContrastInList != null && studentContrastInList.Count() > 0)
  1337. {
  1338. TransactionOptions transactionOption = new TransactionOptions();
  1339. transactionOption.IsolationLevel = System.Transactions.IsolationLevel.Serializable;
  1340. transactionOption.Timeout = new TimeSpan(0, 3, 0);
  1341. using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required, transactionOption))
  1342. {
  1343. UnitOfWork.BulkInsert<CF_StudentContrast>(studentContrastInList);
  1344. UnitOfWork.BulkInsert<CF_StudentSource>(studentSourceInList);
  1345. UnitOfWork.BulkInsert<Sys_UserContrast>(userContrastInList);
  1346. UnitOfWork.BulkInsert<Sys_UserSource>(userSourceInList);
  1347. UnitOfWork.BulkInsert<CF_StudentProfileContrast>(studentProfileContrastInList);
  1348. UnitOfWork.BulkInsert<CF_StudentProfileSource>(studentProfileSourceInList);
  1349. UnitOfWork.BulkInsert<CF_StudentContactContrast>(studentContactContrastInList);
  1350. UnitOfWork.BulkInsert<CF_StudentContactSource>(studentContactSourceInList);
  1351. UnitOfWork.BulkInsert<CF_StudentAccountContrast>(studentAccountContrastInList);
  1352. UnitOfWork.BulkInsert<CF_StudentAccountSource>(studentAccountSourceInList);
  1353. UnitOfWork.BulkInsert<CF_RecruitstudentsContrast>(recruitstudentsContrastInList);
  1354. UnitOfWork.BulkInsert<CF_RecruitstudentsSource>(recruitstudentsSourceInList);
  1355. UnitOfWork.BulkInsert<CF_StudentRecordChangeHistory>(studentRecordChangeHistoryInList);
  1356. if (needEditIDList.Count > 0)
  1357. {
  1358. var startActionEditID = startActionViewList.Where(x => (x.Description ?? "").Contains("[ET]")).Select(x => x.ActionID).SingleOrDefault();
  1359. if (startActionEditID == null)
  1360. {
  1361. throw new Exception("对应的流程动作未配置(修改)。");
  1362. }
  1363. else
  1364. {
  1365. foreach (var needEditID in needEditIDList)
  1366. {
  1367. this.StartUp(needEditID, userID.Value, startActionEditID, null);
  1368. }
  1369. }
  1370. }
  1371. if (needSubmitIDList.Count > 0)
  1372. {
  1373. var startActionSubmitID = startActionViewList.Where(x => (x.Description ?? "").Contains("[ST]")).Select(x => x.ActionID).SingleOrDefault();
  1374. if (startActionSubmitID == null)
  1375. {
  1376. throw new Exception("对应的流程动作未配置(提交)。");
  1377. }
  1378. else
  1379. {
  1380. foreach (var needSubmitID in needSubmitIDList)
  1381. {
  1382. this.StartUp(needSubmitID, userID.Value, startActionSubmitID, null);
  1383. }
  1384. }
  1385. }
  1386. if (userUpList != null && userUpList.Count() > 0)
  1387. {
  1388. UnitOfWork.BatchUpdate(userUpList);
  1389. }
  1390. if (studentUpList != null && studentUpList.Count() > 0)
  1391. {
  1392. UnitOfWork.BatchUpdate(studentUpList);
  1393. }
  1394. if (studentProfileUpList != null && studentProfileUpList.Count() > 0)
  1395. {
  1396. UnitOfWork.BatchUpdate(studentProfileUpList);
  1397. }
  1398. if (studentContactUpList != null && studentContactUpList.Count() > 0)
  1399. {
  1400. UnitOfWork.BatchUpdate(studentContactUpList);
  1401. }
  1402. if (studentAccountUpList != null && studentAccountUpList.Count() > 0)
  1403. {
  1404. UnitOfWork.BatchUpdate(studentAccountUpList);
  1405. }
  1406. if (recruitstudentsUpList != null && recruitstudentsUpList.Count() > 0)
  1407. {
  1408. UnitOfWork.BatchUpdate(recruitstudentsUpList);
  1409. }
  1410. ts.Complete();
  1411. }
  1412. }
  1413. else
  1414. {
  1415. throw new Exception("未对任何信息进行校对。");
  1416. }
  1417. }
  1418. else
  1419. {
  1420. throw new Exception("对应的校对字段说明未配置(为空)。");
  1421. }
  1422. }
  1423. else
  1424. {
  1425. throw new Exception("对应的可校对控制信息为空(不可修改)。");
  1426. }
  1427. }
  1428. catch (Exception ex)
  1429. {
  1430. throw new Exception(ex.Message);
  1431. }
  1432. }
  1433. /// <summary>
  1434. /// 学生个人信息核对
  1435. /// </summary>
  1436. /// <param name="userID"></param>
  1437. public void StudentProofread(Guid? userID)
  1438. {
  1439. try
  1440. {
  1441. var student = StudentDAL.StudentRepository.GetList(x => x.UserID == userID).SingleOrDefault();
  1442. if (student != null)
  1443. {
  1444. student.IsProofread = true;
  1445. student.ModifyUserID = userID;
  1446. student.ModifyTime = DateTime.Now;
  1447. UnitOfWork.Commit();
  1448. }
  1449. else
  1450. {
  1451. throw new Exception("数据有误,请重新刷新加载。");
  1452. }
  1453. }
  1454. catch (Exception ex)
  1455. {
  1456. throw new Exception(ex.Message);
  1457. }
  1458. }
  1459. }
  1460. }