StudentSelectCourseView.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  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.SelectCourse.SelectCourseResult
  9. {
  10. public class StudentSelectCourseView
  11. {
  12. public Guid ID { get; set; }
  13. public Guid? SchoolyearID { get; set; }
  14. public string SchoolYearCode { get; set; }
  15. [DisplayName("选修任务班名称")]
  16. public string DefaultClassName { get; set; }
  17. [DisplayName("教师")]
  18. public Guid? TeacherUserID { get; set; }
  19. [DisplayName("教师工号")]
  20. public string TeacherUserCode { get; set; }
  21. [DisplayName("教师名称")]
  22. public string TeacherName { get; set; }
  23. [DisplayName("校区")]
  24. public Guid? CampusID { get; set; }
  25. /// <summary>
  26. /// 校区
  27. /// </summary>
  28. [DisplayName("校区")]
  29. public string CampusName { get; set; }
  30. ///
  31. ///
  32. /// <summary>
  33. /// 教研室
  34. /// </summary>
  35. [DisplayName("教研室")]
  36. public Guid? DepartmentID { get; set; }
  37. /// <summary>
  38. /// 教研室
  39. /// </summary>
  40. [DisplayName("教研室")]
  41. public string DepartmentName { get; set; }
  42. /// <summary>
  43. /// 每周次数
  44. /// </summary>
  45. [DisplayName("每周次数")]
  46. public int? WeeklyNum { get; set; }
  47. /// <summary>
  48. /// 开始周次
  49. /// </summary>
  50. [DisplayName("开始周次")]
  51. public int? StartWeeklyNum { get; set; }
  52. /// <summary>
  53. /// 结束周次
  54. /// </summary>
  55. [DisplayName("结束周次")]
  56. public int? EndWeeklyNum { get; set; }
  57. public string StartEndWeeklyNum
  58. {
  59. get
  60. {
  61. return (this.StartWeeklyNum.HasValue && this.EndWeeklyNum.HasValue) ?
  62. (this.StartWeeklyNum.Value.ToString() + "-" + this.EndWeeklyNum.Value.ToString()) : "";
  63. }
  64. }
  65. /// <summary>
  66. /// 开始时间
  67. /// </summary>
  68. public DateTime? StartTime { get; set; }
  69. public string StartTimeStr
  70. {
  71. get
  72. {
  73. return StartTime.HasValue ? StartTime.Value.ToShortDateString() : null;
  74. }
  75. }
  76. /// <summary>
  77. /// 结束时间
  78. /// </summary>
  79. public DateTime? EndTime { get; set; }
  80. public string EndTimeStr
  81. {
  82. get
  83. {
  84. return EndTime.HasValue ? EndTime.Value.ToShortDateString() : null;
  85. }
  86. }
  87. /// <summary>
  88. /// 是否需要教材
  89. /// </summary>
  90. [DisplayName("是否需要教材")]
  91. public bool IsNeedMaterial { get; set; }
  92. /// <summary>
  93. /// 是否需要教材
  94. /// </summary>
  95. [DisplayName("是否需要教材")]
  96. public string IsNeedMaterialName
  97. {
  98. get { return this.IsNeedMaterial != true ? "否" : "是"; }
  99. }
  100. /// <summary>
  101. /// 选择课程ID
  102. /// </summary>
  103. [DisplayName("选择课程ID")]
  104. public Guid SelectCourseID { get; set; }
  105. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "College")]
  106. public Guid? CollegeID { get; set; }
  107. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "College")]
  108. public string CollegeName { get; set; }
  109. //[DisplayName("选修类型")]
  110. //public int SelectCourseType { get; set; }
  111. //[DisplayName("选修类型")]
  112. //public string SelectCourseTypeName { get { return SelectCourseType == 0 ? "专业选修" : "任选选修"; } }
  113. public Guid? CoursematerialID { get; set; }
  114. /// <summary>
  115. /// 课程代码
  116. /// </summary>
  117. [DisplayName("课程代码")]
  118. public string CourseCode { get; set; }
  119. /// <summary>
  120. /// 课程名称
  121. /// </summary>
  122. [DisplayName("课程名称")]
  123. public string CourseName { get; set; }
  124. [DisplayName("课程性质")]
  125. public int? CourseQualityID { get; set; }
  126. /// <summary>
  127. /// 课程性质
  128. /// </summary>
  129. [DisplayName("课程性质")]
  130. public string CourseQualityName
  131. {
  132. get
  133. {
  134. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_CourseQuality.ToString())
  135. .Where(x => x.Value == CourseQualityID)
  136. .Select(x => x.Name).FirstOrDefault();
  137. }
  138. }
  139. [DisplayName("课程类型")]
  140. public int? CourseTypeID { get; set; }
  141. [DisplayName("课程类型")]
  142. public string CourseTypeName
  143. {
  144. get
  145. {
  146. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_CourseType.ToString())
  147. .Where(x => x.Value == CourseTypeID)
  148. .Select(x => x.Name).FirstOrDefault();
  149. }
  150. }
  151. /// <summary>
  152. /// 授课方式
  153. /// </summary>
  154. [DisplayName("授课方式")]
  155. public int? TeachingModeID { get; set; }
  156. /// <summary>
  157. /// 授课方式
  158. /// </summary>
  159. [DisplayName("授课方式")]
  160. public string TeachingModeName
  161. {
  162. //get;
  163. //set;
  164. get
  165. {
  166. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_TeachingMode.ToString())
  167. .Where(x => x.Value == TeachingModeID)
  168. .Select(x => x.Name).FirstOrDefault();
  169. }
  170. }
  171. /// <summary>
  172. /// 学分
  173. /// </summary>
  174. [DisplayName("学分")]
  175. public decimal? Credit { get; set; }
  176. /// <summary>
  177. /// 理论学时
  178. /// </summary>
  179. [DisplayName("理论学时")]
  180. public int? TheoryCourse { get; set; }
  181. /// <summary>
  182. /// 实践学时
  183. /// </summary>
  184. [DisplayName("实践学时")]
  185. public int? Practicehours { get; set; }
  186. /// <summary>
  187. /// 实验学时
  188. /// </summary>
  189. [DisplayName("实验学时")]
  190. public int? Trialhours { get; set; }
  191. /// <summary>
  192. /// 总学时
  193. /// </summary>
  194. [DisplayName("总学时")]
  195. public int? Totalhours
  196. {
  197. get
  198. {
  199. if (TheoryCourse == null)
  200. TheoryCourse = 0;
  201. if (Practicehours == null)
  202. Practicehours = 0;
  203. return (TheoryCourse + Practicehours);
  204. //return this.TheoryCourse ?? 0 + this.Practicehours ?? 0 + this.Trialhours ?? 0; }
  205. }
  206. }
  207. /// <summary>
  208. /// 人数下限
  209. /// </summary>
  210. [Required]
  211. [DisplayName("人数下限")]
  212. public Nullable<int> PeopleNumlower { get; set; }
  213. /// <summary>
  214. /// 人数上限
  215. /// </summary>
  216. [Required]
  217. [DisplayName("人数上限")]
  218. public Nullable<int> PeopleNumlimit { get; set; }
  219. [DisplayName("已选人数")]
  220. public int? StudentTotalNum { get; set; }
  221. /// <summary>
  222. /// 学期
  223. /// </summary>
  224. [DisplayName("学期")]
  225. public int? SchoolcodeID { get; set; }
  226. /// <summary>
  227. /// 学期
  228. /// </summary>
  229. [DisplayName("学期")]
  230. public string SchoolcodeName
  231. {
  232. get
  233. {
  234. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Semester.ToString()).Where(x => x.Value == SchoolcodeID).Select(x => x.Name).FirstOrDefault();
  235. }
  236. }
  237. /// <summary>
  238. /// 课程班级
  239. /// </summary>
  240. [DisplayName("课程班级")]
  241. public string ClassName { get; set; }
  242. /// <summary>
  243. /// 选修类型ID
  244. /// </summary>
  245. [DisplayName("选修类型ID")]
  246. public int SelectCourseTypeID { get; set; }
  247. /// <summary>
  248. /// 选修类型ID,0限选,1任选
  249. /// </summary>
  250. [DisplayName("选修类型ID")]
  251. public int SelectCourseTypeOrderID { get; set; }
  252. /// <summary>
  253. /// 选修类型
  254. /// </summary>
  255. [DisplayName("选修类型")]
  256. public string SelectCourseTypeName { get; set; }
  257. /// <summary>
  258. /// 已选人数
  259. /// </summary>
  260. [DisplayName("已选人数")]
  261. public int? StudentCount { get; set; }
  262. /// <summary>
  263. /// 任课教师ID
  264. /// </summary>
  265. [DisplayName("任课教师ID")]
  266. public string TeacherIDs { get; set; }
  267. /// <summary>
  268. /// 任课教师
  269. /// </summary>
  270. [DisplayName("任课教师")]
  271. public string TeacherNames { get; set; }
  272. /// <summary>
  273. /// 是否选择
  274. /// </summary>
  275. [DisplayName("是否选择")]
  276. public bool? IsSelected { get; set; }
  277. [DisplayName("指定节次")]
  278. public Guid? CoursesTimeID { get; set; }
  279. [DisplayName("指定节次")]
  280. public string CoursesTimeName { get; set; }
  281. [DisplayName("教室")]
  282. public Guid? ClassroomID { get; set; }
  283. [DisplayName("教室")]
  284. public string ClassroomName { get; set; }
  285. public string OperateText {
  286. get
  287. {
  288. return !(this.IsSelected ?? false) ? "选课" : "取消选课";
  289. }
  290. }
  291. [Required]
  292. [DisplayName("开放状态")]
  293. public bool IsOpened { get; set; }
  294. public string IsOpenedDesc
  295. {
  296. get { return this.IsOpened == true ? "是" : "否"; }
  297. }
  298. public int? RecordStatus { get; set; }
  299. [DisplayName("状态")]
  300. public string RecordStatusName
  301. {
  302. get
  303. {
  304. return IdNameExt.GetDictionaryItem(DictionaryItem.EM_SelectCourseResultStatus.ToString())
  305. .Where(x => x.Value == RecordStatus)
  306. .Select(x => x.Name).FirstOrDefault();
  307. }
  308. }
  309. /// <summary>
  310. /// 时间节段
  311. /// </summary>
  312. [Required]
  313. [DisplayName("时间节段")]
  314. public int? TimesSegment { get; set; }
  315. /// <summary>
  316. /// 时间节段
  317. /// </summary>
  318. [DisplayName("时间节段")]
  319. public string TimesSegmentName { get; set; }
  320. /// <summary>
  321. /// 星期
  322. /// </summary>
  323. public Nullable<int> Weekday { get; set; }
  324. public string WeekdayName
  325. {
  326. get;set;
  327. }
  328. [DisplayName("上课时间")]
  329. public string WeekdayTimesSegmentName { get; set; }
  330. }
  331. }