FreeSelectionCourseApplyView.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  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 FreeSelectionCourseApplyView
  14. {
  15. //是否验证冲突
  16. [DisplayName("是否验证冲突")]
  17. public bool? IsNeedVerify { get; set; }
  18. /// <summary>
  19. /// 任选开课申请ID
  20. /// </summary>
  21. [DisplayName("任选开课申请ID")]
  22. public Guid FreeSelectionCouseApplyID { get; set; }
  23. /// <summary>
  24. /// 任选课程ID
  25. /// </summary>
  26. [Required]
  27. [DisplayName("任选课程")]
  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. }
  182. }
  183. /// <summary>
  184. /// 理论学时
  185. /// </summary>
  186. [Required]
  187. [DisplayName("理论学时")]
  188. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  189. public int? TheoryCourse { get; set; }
  190. /// <summary>
  191. /// 实践学时
  192. /// </summary>
  193. [Required]
  194. [DisplayName("实践学时")]
  195. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  196. public int? Practicehours { get; set; }
  197. /// <summary>
  198. /// 实验学时
  199. /// </summary>
  200. [Required]
  201. [DisplayName("实验学时")]
  202. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  203. public int? Trialhours { get; set; }
  204. /// <summary>
  205. /// 上课周数
  206. /// </summary>
  207. [Required]
  208. [DisplayName("上课周数")]
  209. public int? SchoolweeksNum
  210. {
  211. get
  212. {
  213. return (TheoryWeeklyNum ?? 0) + (PracticeWeeklyNum ?? 0) + (TrialWeeklyNum ?? 0);
  214. }
  215. }
  216. /// <summary>
  217. /// 每周次数
  218. /// </summary>
  219. [Required]
  220. [DisplayName("每周次数")]
  221. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  222. public int? WeeklyNum { get; set; }
  223. /// <summary>
  224. /// 理论周次
  225. /// </summary>
  226. [Required]
  227. [DisplayName("理论周次")]
  228. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  229. public int? TheoryWeeklyNum { get; set; }
  230. /// <summary>
  231. /// 实践周次
  232. /// </summary>
  233. [Required]
  234. [DisplayName("实践周次")]
  235. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  236. public int? PracticeWeeklyNum { get; set; }
  237. /// <summary>
  238. /// 实验周次
  239. /// </summary>
  240. [Required]
  241. [DisplayName("实验周次")]
  242. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  243. public int? TrialWeeklyNum { get; set; }
  244. /// <summary>
  245. /// 周学时
  246. /// </summary>
  247. [Required]
  248. [DisplayName("周学时")]
  249. [RegularExpression(@"^[0-9]*$", ErrorMessage = "请输入数字")]//^[1-9]\d*|0$
  250. public int? WeeklyHours { get; set; }
  251. /// <summary>
  252. /// 开始周次
  253. /// </summary>
  254. [DisplayName("开始周次")]
  255. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  256. public int? StartWeeklyNum { get; set; }
  257. /// <summary>
  258. /// 结束周次
  259. /// </summary>
  260. [DisplayName("结束周次")]
  261. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  262. public int? EndWeeklyNum { get; set; }
  263. /// <summary>
  264. /// 起止周次
  265. /// </summary>
  266. [DisplayName("起止周次")]
  267. public string StartEndWeeklyNum
  268. {
  269. get
  270. {
  271. if (StartWeeklyNum != null && EndWeeklyNum != null)
  272. return StartWeeklyNum + "-" + EndWeeklyNum;
  273. else
  274. return "";
  275. }
  276. }
  277. /// <summary>
  278. /// 授课方式
  279. /// </summary>
  280. [DisplayName("授课方式")]
  281. public List<int> TeachingModeID { get; set; }
  282. /// <summary>
  283. /// 授课方式
  284. /// </summary>
  285. [DisplayName("授课方式")]
  286. public string TeachingModeName { get; set; }
  287. /// <summary>
  288. /// 实践类型
  289. /// </summary>
  290. [DisplayName("实践类型")]
  291. public int? PracticeTypeID { get; set; }
  292. // <summary>
  293. /// 实践类型
  294. /// </summary>
  295. [DisplayName("实践类型")]
  296. public string PracticeTypeNameStr { get; set; }
  297. /// <summary>
  298. /// 实践类型
  299. /// </summary>
  300. [DisplayName("实践类型")]
  301. public string PracticeTypeName
  302. {
  303. get
  304. {
  305. return IdNameExt.GetDictionaryItem(DictionaryItem.EM_PracticeType.ToString())
  306. .Where(x => x.Value == PracticeTypeID)
  307. .Select(x => x.Name).FirstOrDefault();
  308. }
  309. }
  310. /// <summary>
  311. /// 考试方式
  312. /// </summary>
  313. [Required]
  314. [DisplayName("考试方式")]
  315. public int? ExaminationModeID { get; set; }
  316. /// <summary>
  317. /// 成绩类型
  318. /// </summary>
  319. [Required]
  320. [DisplayName("成绩类型")]
  321. public int? ResultTypeID { get; set; }
  322. /// <summary>
  323. /// 成绩类型
  324. /// </summary>
  325. [DisplayName("成绩类型")]
  326. public string ResultTypeName
  327. {
  328. get
  329. {
  330. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ResultType.ToString())
  331. .Where(x => x.Value == ResultTypeID)
  332. .Select(x => x.Name).FirstOrDefault();
  333. }
  334. }
  335. /// <summary>
  336. /// 考试方式
  337. /// </summary>
  338. [DisplayName("考试方式")]
  339. public string ExaminationModeName
  340. {
  341. get
  342. {
  343. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ExaminationMode.ToString())
  344. .Where(x => x.Value == CourseTypeID)
  345. .Select(x => x.Name).FirstOrDefault();
  346. }
  347. }
  348. /// <summary>
  349. /// 授课语言
  350. /// </summary>
  351. [DisplayName("授课语言")]
  352. public int? TeachinglanguageID
  353. {
  354. get;set;
  355. }
  356. /// <summary>
  357. /// 授课语言
  358. /// </summary>
  359. [DisplayName("授课语言")]
  360. public string TeachinglanguageName
  361. {
  362. get
  363. {
  364. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Teachinglanguage.ToString())
  365. .Where(x => x.Value == TeachinglanguageID)
  366. .Select(x => x.Name).FirstOrDefault();
  367. }
  368. }
  369. /// <summary>
  370. /// 开课学年
  371. /// </summary>
  372. [DisplayName("开课学年")]
  373. public int? SchoolyearNumID { get; set; }
  374. /// <summary>
  375. /// 开课学年
  376. /// </summary>
  377. [DisplayName("开课学年")]
  378. public string SchoolyearNumName { get; set; }
  379. /// <summary>
  380. /// 学期
  381. /// </summary>
  382. [DisplayName("学期")]
  383. public int? SchoolcodeID { get; set; }
  384. /// <summary>
  385. /// 学期
  386. /// </summary>
  387. [DisplayName("学期")]
  388. public string SchoolcodeName { get; set; }
  389. /// <summary>
  390. /// 开课学期
  391. /// </summary>
  392. [DisplayName("开课学期")]
  393. public int? StarttermID { get; set; }
  394. /// <summary>
  395. /// 开课学期
  396. /// </summary>
  397. [DisplayName("开课学期")]
  398. public string StarttermName { get; set; }
  399. /// <summary>
  400. /// 处理方式
  401. /// </summary>
  402. [Required]
  403. [DisplayName("处理方式")]
  404. public int? HandleModeID { get; set; }
  405. /// <summary>
  406. /// 处理方式
  407. /// </summary>
  408. [DisplayName("处理方式")]
  409. public string HandleModeName
  410. {
  411. get
  412. {
  413. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_HandleMode.ToString())
  414. .Where(x => x.Value == HandleModeID)
  415. .Select(x => x.Name).FirstOrDefault();
  416. }
  417. }
  418. /// <summary>
  419. /// 是否需要教材
  420. /// </summary>
  421. [DisplayName("是否需要教材")]
  422. public bool IsNeedMaterial { get; set; }
  423. /// <summary>
  424. /// 是否需要教材
  425. /// </summary>
  426. [DisplayName("是否需要教材")]
  427. public string IsNeedMaterialName { get; set; }
  428. /// <summary>
  429. /// 人数上限
  430. /// </summary>
  431. [DisplayName("人数下限")]
  432. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  433. public int? PeopleNumlower { get; set; }
  434. /// <summary>
  435. /// 人数上限
  436. /// </summary>
  437. [DisplayName("人数上限")]
  438. [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")]
  439. public int? PeopleNumlimit { get; set; }
  440. /// <summary>
  441. /// 排课明细
  442. /// </summary>
  443. [DisplayName("排课明细")]
  444. public string Scheduling { get; set; }
  445. /// <summary>
  446. /// 星期
  447. /// </summary>
  448. [DisplayName("星期")]
  449. public int? Weekday { get; set; }
  450. /// <summary>
  451. /// 星期
  452. /// </summary>
  453. [DisplayName("星期")]
  454. public string WeekdayName { get; set; }
  455. /// <summary>
  456. /// 节次
  457. /// </summary>
  458. [DisplayName("节次")]
  459. public Guid? CoursesTimeID { get; set; }
  460. /// <summary>
  461. /// 节次
  462. /// </summary>
  463. [DisplayName("节次")]
  464. public string CoursesTimeName { get; set; }
  465. /// <summary>
  466. /// 教室ID
  467. /// </summary>
  468. [DisplayName("教室")]
  469. //[Required]
  470. public Guid? ClassroomID { get; set; }
  471. /// <summary>
  472. /// 教室
  473. /// </summary>
  474. [DisplayName("教室")]
  475. public string ClassroomName { get; set; }
  476. /// <summary>
  477. /// 任课教师
  478. /// </summary>
  479. [DisplayName("任课教师")]
  480. public HashSet<FreeSelectionCourseApplyTeacherListView> Teachers { get; set; }
  481. /// <summary>
  482. /// 任课教师
  483. /// </summary>
  484. public string TeacherNames
  485. {
  486. get
  487. {
  488. var teacherNames = string.Join(",", Teachers.Select(x => x.Name).ToList());
  489. if (string.IsNullOrEmpty(teacherNames))
  490. {
  491. return "";
  492. }
  493. else
  494. {
  495. return teacherNames;
  496. }
  497. }
  498. }
  499. /// <summary>
  500. /// 年级范围
  501. /// </summary>
  502. [DisplayName("年级范围")]
  503. public List<int> GradeYear { get; set; }
  504. /// <summary>
  505. /// 年级范围
  506. /// </summary>
  507. [DisplayName("年级范围")]
  508. public string GradeYearName { get; set; }
  509. /// <summary>
  510. /// 专业范围
  511. /// </summary>
  512. [DisplayName("专业范围")]
  513. public List<Guid> SpecialtyID { get; set; }
  514. /// <summary>
  515. /// 专业范围
  516. /// </summary>
  517. [DisplayName("专业范围")]
  518. public string SpecialtyName { get; set; }
  519. /// <summary>
  520. /// 开放状态
  521. /// </summary>
  522. [DisplayName("开放状态")]
  523. public bool IsOpened { get; set; }
  524. /// <summary>
  525. /// 开放状态
  526. /// </summary>
  527. public string IsOpenedName
  528. {
  529. get
  530. {
  531. return IsOpened == true ? "是" : "否";
  532. }
  533. }
  534. /// <summary>
  535. /// 是否启用
  536. /// </summary>
  537. [DisplayName("是否启用")]
  538. public bool IsEnable { get; set; }
  539. /// <summary>
  540. /// 是否启用
  541. /// </summary>
  542. [DisplayName("是否启用")]
  543. public string IsEnableName
  544. {
  545. get
  546. {
  547. return IsEnable == true ? "是" : "否";
  548. }
  549. }
  550. /// <summary>
  551. /// 审批状态
  552. /// </summary>
  553. [DisplayName("审批状态")]
  554. public int? ApprovalStatus { get; set; }
  555. /// <summary>
  556. /// 审批状态
  557. /// </summary>
  558. [DisplayName("审批状态")]
  559. public string ApprovalStatusName { get; set; }
  560. /// <summary>
  561. /// 任选课开课申请状态
  562. /// </summary>
  563. public bool IsEditable
  564. {
  565. get
  566. {
  567. return !(this.ApprovalStatus != (int)EM_FreeSelectionCouseApplyStatus.NotSubmit && this.ApprovalStatus != (int)EM_FreeSelectionCouseApplyStatus.Rollbacked);
  568. }
  569. }
  570. /// <summary>
  571. /// 状态
  572. /// </summary>
  573. public Nullable<int> RecordStatus { get; set; }
  574. /// <summary>
  575. /// 选课结果状态
  576. /// </summary>
  577. [DisplayName("状态ID")]
  578. public string RecordStatusCode
  579. {
  580. get
  581. {
  582. return IdNameExt.GetDictionaryItem(DictionaryItem.EM_SelectCourseResultStatus.ToString())
  583. .Where(x => x.Value == RecordStatus)
  584. .Select(x => x.Code).FirstOrDefault();
  585. }
  586. }
  587. /// <summary>
  588. /// 选课结果状态
  589. /// </summary>
  590. [DisplayName("状态")]
  591. public string RecordStatusName
  592. {
  593. get
  594. {
  595. return IdNameExt.GetDictionaryItem(DictionaryItem.EM_SelectCourseResultStatus.ToString())
  596. .Where(x => x.Value == RecordStatus)
  597. .Select(x => x.Name).FirstOrDefault();
  598. }
  599. }
  600. /// <summary>
  601. /// 备注
  602. /// </summary>
  603. [DisplayName("备注")]
  604. public string Remarks { get; set; }
  605. /// <summary>
  606. /// 创建人
  607. /// </summary>
  608. [DisplayName("创建人")]
  609. public Guid? CreateUserID { get; set; }
  610. /// <summary>
  611. /// 创建时间
  612. /// </summary>
  613. [DisplayName("创建时间")]
  614. public DateTime? CreateTime { get; set; }
  615. [DisplayName("上课时间")]
  616. public string WeekdayTimesSegmentName { get; set; }
  617. }
  618. }