ExecutableFreeSelectionCouseView.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.ComponentModel;
  6. using System.ComponentModel.DataAnnotations;
  7. using EMIS.ViewModel.CacheManage;
  8. namespace EMIS.ViewModel.SelectCourse
  9. {
  10. /// <summary>
  11. /// 任选设定
  12. /// </summary>
  13. public class ExecutableFreeSelectionCouseView
  14. {
  15. //是否验证冲突
  16. [DisplayName("是否验证冲突")]
  17. public bool? IsNeedVerify { get; set; }
  18. /// <summary>
  19. /// 任选设定ID
  20. /// </summary>
  21. [DisplayName("任选设定ID")]
  22. public Guid ExecutableFreeSelectionCouseID { get; set; }
  23. /// <summary>
  24. /// 任选课程ID
  25. /// </summary>
  26. [Required]
  27. [DisplayName("任选课程ID")]
  28. public Guid? FreeSelectionCouseID { get; set; }
  29. /// <summary>
  30. /// 选课编号
  31. /// </summary>
  32. [DisplayName("选课编号")]
  33. public string FreeSelectionCouseNo { get; set; }
  34. /// <summary>
  35. /// 学年学期ID
  36. /// </summary>
  37. [Required]
  38. [DisplayName("学年学期ID")]
  39. public Guid? SchoolyearID { get; set; }
  40. /// <summary>
  41. /// 学年学期
  42. /// </summary>
  43. [DisplayName("学年学期")]
  44. public string SchoolyearCode { get; set; }
  45. /// <summary>
  46. /// 学年学期
  47. /// </summary>
  48. [DisplayName("学年学期")]
  49. public string SchoolyearName { get; set; }
  50. /// <summary>
  51. /// 选修任务班名称
  52. /// </summary>
  53. [Required]
  54. [DisplayName("选修任务班名称")]
  55. public string DefaultClassName { get; set; }
  56. /// <summary>
  57. /// 开课教研室ID
  58. /// </summary>
  59. [Required]
  60. [DisplayName("开课教研室ID")]
  61. public Guid? DepartmentID { get; set; }
  62. /// <summary>
  63. /// 开课教研室
  64. /// </summary>
  65. [DisplayName("开课教研室")]
  66. public string DepartmentName { get; set; }
  67. /// <summary>
  68. /// 院系所ID
  69. /// </summary>
  70. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "CollegeID")]
  71. public Guid? CollegeID { get; set; }
  72. /// <summary>
  73. /// 院系所
  74. /// </summary>
  75. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "College")]
  76. public string CollegeName { get; set; }
  77. /// <summary>
  78. /// 课程代码
  79. /// </summary>
  80. [DisplayName("课程代码")]
  81. public string CourseCode { get; set; }
  82. /// <summary>
  83. /// 课程名称
  84. /// </summary>
  85. [DisplayName("课程名称")]
  86. public string CourseName { get; set; }
  87. /// <summary>
  88. /// 课程类型
  89. /// </summary>
  90. [Required]
  91. [DisplayName("课程类型")]
  92. public int? CourseTypeID { get; set; }
  93. /// <summary>
  94. /// 课程类型
  95. /// </summary>
  96. [DisplayName("课程类型")]
  97. public string CourseTypeName
  98. {
  99. get
  100. {
  101. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_CourseType.ToString())
  102. .Where(x => x.Value == CourseTypeID)
  103. .Select(x => x.Name).FirstOrDefault();
  104. }
  105. }
  106. /// <summary>
  107. /// 课程结构
  108. /// </summary>
  109. //[Required]
  110. [DisplayName("课程结构")]
  111. public int? CourseStructureID { get; set; }
  112. /// <summary>
  113. /// 课程结构
  114. /// </summary>
  115. [DisplayName("课程结构")]
  116. public string CourseStructureName
  117. {
  118. get
  119. {
  120. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_CourseStructure.ToString())
  121. .Where(x => x.Value == CourseStructureID)
  122. .Select(x => x.Name).FirstOrDefault();
  123. }
  124. }
  125. /// <summary>
  126. /// 课程类别
  127. /// </summary>
  128. //[Required]
  129. [DisplayName("课程属性")]
  130. public int? CourseCategoryID { get; set; }
  131. /// <summary>
  132. /// 课程类别
  133. /// </summary>
  134. [DisplayName("课程属性")]
  135. public string CourseCategoryName
  136. {
  137. get
  138. {
  139. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_CourseCategory.ToString())
  140. .Where(x => x.Value == CourseCategoryID)
  141. .Select(x => x.Name).FirstOrDefault();
  142. }
  143. }
  144. /// <summary>
  145. /// 课程性质
  146. /// </summary>
  147. //[Required]
  148. [DisplayName("课程性质")]
  149. public int? CourseQualityID { get; set; }
  150. /// <summary>
  151. /// 课程性质
  152. /// </summary>
  153. [DisplayName("课程性质")]
  154. public string CourseQualityName
  155. {
  156. get
  157. {
  158. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_CourseQuality.ToString())
  159. .Where(x => x.Value == CourseQualityID)
  160. .Select(x => x.Name).FirstOrDefault();
  161. }
  162. }
  163. /// <summary>
  164. /// 学分
  165. /// </summary>
  166. [Required]
  167. [DisplayName("学分")]
  168. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  169. public decimal Credit { get; set; }
  170. /// <summary>
  171. /// 总学时
  172. /// </summary>
  173. [Required]
  174. [DisplayName("总学时")]
  175. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  176. public int? Totalhours
  177. {
  178. get
  179. {
  180. //return ((TheoryCourse ?? 0) + (Practicehours ?? 0) + (Trialhours ?? 0));
  181. return ((TheoryCourse ?? 0) + (Practicehours ?? 0));
  182. }
  183. }
  184. /// <summary>
  185. /// 理论学时
  186. /// </summary>
  187. [Required]
  188. [DisplayName("理论学时")]
  189. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  190. public int? TheoryCourse { get; set; }
  191. /// <summary>
  192. /// 实践学时
  193. /// </summary>
  194. [Required]
  195. [DisplayName("实践学时")]
  196. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  197. public int? Practicehours { get; set; }
  198. /// <summary>
  199. /// 实验学时
  200. /// </summary>
  201. [Required]
  202. [DisplayName("实验学时")]
  203. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  204. public int? Trialhours { get; set; }
  205. /// <summary>
  206. /// 上课周数
  207. /// </summary>
  208. [Required]
  209. [DisplayName("上课周数")]
  210. public int? SchoolweeksNum
  211. {
  212. get
  213. {
  214. return (TheoryWeeklyNum ?? 0) + (PracticeWeeklyNum ?? 0) + (TrialWeeklyNum ?? 0);
  215. }
  216. }
  217. /// <summary>
  218. /// 每周次数
  219. /// </summary>
  220. [Required]
  221. [DisplayName("每周次数")]
  222. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  223. public int? WeeklyNum { get; set; }
  224. /// <summary>
  225. /// 理论周次
  226. /// </summary>
  227. [Required]
  228. [DisplayName("理论周次")]
  229. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  230. public int? TheoryWeeklyNum { get; set; }
  231. /// <summary>
  232. /// 实践周次
  233. /// </summary>
  234. [Required]
  235. [DisplayName("实践周次")]
  236. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  237. public int? PracticeWeeklyNum { get; set; }
  238. /// <summary>
  239. /// 实验周次
  240. /// </summary>
  241. [Required]
  242. [DisplayName("实验周次")]
  243. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  244. public int? TrialWeeklyNum { get; set; }
  245. /// <summary>
  246. /// 周学时
  247. /// </summary>
  248. [Required]
  249. [DisplayName("周学时")]
  250. [RegularExpression(@"^[0-9]*$", ErrorMessage = "请输入数字")]//^[1-9]\d*|0$
  251. public int? WeeklyHours { get; set; }
  252. /// <summary>
  253. /// 开始周次
  254. /// </summary>
  255. [DisplayName("开始周次")]
  256. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  257. public int? StartWeeklyNum { get; set; }
  258. /// <summary>
  259. /// 结束周次
  260. /// </summary>
  261. [DisplayName("结束周次")]
  262. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  263. public int? EndWeeklyNum { get; set; }
  264. /// <summary>
  265. /// 起止周次
  266. /// </summary>
  267. [DisplayName("起止周次")]
  268. public string StartEndWeeklyNum
  269. {
  270. get
  271. {
  272. if (StartWeeklyNum != null && EndWeeklyNum != null)
  273. return StartWeeklyNum + "-" + EndWeeklyNum;
  274. else
  275. return "";
  276. }
  277. }
  278. /// <summary>
  279. /// 授课方式
  280. /// </summary>
  281. [DisplayName("授课方式")]
  282. public List<int> TeachingModeID { get; set; }
  283. /// <summary>
  284. /// 授课方式
  285. /// </summary>
  286. [DisplayName("授课方式")]
  287. public string TeachingModeName { get; set; }
  288. /// <summary>
  289. /// 实践类型
  290. /// </summary>
  291. [DisplayName("实践类型")]
  292. public int? PracticeTypeID { get; set; }
  293. // <summary>
  294. /// 实践类型
  295. /// </summary>
  296. [DisplayName("实践类型")]
  297. public string PracticeTypeNameStr { get; set; }
  298. /// <summary>
  299. /// 实践类型
  300. /// </summary>
  301. [DisplayName("实践类型")]
  302. public string PracticeTypeName
  303. {
  304. get
  305. {
  306. return IdNameExt.GetDictionaryItem(DictionaryItem.EM_PracticeType.ToString())
  307. .Where(x => x.Value == PracticeTypeID)
  308. .Select(x => x.Name).FirstOrDefault();
  309. }
  310. }
  311. /// <summary>
  312. /// 考试方式
  313. /// </summary>
  314. [Required]
  315. [DisplayName("考试方式")]
  316. public int? ExaminationModeID { get; set; }
  317. /// <summary>
  318. /// 考试方式
  319. /// </summary>
  320. [DisplayName("考试方式")]
  321. public string ExaminationModeName
  322. {
  323. get
  324. {
  325. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ExaminationMode.ToString())
  326. .Where(x => x.Value == CourseTypeID)
  327. .Select(x => x.Name).FirstOrDefault();
  328. }
  329. }
  330. /// <summary>
  331. /// 成绩类型
  332. /// </summary>
  333. [Required]
  334. [DisplayName("成绩类型")]
  335. public int? ResultTypeID { get; set; }
  336. /// <summary>
  337. /// 成绩类型
  338. /// </summary>
  339. [DisplayName("成绩类型")]
  340. public string ResultTypeName
  341. {
  342. get
  343. {
  344. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ResultType.ToString())
  345. .Where(x => x.Value == ResultTypeID)
  346. .Select(x => x.Name).FirstOrDefault();
  347. }
  348. }
  349. /// <summary>
  350. /// 授课语言
  351. /// </summary>
  352. [DisplayName("授课语言")]
  353. public int? TeachinglanguageID { get; set; }
  354. /// <summary>
  355. /// 授课语言
  356. /// </summary>
  357. [DisplayName("授课语言")]
  358. public string TeachinglanguageName
  359. {
  360. get
  361. {
  362. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Teachinglanguage.ToString())
  363. .Where(x => x.Value == TeachinglanguageID)
  364. .Select(x => x.Name).FirstOrDefault();
  365. }
  366. }
  367. /// <summary>
  368. /// 开课学年
  369. /// </summary>
  370. [DisplayName("开课学年")]
  371. public int? SchoolyearNumID { get; set; }
  372. /// <summary>
  373. /// 开课学年
  374. /// </summary>
  375. [DisplayName("开课学年")]
  376. public string SchoolyearNumName { get; set; }
  377. /// <summary>
  378. /// 学期
  379. /// </summary>
  380. [DisplayName("学期")]
  381. public int? SchoolcodeID { get; set; }
  382. /// <summary>
  383. /// 学期
  384. /// </summary>
  385. [DisplayName("学期")]
  386. public string SchoolcodeName { get; set; }
  387. /// <summary>
  388. /// 开课学期
  389. /// </summary>
  390. [DisplayName("开课学期")]
  391. public int? StarttermID { get; set; }
  392. /// <summary>
  393. /// 开课学期
  394. /// </summary>
  395. [DisplayName("开课学期")]
  396. public string StarttermName { get; set; }
  397. /// <summary>
  398. /// 处理方式
  399. /// </summary>
  400. [Required]
  401. [DisplayName("处理方式")]
  402. public int? HandleModeID { get; set; }
  403. /// <summary>
  404. /// 处理方式
  405. /// </summary>
  406. [DisplayName("处理方式")]
  407. public string HandleModeName
  408. {
  409. get
  410. {
  411. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_HandleMode.ToString())
  412. .Where(x => x.Value == HandleModeID)
  413. .Select(x => x.Name).FirstOrDefault();
  414. }
  415. }
  416. /// <summary>
  417. /// 是否需要教材
  418. /// </summary>
  419. [DisplayName("是否需要教材")]
  420. public bool IsNeedMaterial { get; set; }
  421. /// <summary>
  422. /// 是否需要教材
  423. /// </summary>
  424. [DisplayName("是否需要教材")]
  425. public string IsNeedMaterialName { get; set; }
  426. /// <summary>
  427. /// 人数下限
  428. /// </summary>
  429. [DisplayName("人数下限")]
  430. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  431. public int? PeopleNumlower { get; set; }
  432. /// <summary>
  433. /// 人数上限
  434. /// </summary>
  435. [DisplayName("人数上限")]
  436. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  437. public int? PeopleNumlimit { get; set; }
  438. /// <summary>
  439. /// 排课明细
  440. /// </summary>
  441. [DisplayName("排课明细")]
  442. public string Scheduling { get; set; }
  443. /// <summary>
  444. /// 星期
  445. /// </summary>
  446. [DisplayName("星期")]
  447. public int? Weekday { get; set; }
  448. /// <summary>
  449. /// 星期
  450. /// </summary>
  451. [DisplayName("星期")]
  452. public string WeekdayName { get; set; }
  453. /// <summary>
  454. /// 节次
  455. /// </summary>
  456. [DisplayName("节次")]
  457. public Guid? CoursesTimeID { get; set; }
  458. /// <summary>
  459. /// 节次
  460. /// </summary>
  461. [DisplayName("节次")]
  462. public string CoursesTimeName { get; set; }
  463. /// <summary>
  464. /// 教室ID
  465. /// </summary>
  466. [DisplayName("教室ID")]
  467. //[Required]
  468. public Guid? ClassroomID { get; set; }
  469. /// <summary>
  470. /// 教室
  471. /// </summary>
  472. [DisplayName("教室")]
  473. public string ClassroomName { get; set; }
  474. /// <summary>
  475. /// 任课教师
  476. /// </summary>
  477. [DisplayName("任课教师")]
  478. public HashSet<ExecutableFreeSelectionCouseTeacherListView> Teachers { get; set; }
  479. /// <summary>
  480. /// 任课教师
  481. /// </summary>
  482. public string TeacherNames
  483. {
  484. get
  485. {
  486. var teacherNames = string.Join(",", Teachers.Select(x => x.Name).ToList());
  487. if (string.IsNullOrEmpty(teacherNames))
  488. {
  489. return "";
  490. }
  491. else
  492. {
  493. return teacherNames;
  494. }
  495. }
  496. }
  497. /// <summary>
  498. /// 年级范围
  499. /// </summary>
  500. [DisplayName("年级范围")]
  501. public List<int> GradeYear { get; set; }
  502. /// <summary>
  503. /// 年级范围
  504. /// </summary>
  505. [DisplayName("年级范围")]
  506. public string GradeYearName { get; set; }
  507. /// <summary>
  508. /// 专业范围
  509. /// </summary>
  510. [DisplayName("专业范围")]
  511. public List<Guid> SpecialtyID { get; set; }
  512. /// <summary>
  513. /// 专业范围
  514. /// </summary>
  515. [DisplayName("专业范围")]
  516. public string SpecialtyName { get; set; }
  517. /// <summary>
  518. /// 开放状态
  519. /// </summary>
  520. [DisplayName("开放状态")]
  521. public bool IsOpened { get; set; }
  522. /// <summary>
  523. /// 开放状态
  524. /// </summary>
  525. public string IsOpenedName
  526. {
  527. get
  528. {
  529. return IsOpened == true ? "是" : "否";
  530. }
  531. }
  532. /// <summary>
  533. /// 是否启用
  534. /// </summary>
  535. [DisplayName("是否启用")]
  536. public bool IsEnable { get; set; }
  537. /// <summary>
  538. /// 是否启用
  539. /// </summary>
  540. [DisplayName("是否启用")]
  541. public string IsEnableName
  542. {
  543. get
  544. {
  545. return IsEnable == true ? "是" : "否";
  546. }
  547. }
  548. /// <summary>
  549. /// 审批状态
  550. /// </summary>
  551. [DisplayName("审批状态")]
  552. public int? ApprovalStatus { get; set; }
  553. /// <summary>
  554. /// 审批状态
  555. /// </summary>
  556. [DisplayName("审批状态")]
  557. public string ApprovalStatusName { get; set; }
  558. /// <summary>
  559. /// 任选课开课申请状态
  560. /// </summary>
  561. public bool IsEditable
  562. {
  563. get
  564. {
  565. return !(this.ApprovalStatus != (int)EM_FreeSelectionCouseApplyStatus.NotSubmit && this.ApprovalStatus != (int)EM_FreeSelectionCouseApplyStatus.Rollbacked);
  566. }
  567. }
  568. /// <summary>
  569. /// 状态
  570. /// </summary>
  571. public Nullable<int> RecordStatus { get; set; }
  572. /// <summary>
  573. /// 选课结果状态
  574. /// </summary>
  575. [DisplayName("状态ID")]
  576. public string RecordStatusCode
  577. {
  578. get
  579. {
  580. return IdNameExt.GetDictionaryItem(DictionaryItem.EM_SelectCourseResultStatus.ToString())
  581. .Where(x => x.Value == RecordStatus)
  582. .Select(x => x.Code).FirstOrDefault();
  583. }
  584. }
  585. /// <summary>
  586. /// 选课结果状态
  587. /// </summary>
  588. [DisplayName("状态")]
  589. public string RecordStatusName
  590. {
  591. get
  592. {
  593. return IdNameExt.GetDictionaryItem(DictionaryItem.EM_SelectCourseResultStatus.ToString())
  594. .Where(x => x.Value == RecordStatus)
  595. .Select(x => x.Name).FirstOrDefault();
  596. }
  597. }
  598. /// <summary>
  599. /// 备注
  600. /// </summary>
  601. [DisplayName("备注")]
  602. public string Remarks { get; set; }
  603. /// <summary>
  604. /// 创建人
  605. /// </summary>
  606. [DisplayName("创建人")]
  607. public Guid? CreateUserID { get; set; }
  608. /// <summary>
  609. /// 创建时间
  610. /// </summary>
  611. [DisplayName("创建时间")]
  612. public DateTime? CreateTime { get; set; }
  613. [DisplayName("上课时间")]
  614. public string WeekdayTimesSegmentName { get; set; }
  615. }
  616. }