SelectCourseResultView.cs 17 KB

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