MinorSpecialtyCourseView.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.ComponentModel;
  6. using EMIS.ViewModel.CacheManage;
  7. using System.ComponentModel.DataAnnotations;
  8. namespace EMIS.ViewModel.MinorManage.MinorCourseManage
  9. {
  10. public class MinorSpecialtyCourseView
  11. {
  12. /// <summary>
  13. /// 主键ID
  14. /// </summary>
  15. public Guid? MinorCourseID { get; set; }
  16. /// <summary>
  17. /// 院系所ID
  18. /// </summary>
  19. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "College")]
  20. public Guid? CollegeID { get; set; }
  21. /// <summary>
  22. /// 教研室
  23. /// </summary>
  24. [Required]
  25. [DisplayName("教研室")]
  26. public Guid? DepartmentID { get; set; }
  27. /// <summary>
  28. /// 教研室代码
  29. /// </summary>
  30. [DisplayName("教研室代码")]
  31. public string DepartmentCode { get; set; }
  32. /// <summary>
  33. /// 教研室
  34. /// </summary>
  35. [DisplayName("教研室")]
  36. public string DepartmentName { get; set; }
  37. /// <summary>
  38. /// 标准专业
  39. /// </summary>
  40. [DisplayName("专业名称")]
  41. public int? StandardID { get; set; }
  42. /// <summary>
  43. /// 专业代码(国标码)
  44. /// </summary>
  45. [DisplayName("专业代码")]
  46. public string Code { get; set; }
  47. /// <summary>
  48. /// 专业代码(国标码)
  49. /// </summary>
  50. [DisplayName("专业代码")]
  51. public string SpecialtyCode
  52. {
  53. get
  54. {
  55. var inistStandardCode = IdNameExt.GetDictionaryItem(DictionaryItem.CF_Standard.ToString())
  56. .Where(x => x.Value == StandardID)
  57. .Select(x => x.Code).FirstOrDefault();
  58. return (inistStandardCode != null ? inistStandardCode.PadLeft(6, '0') : "");
  59. }
  60. }
  61. [DisplayName("专业代码")]
  62. public string SpecialtyCodeStr { get; set; }
  63. /// <summary>
  64. /// 专业名称
  65. /// </summary>
  66. [DisplayName("专业名称")]
  67. public string StandardName
  68. {
  69. get
  70. {
  71. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Standard.ToString())
  72. .Where(x => x.Value == StandardID)
  73. .Select(x => x.Name).FirstOrDefault();
  74. }
  75. }
  76. [DisplayName("专业名称")]
  77. public string StandardNameStr { get; set; }
  78. [DisplayName("学制")]
  79. public string LearnSystemStr { get; set; }
  80. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "EducationID")]
  81. public string EducationNameStr { get; set; }
  82. [DisplayName("学习形式")]
  83. public string LearningformNameStr { get; set; }
  84. /// <summary>
  85. /// 学制
  86. /// </summary>
  87. [DisplayName("学制")]
  88. public decimal? LearnSystem { get; set; }
  89. /// <summary>
  90. /// 培养层次
  91. /// </summary>
  92. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "EducationID")]
  93. public int? EducationID { get; set; }
  94. /// <summary>
  95. /// 培养层次名称
  96. /// </summary>
  97. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "EducationName")]
  98. public string EducationName
  99. {
  100. get
  101. {
  102. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Education.ToString())
  103. .Where(x => x.Value == EducationID)
  104. .Select(x => x.Name).FirstOrDefault();
  105. }
  106. }
  107. /// <summary>
  108. /// 学习形式
  109. /// </summary>
  110. [DisplayName("学习形式")]
  111. public int? LearningformID { get; set; }
  112. /// <summary>
  113. /// 学习形式名称
  114. /// </summary>
  115. [DisplayName("学习形式名称")]
  116. public string LearningformName
  117. {
  118. get
  119. {
  120. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Learningform.ToString())
  121. .Where(x => x.Value == LearningformID)
  122. .Select(x => x.Name).FirstOrDefault();
  123. }
  124. }
  125. /// <summary>
  126. /// 课程资料
  127. /// </summary>
  128. [Required]
  129. [DisplayName("课程资料")]
  130. public Guid? CoursematerialID { get; set; }
  131. /// <summary>
  132. /// 课程资料代码
  133. /// </summary>
  134. [DisplayName("课程资料代码")]
  135. public string CourseCode { get; set; }
  136. /// <summary>
  137. /// 课程名称
  138. /// </summary>
  139. [DisplayName("课程名称")]
  140. public string CourseName { get; set; }
  141. /// <summary>
  142. /// 课程结构
  143. /// </summary>
  144. [DisplayName("课程结构")]
  145. public int? CourseStructureID { get; set; }
  146. [DisplayName("课程结构")]
  147. public string CourseStructureNameStr { get; set; }
  148. /// <summary>
  149. /// 课程结构
  150. /// </summary>
  151. [DisplayName("课程结构")]
  152. public string CourseStructureName
  153. {
  154. get
  155. {
  156. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_CourseStructure.ToString())
  157. .Where(x => x.Value == CourseStructureID)
  158. .Select(x => x.Name).FirstOrDefault();
  159. }
  160. }
  161. /// <summary>
  162. /// 课程类别
  163. /// </summary>
  164. [Required]
  165. [DisplayName("课程属性")]
  166. public int? CourseCategoryID { get; set; }
  167. [DisplayName("课程属性")]
  168. public string CourseCategoryNameStr { get; set; }
  169. /// <summary>
  170. /// 课程类别
  171. /// </summary>
  172. [DisplayName("课程属性")]
  173. public string CourseCategoryName
  174. {
  175. get
  176. {
  177. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_CourseCategory.ToString())
  178. .Where(x => x.Value == CourseCategoryID)
  179. .Select(x => x.Name).FirstOrDefault();
  180. }
  181. }
  182. /// <summary>
  183. /// 课程类型
  184. /// </summary>
  185. [Required]
  186. [DisplayName("课程类型")]
  187. public int? CourseTypeID { get; set; }
  188. [DisplayName("课程类型")]
  189. public string CourseTypeStr { get; set; }
  190. /// <summary>
  191. /// 课程类型名称
  192. /// </summary>
  193. [DisplayName("课程类型名称")]
  194. public string CourseTypeName
  195. {
  196. get
  197. {
  198. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_CourseType.ToString())
  199. .Where(x => x.Value == CourseTypeID)
  200. .Select(x => x.Name).FirstOrDefault();
  201. }
  202. }
  203. /// <summary>
  204. /// 课程性质
  205. /// </summary>
  206. [Required]
  207. [DisplayName("课程性质")]
  208. public int? CourseQualityID { get; set; }
  209. [DisplayName("课程性质名称")]
  210. public string CourseQualityNameStr { get; set; }
  211. ///<summary>
  212. ///学生课程类型
  213. /// </summary>
  214. [DisplayName("课程类型")]
  215. public string StuCourseTypeName
  216. {
  217. get
  218. {
  219. var type = CourseQualityName;
  220. if (type == "必修课")
  221. {
  222. return "是";
  223. }
  224. else
  225. {
  226. return "否";
  227. }
  228. }
  229. }
  230. /// <summary>
  231. /// 课程性质
  232. /// </summary>
  233. [DisplayName("课程性质名称")]
  234. public string CourseQualityName
  235. {
  236. get
  237. {
  238. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_CourseQuality.ToString())
  239. .Where(x => x.Value == CourseQualityID)
  240. .Select(x => x.Name).FirstOrDefault();
  241. }
  242. }
  243. /// <summary>
  244. /// 授课方式
  245. /// </summary>
  246. [DisplayName("授课方式")]
  247. public List<int> TeachingModeID { get; set; }
  248. [DisplayName("授课方式")]
  249. public string TeachingModeStr { get; set; }
  250. /// <summary>
  251. /// 授课地点
  252. /// </summary>
  253. [DisplayName("授课地点")]
  254. public List<int> TeachingPlaceID { get; set; }
  255. [DisplayName("授课地点")]
  256. public string TeachingPlaceStr { get; set; }
  257. /// <summary>
  258. /// 实践类型
  259. /// </summary>
  260. [DisplayName("实践类型")]
  261. public int? PracticeTypeID { get; set; }
  262. [DisplayName("实践类型")]
  263. public string PracticeTypeNameStr { get; set; }
  264. /// <summary>
  265. /// 实践类型
  266. /// </summary>
  267. [DisplayName("实践类型")]
  268. public string PracticeTypeName
  269. {
  270. get
  271. {
  272. return IdNameExt.GetDictionaryItem(DictionaryItem.EM_PracticeType.ToString())
  273. .Where(x => x.Value == PracticeTypeID)
  274. .Select(x => x.Name).FirstOrDefault();
  275. }
  276. }
  277. /// <summary>
  278. /// 考试方式
  279. /// </summary>
  280. [Required]
  281. [DisplayName("考试方式")]
  282. public int? ExaminationModeID { get; set; }
  283. [DisplayName("考试方式名称")]
  284. public string ExaminationModeNameStr { get; set; }
  285. /// <summary>
  286. /// 考试方式名称
  287. /// </summary>
  288. [DisplayName("考试方式名称")]
  289. public string ExaminationModeName
  290. {
  291. get
  292. {
  293. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ExaminationMode.ToString())
  294. .Where(x => x.Value == ExaminationModeID)
  295. .Select(x => x.Name).FirstOrDefault();
  296. }
  297. }
  298. /// <summary>
  299. /// 授课语言
  300. /// </summary>
  301. [DisplayName("授课语言")]
  302. public int? TeachinglanguageID { get; set; }
  303. [DisplayName("授课语言")]
  304. public string TeachinglanguageNameStr { get; set; }
  305. /// <summary>
  306. /// 授课语言
  307. /// </summary>
  308. [DisplayName("授课语言")]
  309. public string TeachinglanguageName
  310. {
  311. get
  312. {
  313. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Teachinglanguage.ToString())
  314. .Where(x => x.Value == TeachinglanguageID)
  315. .Select(x => x.Name).FirstOrDefault();
  316. }
  317. }
  318. /// <summary>
  319. /// 开课学年
  320. /// </summary>
  321. [Required]
  322. [DisplayName("开课学年")]
  323. public int? SchoolyearNumID { get; set; }
  324. [DisplayName("开课学年")]
  325. public string SchoolyearNumNameStr { get; set; }
  326. /// <summary>
  327. /// 开课学年
  328. /// </summary>
  329. [DisplayName("开课学年")]
  330. public string SchoolyearNumName
  331. {
  332. get
  333. {
  334. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_SchoolyearNum.ToString())
  335. .Where(x => x.Value == SchoolyearNumID)
  336. .Select(x => x.Name).FirstOrDefault();
  337. }
  338. }
  339. /// <summary>
  340. /// 学期
  341. /// </summary>
  342. [Required]
  343. [DisplayName("学期")]
  344. public int? SchoolcodeID { get; set; }
  345. [DisplayName("学期")]
  346. public string SchoolcodeStr { get; set; }
  347. /// <summary>
  348. /// 学期
  349. /// </summary>
  350. [DisplayName("学期")]
  351. public string SchoolcodeName
  352. {
  353. get
  354. {
  355. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Semester.ToString()).Where(x => x.Value == SchoolcodeID).Select(x => x.Name).FirstOrDefault();
  356. }
  357. }
  358. /// <summary>
  359. /// 开课学期
  360. /// </summary>
  361. [Required]
  362. [DisplayName("开课学期")]
  363. public int? StarttermID { get; set; }
  364. /// <summary>
  365. /// 开课学期
  366. /// </summary>
  367. [DisplayName("开课学期")]
  368. public string StarttermName
  369. {
  370. get
  371. {
  372. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Startterm.ToString())
  373. .Where(x => x.Value == StarttermID)
  374. .Select(x => x.Name).FirstOrDefault();
  375. }
  376. }
  377. /// <summary>
  378. /// 精品课程
  379. /// </summary>
  380. [DisplayName("精品课程")]
  381. public int? CourseFineID { get; set; }
  382. [DisplayName("精品课程")]
  383. public string CourseFineNameStr { get; set; }
  384. /// <summary>
  385. /// 精品课程
  386. /// </summary>
  387. [DisplayName("精品课程")]
  388. public string CourseFineName
  389. {
  390. get
  391. {
  392. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_CourseFine.ToString())
  393. .Where(x => x.Value == CourseFineID)
  394. .Select(x => x.Name).FirstOrDefault();
  395. }
  396. }
  397. /// <summary>
  398. /// 成绩类型
  399. /// </summary>
  400. [Required]
  401. [DisplayName("成绩类型")]
  402. public int? ResultTypeID { get; set; }
  403. /// <summary>
  404. /// 成绩类型
  405. /// </summary>
  406. [DisplayName("成绩类型")]
  407. public string ResultTypeName
  408. {
  409. get
  410. {
  411. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ResultType.ToString())
  412. .Where(x => x.Value == ResultTypeID)
  413. .Select(x => x.Name).FirstOrDefault();
  414. }
  415. }
  416. /// <summary>
  417. /// 成绩类型
  418. /// </summary>
  419. [DisplayName("成绩类型")]
  420. public string ResultTypeNameStr { get; set; }
  421. /// <summary>
  422. /// 是否专业核心
  423. /// </summary>
  424. [DisplayName("是否专业核心")]
  425. public bool IsSpecialtycore { get; set; }
  426. /// <summary>
  427. /// 是否专业核心
  428. /// </summary>
  429. [DisplayName("是否专业核心")]
  430. public string IsSpecialtycoreName { get; set; }
  431. /// <summary>
  432. /// 是否合作开发课
  433. /// </summary>
  434. [DisplayName("是否合作开发课")]
  435. public bool IsCooperation { get; set; }
  436. /// <summary>
  437. /// 是否合作开发课
  438. /// </summary>
  439. [DisplayName("是否合作开发课")]
  440. public string IsCooperationName { get; set; }
  441. /// <summary>
  442. /// 是否必修课
  443. /// </summary>
  444. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "IsRequired")]
  445. public bool IsRequired { get; set; }
  446. /// <summary>
  447. /// 是否必修课
  448. /// </summary>
  449. [DisplayName("是否必修课")]
  450. public string IsRequiredName { get; set; }
  451. /// <summary>
  452. /// 是否网上选修课
  453. /// </summary>
  454. [DisplayName("是否网上选修课")]
  455. public bool IsElective { get; set; }
  456. /// <summary>
  457. /// 是否网上选修课
  458. /// </summary>
  459. [DisplayName("是否网上选修课")]
  460. public string IsElectiveName { get; set; }
  461. /// <summary>
  462. /// 是否网络课程
  463. /// </summary>
  464. [DisplayName("是否网络课程")]
  465. public bool IsNetworkCourse { get; set; }
  466. /// <summary>
  467. /// 是否网络课程
  468. /// </summary>
  469. [DisplayName("是否网络课程")]
  470. public string IsNetworkCourseName { get; set; }
  471. /// <summary>
  472. /// 是否学位主干课
  473. /// </summary>
  474. [DisplayName("是否学位主干课")]
  475. public bool IsMainCourse { get; set; }
  476. /// <summary>
  477. /// 是否学位主干课
  478. /// </summary>
  479. [DisplayName("是否学位主干课")]
  480. public string IsMainCourseName { get; set; }
  481. /// <summary>
  482. /// 是否启用
  483. /// </summary>
  484. public bool IsCourseEnable { get; set; }
  485. /// <summary>
  486. /// 是否启用
  487. /// </summary>
  488. [DisplayName("是否启用")]
  489. public bool IsEnable { get; set; }
  490. /// <summary>
  491. /// 学期
  492. /// </summary>
  493. [DisplayName("是否启用")]
  494. public string IsEnableName
  495. {
  496. get
  497. {
  498. int value = 0;
  499. if (IsEnable==true)
  500. {
  501. value = 1;
  502. }
  503. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_GeneralPurpose.ToString())
  504. .Where(x => x.Value == value)
  505. .Select(x => x.Name).FirstOrDefault();
  506. }
  507. }
  508. /// <summary>
  509. /// 是否启用
  510. /// </summary>
  511. [DisplayName("是否启用")]
  512. public string IsEnableStr { get; set; }
  513. /// <summary>
  514. /// 学分
  515. /// </summary>
  516. [Required]
  517. [DisplayName("学分")]
  518. [DisplayFormat(DataFormatString = "{0:#.0}")]
  519. [RegularExpression(@"^\d+(\.\d{1,1})?$", ErrorMessage = "请输整数或保留1位小数")]
  520. public decimal? Credit { get; set; }
  521. [DisplayName("学分")]
  522. public string CreditStr { get; set; }
  523. /// <summary>
  524. /// 总学时
  525. /// </summary>
  526. [DisplayName("总学时")]
  527. [RegularExpression(@"^[0-9]*$", ErrorMessage = "请输整数")]
  528. public int? Totalhours { get; set; }
  529. /// <summary>
  530. /// 理论学时
  531. /// </summary>
  532. [Required]
  533. [DisplayName("理论学时")]
  534. [RegularExpression(@"^[0-9]*$", ErrorMessage = "请输整数")]
  535. public int? TheoryCourse { get; set; }
  536. [DisplayName("理论学时")]
  537. public string TheoryCourseStr { get; set; }
  538. /// <summary>
  539. /// 实践学时
  540. /// </summary>
  541. [Required]
  542. [DisplayName("实践学时")]
  543. [RegularExpression(@"^[0-9]*$", ErrorMessage = "请输整数")]
  544. public int? Practicehours { get; set; }
  545. [DisplayName("实践学时")]
  546. public string PracticehoursStr { get; set; }
  547. /// <summary>
  548. /// 实验学时
  549. /// </summary>
  550. [Required]
  551. [DisplayName("实验学时")]
  552. [RegularExpression(@"^[0-9]*$", ErrorMessage = "请输整数")]
  553. public int? Trialhours { get; set; }
  554. [DisplayName("实验学时")]
  555. public string TrialhoursStr { get; set; }
  556. /// <summary>
  557. /// 总周次
  558. /// </summary>
  559. [DisplayName("总周次")]
  560. [RegularExpression(@"^[0-9]*$", ErrorMessage = "请输整数")]
  561. public int? SchoolweeksNum { get; set; }
  562. /// <summary>
  563. /// 每周次数
  564. /// </summary>
  565. [DisplayName("每周次数")]
  566. public int? WeeklyNum { get; set; }
  567. /// <summary>
  568. /// 理论周次
  569. /// </summary>
  570. [DisplayName("理论周次")]
  571. public int? TheoryWeeklyNum { get; set; }
  572. /// <summary>
  573. /// 实践周次
  574. /// </summary>
  575. [DisplayName("实践周次")]
  576. public int? PracticeWeeklyNum { get; set; }
  577. /// <summary>
  578. /// 实验周次
  579. /// </summary>
  580. [DisplayName("实验周次")]
  581. public int? TrialWeeklyNum { get; set; }
  582. /// <summary>
  583. /// 开始周次
  584. /// </summary>
  585. [DisplayName("开始周次")]
  586. [Required]
  587. [RegularExpression(@"^[0-9]*$", ErrorMessage = "请输整数")]
  588. public int? StartWeeklyNum { get; set; }
  589. /// <summary>
  590. /// 结束周次
  591. /// </summary>
  592. [DisplayName("结束周次")]
  593. [Required]
  594. [RegularExpression(@"^[0-9]*$", ErrorMessage = "请输整数")]
  595. public int? EndWeeklyNum { get; set; }
  596. /// <summary>
  597. /// 周学时
  598. /// </summary>
  599. [DisplayName("周学时")]
  600. public int? WeeklyHours { get; set; }
  601. /// <summary>
  602. /// 创建人
  603. /// </summary>
  604. [DisplayName("创建人")]
  605. public Guid? CreateUserID { get; set; }
  606. /// <summary>
  607. /// 创建时间
  608. /// </summary>
  609. [DisplayName("创建时间")]
  610. public DateTime? CreateTime { get; set; }
  611. /// <summary>
  612. /// 备注
  613. /// </summary>
  614. [DisplayName("备注")]
  615. public string Remarks { get; set; }
  616. /// <summary>
  617. /// 备注
  618. /// </summary>
  619. [DisplayName("错误信息")]
  620. public string ErrorMessage { get; set; }
  621. private bool _isExcelVaildateOK = true;
  622. /// <summary>
  623. /// Excel验证是否通过,默认为true
  624. /// <para>true:通过;false:不通过</para>
  625. /// </summary>
  626. public bool IsExcelVaildateOK
  627. {
  628. get { return _isExcelVaildateOK; }
  629. set { _isExcelVaildateOK = value; }
  630. }
  631. }
  632. }