ElectiveCourseEnterView.cs 17 KB

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