StudentEvaluationEnterServices.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Linq.Expressions;
  6. using System.Transactions;
  7. using Bowin.Common.Linq;
  8. using Bowin.Common.Data;
  9. using Bowin.Common.JSON;
  10. using Bowin.Common.Linq.Entity;
  11. using EMIS.Entities;
  12. using EMIS.ViewModel;
  13. using EMIS.ViewModel.EvaluationManage.StudentEvaluation;
  14. using EMIS.DataLogic.EvaluationManage.StudentEvaluation;
  15. using EMIS.CommonLogic.EvaluationManage.EvaluationSetting;
  16. using EMIS.CommonLogic.EvaluationManage.EvaluationManage;
  17. using EMIS.CommonLogic.SystemServices;
  18. namespace EMIS.CommonLogic.StudentWeb.Evaluation
  19. {
  20. public class StudentEvaluationEnterServices : BaseServices, IStudentEvaluationEnterServices
  21. {
  22. public EvaluationStudentDAL EvaluationStudentDAL { get; set; }
  23. public Lazy<IEvaluationControlServices> EvaluationControlServices { get; set; }
  24. public Lazy<IEvaluationStudentScoreServices> EvaluationStudentScoreServices { get; set; }
  25. public Lazy<IParameterServices> ParameterServices { get; set; }
  26. /// <summary>
  27. /// 查询对应的学生评价信息View
  28. /// </summary>
  29. /// <param name="configuretView"></param>
  30. /// <param name="userID"></param>
  31. /// <param name="pageIndex"></param>
  32. /// <param name="pageSize"></param>
  33. /// <returns></returns>
  34. public IGridResultSet<EvaluationStudentView> GetStudentEvaluationEnterViewGrid(ConfiguretView configuretView, Guid? userID, int pageIndex, int pageSize)
  35. {
  36. Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  37. expStudent = expStudent.And(x => x.UserID == userID);
  38. Expression<Func<EM_EvaluationStudentSetting, bool>> expEvaluationStudentSetting = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  39. expEvaluationStudentSetting = expEvaluationStudentSetting.And(x => x.OpenState == true);
  40. var query = EvaluationStudentDAL.GetStudentEvaluationEnterViewQueryable(expStudent, expEvaluationStudentSetting);
  41. var evaluationControlView = EvaluationControlServices.Value.GetEvaluationControlView();
  42. if (evaluationControlView == null)
  43. {
  44. query = query.Where(x => false);
  45. }
  46. else
  47. {
  48. query = query.Where(x => x.SchoolyearValue <= evaluationControlView.SchoolyearValue);
  49. query = query.Where(x => x.StartTime <= DateTime.Now);
  50. query = query.Where(x => x.EndTime >= DateTime.Now);
  51. query = query.Where(x => x.Number > x.Numbered);
  52. }
  53. //查询条件
  54. if (!string.IsNullOrEmpty(configuretView.ConditionValue))
  55. {
  56. query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
  57. }
  58. return query.OrderBy(x => x.SchoolyearValue).ThenBy(x => x.CourseCode.Length).ThenBy(x => x.CourseCode).ThenBy(x => x.CourseTypeID).ThenBy(x => x.Numbered).ToGridResultSet<EvaluationStudentView>(pageIndex, pageSize);
  59. }
  60. /// <summary>
  61. /// 查询对应的学生评价信息List
  62. /// </summary>
  63. /// <param name="configuretView"></param>
  64. /// <param name="userID"></param>
  65. /// <returns></returns>
  66. public IList<EvaluationStudentView> GetStudentEvaluationEnterViewList(ConfiguretView configuretView, Guid? userID)
  67. {
  68. Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  69. expStudent = expStudent.And(x => x.UserID == userID);
  70. Expression<Func<EM_EvaluationStudentSetting, bool>> expEvaluationStudentSetting = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  71. expEvaluationStudentSetting = expEvaluationStudentSetting.And(x => x.OpenState == true);
  72. var query = EvaluationStudentDAL.GetStudentEvaluationEnterViewQueryable(expStudent, expEvaluationStudentSetting);
  73. var evaluationControlView = EvaluationControlServices.Value.GetEvaluationControlView();
  74. if (evaluationControlView == null)
  75. {
  76. query = query.Where(x => false);
  77. }
  78. else
  79. {
  80. query = query.Where(x => x.SchoolyearValue <= evaluationControlView.SchoolyearValue);
  81. query = query.Where(x => x.StartTime <= DateTime.Now);
  82. query = query.Where(x => x.EndTime >= DateTime.Now);
  83. query = query.Where(x => x.Number > x.Numbered);
  84. }
  85. //查询条件
  86. if (!string.IsNullOrEmpty(configuretView.ConditionValue))
  87. {
  88. query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
  89. }
  90. return query.OrderBy(x => x.SchoolyearValue).ThenBy(x => x.CourseCode.Length).ThenBy(x => x.CourseCode).ThenBy(x => x.CourseTypeID).ThenBy(x => x.Numbered).ToList();
  91. }
  92. /// <summary>
  93. /// 查询对应的学生未评价信息List
  94. /// </summary>
  95. /// <param name="userID"></param>
  96. /// <returns></returns>
  97. public IList<EvaluationStudentView> GetStudentNoEvaluationViewList(Guid? userID)
  98. {
  99. Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  100. expStudent = expStudent.And(x => x.UserID == userID);
  101. Expression<Func<EM_EvaluationStudentSetting, bool>> expEvaluationStudentSetting = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  102. expEvaluationStudentSetting = expEvaluationStudentSetting.And(x => x.OpenState == true);
  103. var query = EvaluationStudentDAL.GetStudentEvaluationEnterViewQueryable(expStudent, expEvaluationStudentSetting);
  104. var evaluationControlView = EvaluationControlServices.Value.GetEvaluationControlView();
  105. if (evaluationControlView == null)
  106. {
  107. query = query.Where(x => false);
  108. }
  109. else
  110. {
  111. query = query.Where(x => x.SchoolyearValue <= evaluationControlView.SchoolyearValue);
  112. query = query.Where(x => x.StartTime <= DateTime.Now);
  113. query = query.Where(x => x.EndTime >= DateTime.Now);
  114. query = query.Where(x => x.Numbered == 0);
  115. query = query.Where(x => x.Number > 0);
  116. }
  117. return query.OrderBy(x => x.SchoolyearValue).ThenBy(x => x.CourseCode.Length).ThenBy(x => x.CourseCode).ThenBy(x => x.CourseTypeID).ThenBy(x => x.Numbered).ToList();
  118. }
  119. /// <summary>
  120. /// 查询对应的学生评价信息EvaluationStudentView
  121. /// </summary>
  122. /// <param name="userID"></param>
  123. /// <param name="evaluationStudentSettingID"></param>
  124. /// <returns></returns>
  125. public EvaluationStudentView GetStudentEvaluationEnterView(Guid? userID, Guid? evaluationStudentSettingID)
  126. {
  127. try
  128. {
  129. Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  130. expStudent = expStudent.And(x => x.UserID == userID);
  131. Expression<Func<EM_EvaluationStudentSetting, bool>> expEvaluationStudentSetting = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  132. expEvaluationStudentSetting = expEvaluationStudentSetting.And(x => x.OpenState == true);
  133. expEvaluationStudentSetting = expEvaluationStudentSetting.And(x => x.EvaluationStudentSettingID == evaluationStudentSettingID);
  134. var query = EvaluationStudentDAL.GetStudentEvaluationEnterViewQueryable(expStudent, expEvaluationStudentSetting).SingleOrDefault();
  135. return query;
  136. }
  137. catch (Exception ex)
  138. {
  139. throw new Exception(ex.Message);
  140. }
  141. }
  142. /// <summary>
  143. /// 编辑
  144. /// </summary>
  145. /// <param name="evaluationStudentView"></param>
  146. public void StudentEvaluationEnterEdit(EvaluationStudentView evaluationStudentView)
  147. {
  148. try
  149. {
  150. var evaluationControlView = EvaluationControlServices.Value.GetEvaluationControlView();
  151. if (evaluationControlView == null)
  152. {
  153. throw new Exception("当前教学质量评价活动对应的评价学年学期已结束。");
  154. }
  155. else
  156. {
  157. if (evaluationStudentView.SchoolyearValue > evaluationControlView.SchoolyearValue)
  158. {
  159. throw new Exception("当前教学质量评价活动对应的评价学年学期已结束。");
  160. }
  161. }
  162. var evaluationParticipateType = EvaluationStudentDAL.EvaluationParticipateTypeRepository.GetList(x => x.ParticipateTypeID == (int)EM_ParticipateType.Student).SingleOrDefault();
  163. if (evaluationParticipateType == null)
  164. {
  165. throw new Exception("当前教学质量评价活动对应的评价时间已结束。");
  166. }
  167. else
  168. {
  169. if (evaluationParticipateType.StartTime == null || evaluationParticipateType.EndTime == null)
  170. {
  171. throw new Exception("当前教学质量评价活动对应的评价时间未开始。");
  172. }
  173. if (DateTime.Now < evaluationParticipateType.StartTime)
  174. {
  175. throw new Exception("当前教学质量评价活动对应的评价时间未开始。");
  176. }
  177. if (DateTime.Now > evaluationParticipateType.EndTime)
  178. {
  179. throw new Exception("当前教学质量评价活动对应的评价时间已结束。");
  180. }
  181. }
  182. if (((evaluationStudentView.Numbered ?? 0) + 1) > (evaluationParticipateType.Number ?? 0))
  183. {
  184. throw new Exception("当前教学质量评价活动对应的已评次数已评完。");
  185. }
  186. if (!evaluationStudentView.EvaluationStudentSettingID.HasValue || evaluationStudentView.EvaluationStudentSettingID == Guid.Empty)
  187. {
  188. throw new Exception("评价超时,请刷新页面再次尝试。");
  189. }
  190. Expression<Func<EM_EvaluationStudentSetting, bool>> expEvaluationStudentSetting = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  191. expEvaluationStudentSetting = expEvaluationStudentSetting.And(x => x.OpenState == true);
  192. expEvaluationStudentSetting = expEvaluationStudentSetting.And(x => x.EvaluationStudentSettingID == evaluationStudentView.EvaluationStudentSettingID);
  193. var evaluationStudentSetting = EvaluationStudentDAL.EvaluationStudentSettingRepository.GetList(expEvaluationStudentSetting, (x => x.CF_Student)).SingleOrDefault();
  194. if (evaluationStudentSetting == null)
  195. {
  196. throw new Exception("当前教学质量评价活动已关闭,请刷新页面再次尝试。");
  197. }
  198. else
  199. {
  200. var evaluationStudentSettingStudent = evaluationStudentSetting.CF_Student.Where(x => x.UserID == evaluationStudentView.UserID).SingleOrDefault();
  201. if (evaluationStudentSettingStudent == null)
  202. {
  203. throw new Exception("当前教学质量评价活动已关闭,请刷新页面再次尝试。");
  204. }
  205. }
  206. Expression<Func<EM_EvaluationStudent, bool>> expEvaluationStudent = (x => x.EvaluationStudentID != evaluationStudentView.EvaluationStudentID);
  207. expEvaluationStudent = expEvaluationStudent.And(x => x.UserID == evaluationStudentView.UserID);
  208. expEvaluationStudent = expEvaluationStudent.And(x => x.EvaluationStudentSettingID == evaluationStudentView.EvaluationStudentSettingID);
  209. var evaluationStudentVerify = EvaluationStudentDAL.EvaluationStudentRepository.GetList(expEvaluationStudent).SingleOrDefault();
  210. if (evaluationStudentVerify == null)
  211. {
  212. Expression<Func<EM_EvaluationStudentScore, bool>> expEvaluationStudentScore = (x => x.SchoolyearID == evaluationStudentView.SchoolyearID);
  213. expEvaluationStudentScore = expEvaluationStudentScore.And(x => x.UserID == evaluationStudentView.UserID);
  214. expEvaluationStudentScore = expEvaluationStudentScore.And(x => x.CoursematerialID == evaluationStudentView.CoursematerialID);
  215. expEvaluationStudentScore = expEvaluationStudentScore.And(x => x.DepartmentID == evaluationStudentView.DepartmentID);
  216. var evaluationStudentScore = EvaluationStudentDAL.EvaluationStudentScoreRepository.GetList(expEvaluationStudentScore).SingleOrDefault();
  217. var isEvaluationControlForSchoolyear = ParameterServices.Value.GetParameterValue<bool>(CF_ParameterType.IsEvaluationControlForSchoolyear);
  218. if (evaluationStudentScore == null)
  219. {
  220. if (evaluationStudentView.SchoolyearValue < evaluationControlView.SchoolyearValue)
  221. {
  222. evaluationStudentView.IsValidity = isEvaluationControlForSchoolyear ?? false;
  223. }
  224. else
  225. {
  226. evaluationStudentView.IsValidity = true;
  227. }
  228. }
  229. else
  230. {
  231. var startStatusID = EvaluationStudentScoreServices.Value.GetStartStatus();
  232. if (startStatusID == null)
  233. {
  234. throw new Exception("评价数据有误,请联系辅导员或教学评价负责老师。");
  235. }
  236. if (evaluationStudentScore.ApprovalStatus == startStatusID)
  237. {
  238. if (evaluationStudentView.SchoolyearValue < evaluationControlView.SchoolyearValue)
  239. {
  240. evaluationStudentView.IsValidity = isEvaluationControlForSchoolyear ?? false;
  241. }
  242. else
  243. {
  244. evaluationStudentView.IsValidity = true;
  245. }
  246. }
  247. else
  248. {
  249. evaluationStudentView.IsValidity = false;
  250. }
  251. }
  252. var evaluationProjectJsonDataList = evaluationStudentView.JsonDataStr.ToString().JsonToObject<List<EvaluationStudentDetailView>>();
  253. if (evaluationProjectJsonDataList == null || evaluationProjectJsonDataList.Count() < 0)
  254. {
  255. throw new Exception("当前教学质量评价活动,评价项目中对应的评分标准未评分,请进行评分。");
  256. }
  257. var evaluationStudentInList = new List<EM_EvaluationStudent>();
  258. var evaluationStudentUpList = new List<EM_EvaluationStudent>();
  259. var evaluationStudentDetailInList = new List<EM_EvaluationStudentDetail>();
  260. var evaluationStudentIDDelList = new List<Guid?>();
  261. if (evaluationStudentView.EvaluationStudentID != Guid.Empty)
  262. {
  263. var evaluationStudent = EvaluationStudentDAL.EvaluationStudentRepository.GetList(x => x.EvaluationStudentID == evaluationStudentView.EvaluationStudentID).SingleOrDefault();
  264. if (evaluationStudent == null)
  265. {
  266. throw new Exception("评价超时,请刷新页面再次尝试。");
  267. }
  268. else
  269. {
  270. //表示修改
  271. if (evaluationStudentView.IsValidity)
  272. {
  273. evaluationStudent.Numbered = (evaluationStudentView.Numbered ?? 0) + 1;
  274. evaluationStudent.IsValidity = evaluationStudentView.IsValidity;
  275. evaluationStudent.TotalScore = evaluationStudentView.TotalScore;
  276. evaluationStudent.Advice = evaluationStudentView.Advice;
  277. SetModifyStatus(evaluationStudent);
  278. evaluationStudentUpList.Add(evaluationStudent);
  279. evaluationStudentIDDelList.Add(evaluationStudent.EvaluationStudentID);
  280. foreach (var evaluationProjectJsonData in evaluationProjectJsonDataList)
  281. {
  282. var newEvaluationStudentDetail = new EM_EvaluationStudentDetail();
  283. newEvaluationStudentDetail.EvaluationStudentDetailID = Guid.NewGuid();
  284. newEvaluationStudentDetail.EvaluationStudentID = evaluationStudent.EvaluationStudentID;
  285. newEvaluationStudentDetail.EvaluationProjectID = evaluationProjectJsonData.EvaluationProjectID;
  286. newEvaluationStudentDetail.Score = evaluationProjectJsonData.Score;
  287. newEvaluationStudentDetail.Remark = null;
  288. SetNewStatus(newEvaluationStudentDetail);
  289. evaluationStudentDetailInList.Add(newEvaluationStudentDetail);
  290. }
  291. }
  292. else
  293. {
  294. throw new Exception("当前教学质量评价活动已结束。");
  295. }
  296. }
  297. }
  298. else
  299. {
  300. //表示新增
  301. var newEvaluationStudent = new EM_EvaluationStudent();
  302. newEvaluationStudent.EvaluationStudentID = Guid.NewGuid();
  303. newEvaluationStudent.UserID = evaluationStudentView.UserID;
  304. newEvaluationStudent.EvaluationStudentSettingID = evaluationStudentView.EvaluationStudentSettingID;
  305. newEvaluationStudent.Numbered = (evaluationStudentView.Numbered ?? 0) + 1;
  306. newEvaluationStudent.IsValidity = evaluationStudentView.IsValidity;
  307. newEvaluationStudent.TotalScore = evaluationStudentView.TotalScore;
  308. newEvaluationStudent.Advice = evaluationStudentView.Advice;
  309. newEvaluationStudent.Remark = evaluationStudentView.Remark;
  310. SetNewStatus(newEvaluationStudent);
  311. evaluationStudentInList.Add(newEvaluationStudent);
  312. foreach (var evaluationProjectJsonData in evaluationProjectJsonDataList)
  313. {
  314. var newEvaluationStudentDetail = new EM_EvaluationStudentDetail();
  315. newEvaluationStudentDetail.EvaluationStudentDetailID = Guid.NewGuid();
  316. newEvaluationStudentDetail.EvaluationStudentID = newEvaluationStudent.EvaluationStudentID;
  317. newEvaluationStudentDetail.EvaluationProjectID = evaluationProjectJsonData.EvaluationProjectID;
  318. newEvaluationStudentDetail.Score = evaluationProjectJsonData.Score;
  319. newEvaluationStudentDetail.Remark = null;
  320. SetNewStatus(newEvaluationStudentDetail);
  321. evaluationStudentDetailInList.Add(newEvaluationStudentDetail);
  322. }
  323. }
  324. using (TransactionScope ts = new TransactionScope(TransactionScopeOption.RequiresNew, new TransactionOptions { IsolationLevel = IsolationLevel.Serializable }))
  325. {
  326. UnitOfWork.Delete<EM_EvaluationStudentDetail>(x => evaluationStudentIDDelList.Contains(x.EvaluationStudentID));
  327. UnitOfWork.BulkInsert(evaluationStudentInList);
  328. UnitOfWork.BulkInsert(evaluationStudentDetailInList);
  329. if (evaluationStudentUpList != null && evaluationStudentUpList.Count() > 0)
  330. {
  331. UnitOfWork.BatchUpdate(evaluationStudentUpList);
  332. }
  333. ts.Complete();
  334. }
  335. }
  336. else
  337. {
  338. throw new Exception("同学,您当前参与的教学质量评价活动,评价信息已存在,如需再次评价,请刷新页面再次尝试,感谢您的参与。");
  339. }
  340. }
  341. catch (Exception ex)
  342. {
  343. throw new Exception(ex.Message);
  344. }
  345. }
  346. /// <summary>
  347. /// 查询对应的学评学生明细信息List
  348. /// </summary>
  349. /// <param name="evaluationStudentID"></param>
  350. /// <returns></returns>
  351. public IList<EM_EvaluationStudentDetail> GetEvaluationStudentDetailList(Guid? evaluationStudentID)
  352. {
  353. Expression<Func<EM_EvaluationStudentDetail, bool>> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
  354. exp = exp.And(x => x.EvaluationStudentID == evaluationStudentID);
  355. var query = EvaluationStudentDAL.EvaluationStudentDetailRepository.GetList(exp);
  356. return query.OrderBy(x => x.EvaluationStudentID).ThenBy(x => x.Score).ToList();
  357. }
  358. /// <summary>
  359. /// 教学评价登录控制
  360. /// </summary>
  361. /// <param name="userID"></param>
  362. /// <returns></returns>
  363. public bool LoginControl(Guid? userID)
  364. {
  365. var evaluationControlView = EvaluationControlServices.Value.GetEvaluationControlView();
  366. if (evaluationControlView == null)
  367. {
  368. return true;
  369. }
  370. else
  371. {
  372. if (evaluationControlView.IsLoginLock)
  373. {
  374. var evaluationStudentViewList = this.GetStudentNoEvaluationViewList(userID).ToList();
  375. if (evaluationStudentViewList == null || evaluationStudentViewList.Count() <= 0)
  376. {
  377. return true;
  378. }
  379. else
  380. {
  381. if (evaluationStudentViewList.Count() <= (evaluationControlView.NoNumber ?? 0))
  382. {
  383. return true;
  384. }
  385. else
  386. {
  387. return false;
  388. }
  389. }
  390. }
  391. else
  392. {
  393. return true;
  394. }
  395. }
  396. }
  397. /// <summary>
  398. /// 教学评价网上选课控制
  399. /// </summary>
  400. /// <param name="userID"></param>
  401. /// <returns></returns>
  402. public bool SelectCourseControl(Guid? userID)
  403. {
  404. var evaluationControlView = EvaluationControlServices.Value.GetEvaluationControlView();
  405. if (evaluationControlView == null)
  406. {
  407. return true;
  408. }
  409. else
  410. {
  411. if (evaluationControlView.IsSelectCourseLock)
  412. {
  413. var evaluationStudentViewList = this.GetStudentNoEvaluationViewList(userID).ToList();
  414. if (evaluationStudentViewList == null || evaluationStudentViewList.Count() <= 0)
  415. {
  416. return true;
  417. }
  418. else
  419. {
  420. if (evaluationStudentViewList.Count() <= (evaluationControlView.NoNumber ?? 0))
  421. {
  422. return true;
  423. }
  424. else
  425. {
  426. return false;
  427. }
  428. }
  429. }
  430. else
  431. {
  432. return true;
  433. }
  434. }
  435. }
  436. /// <summary>
  437. /// 教学评价考试报名控制
  438. /// </summary>
  439. /// <param name="userID"></param>
  440. /// <returns></returns>
  441. public bool ExaminationApplyControl(Guid? userID)
  442. {
  443. var evaluationControlView = EvaluationControlServices.Value.GetEvaluationControlView();
  444. if (evaluationControlView == null)
  445. {
  446. return true;
  447. }
  448. else
  449. {
  450. if (evaluationControlView.IsExaminationApplyLock)
  451. {
  452. var evaluationStudentViewList = this.GetStudentNoEvaluationViewList(userID).ToList();
  453. if (evaluationStudentViewList == null || evaluationStudentViewList.Count() <= 0)
  454. {
  455. return true;
  456. }
  457. else
  458. {
  459. if (evaluationStudentViewList.Count() <= (evaluationControlView.NoNumber ?? 0))
  460. {
  461. return true;
  462. }
  463. else
  464. {
  465. return false;
  466. }
  467. }
  468. }
  469. else
  470. {
  471. return true;
  472. }
  473. }
  474. }
  475. /// <summary>
  476. /// 教学评价课程成绩查询控制
  477. /// </summary>
  478. /// <param name="userID"></param>
  479. /// <returns></returns>
  480. public bool CourseScoreControl(Guid? userID)
  481. {
  482. var evaluationControlView = EvaluationControlServices.Value.GetEvaluationControlView();
  483. if (evaluationControlView == null)
  484. {
  485. return true;
  486. }
  487. else
  488. {
  489. if (evaluationControlView.IsCourseScoreLock)
  490. {
  491. var evaluationStudentViewList = this.GetStudentNoEvaluationViewList(userID).ToList();
  492. if (evaluationStudentViewList == null || evaluationStudentViewList.Count() <= 0)
  493. {
  494. return true;
  495. }
  496. else
  497. {
  498. if (evaluationStudentViewList.Count() <= (evaluationControlView.NoNumber ?? 0))
  499. {
  500. return true;
  501. }
  502. else
  503. {
  504. return false;
  505. }
  506. }
  507. }
  508. else
  509. {
  510. return true;
  511. }
  512. }
  513. }
  514. /// <summary>
  515. /// 教学评价等级成绩查询控制
  516. /// </summary>
  517. /// <param name="userID"></param>
  518. /// <returns></returns>
  519. public bool LevelScoreControl(Guid? userID)
  520. {
  521. var evaluationControlView = EvaluationControlServices.Value.GetEvaluationControlView();
  522. if (evaluationControlView == null)
  523. {
  524. return true;
  525. }
  526. else
  527. {
  528. if (evaluationControlView.IsLevelScoreLock)
  529. {
  530. var evaluationStudentViewList = this.GetStudentNoEvaluationViewList(userID).ToList();
  531. if (evaluationStudentViewList == null || evaluationStudentViewList.Count() <= 0)
  532. {
  533. return true;
  534. }
  535. else
  536. {
  537. if (evaluationStudentViewList.Count() <= (evaluationControlView.NoNumber ?? 0))
  538. {
  539. return true;
  540. }
  541. else
  542. {
  543. return false;
  544. }
  545. }
  546. }
  547. else
  548. {
  549. return true;
  550. }
  551. }
  552. }
  553. }
  554. }