OptionalCoursePlanView.cs 18 KB

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