ExaminationPlanView.cs 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.ComponentModel.DataAnnotations;
  6. using System.ComponentModel;
  7. using EMIS.Entities;
  8. using EMIS.ViewModel.CacheManage;
  9. namespace EMIS.ViewModel.ExaminationManage
  10. {
  11. public class ExaminationPlanView
  12. {
  13. /// <summary>
  14. /// ExaminationPlanID
  15. /// </summary>
  16. public System.Guid ExaminationPlanID { get; set; }
  17. [Required]
  18. [DisplayName("学年学期")]
  19. public Nullable<System.Guid> SchoolyearID { get; set; }
  20. public string SchoolyearCode { get; set; }
  21. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "Campus")]
  22. public Nullable<System.Guid> CampusID { get; set; }
  23. public string CampusName { get; set; }
  24. [Required]
  25. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "College")]
  26. public Nullable<System.Guid> CollegeID { get; set; }
  27. public string CollegeName { get; set; }
  28. [Required]
  29. [DisplayName("考试科目")]
  30. public Nullable<System.Guid> CoursematerialID { get; set; }
  31. public string CoursematerialName { get; set; }
  32. [Required]
  33. [DisplayName("考试方式")]
  34. public Nullable<int> ExaminationModeID { get; set; }
  35. public string ExaminationModeName
  36. {
  37. get
  38. {
  39. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ExaminationMode.ToString())
  40. .Where(x => x.Value == ExaminationModeID)
  41. .Select(x => x.Name).FirstOrDefault();
  42. }
  43. }
  44. [Required]
  45. [DisplayName("考试形式")]
  46. public Nullable<int> ExaminationStyleID { get; set; }
  47. public string ExaminationStyleName
  48. {
  49. get
  50. {
  51. return IdNameExt.GetDictionaryItem(DictionaryItem.EX_ExaminationStyle.ToString())
  52. .Where(x => x.Value == ExaminationStyleID)
  53. .Select(x => x.Name).FirstOrDefault();
  54. }
  55. }
  56. [Required]
  57. [DisplayName("考试性质")]
  58. public Nullable<int> ExamsCategoryID { get; set; }
  59. public string ExamsCategoryName
  60. {
  61. get
  62. {
  63. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ExamsCategory.ToString())
  64. .Where(x => x.Value == ExamsCategoryID)
  65. .Select(x => x.Name).FirstOrDefault();
  66. }
  67. }
  68. public Nullable<Guid> EducationMissionID { get; set; }
  69. public Guid? ClassmajorID { get; set; }
  70. [Required]
  71. [DisplayName("班级名称")]
  72. public string ClassName { get; set; }
  73. [Required]
  74. [DisplayName("考试日期")]
  75. public Nullable<System.DateTime> ExaminationDate { get; set; }
  76. [Required]
  77. [DisplayName("开始时间")]
  78. public Nullable<System.TimeSpan> StartTime { get; set; }
  79. public string StartTimeStr
  80. {
  81. get
  82. {
  83. if (StartTime.HasValue)
  84. {
  85. if (StartTime.Value.Minutes == 0)
  86. {
  87. return StartTime.Value.Hours + ":00" ;
  88. }
  89. else
  90. {
  91. return StartTime.Value.Hours + ":" + StartTime.Value.Minutes;
  92. }
  93. }
  94. else
  95. {
  96. return null;
  97. }
  98. }
  99. }
  100. [Required]
  101. [DisplayName("结束时间")]
  102. public Nullable<System.TimeSpan> EndTime { get; set; }
  103. public string EndTimeStr
  104. {
  105. get
  106. {
  107. if (EndTime.HasValue)
  108. {
  109. if (EndTime.Value.Minutes == 0)
  110. {
  111. return EndTime.Value.Hours + ":00";
  112. }
  113. else
  114. {
  115. return EndTime.Value.Hours + ":" + EndTime.Value.Minutes;
  116. }
  117. }
  118. else
  119. {
  120. return null;
  121. }
  122. }
  123. }
  124. public string ExaminationTime
  125. {
  126. get
  127. {
  128. return (StartTime.HasValue && EndTime.HasValue) ? StartTime.Value.ToString("hh\\:mm") + "-" + EndTime.Value.ToString("hh\\:mm") : "";
  129. }
  130. }
  131. public int? ClassroomNum
  132. {
  133. get
  134. {
  135. return CF_Classroom.Count();
  136. }
  137. }
  138. public IEnumerable<CF_Classroom> CF_Classroom { get; set; }
  139. public string ClassroomNames
  140. {
  141. get
  142. {
  143. return string.Join(",", CF_Classroom.Select(x => x.Name).ToList());
  144. }
  145. }
  146. public IEnumerable<CF_Student> Students { get; set; }
  147. [DisplayName("学生人数")]
  148. public int? MissionStudentCount { get; set; }
  149. [DisplayName("排考人数")]
  150. public int? StudentCount { get; set; }
  151. /// <summary>
  152. /// 课程结束周次
  153. /// </summary>
  154. public int? CourseEndWeekNum { get; set; }
  155. /// <summary>
  156. /// 最大排考周次,主要用于排序,不能直接从WeekNum算出……
  157. /// </summary>
  158. public int? MaxWeekNum { get; set; }
  159. public HashSet<EM_EducationMissionExamWeekNum> WeekNum { get; set; }
  160. public string WeekNumString
  161. {
  162. get
  163. {
  164. if (WeekNum != null)
  165. {
  166. return string.Join(@"\", WeekNum.Where(x => x.WeeklyNum.HasValue).Select(x => x.WeeklyNum.ToString()));
  167. }
  168. return "";
  169. }
  170. }
  171. /// <summary>
  172. /// RecordStatus
  173. /// </summary>
  174. public Nullable<int> RecordStatus { get; set; }
  175. public string RecordStatusDesc
  176. {
  177. get
  178. {
  179. return IdNameExt.GetDictionaryItem(DictionaryItem.EX_ExaminationPlanStatus.ToString())
  180. .Where(x => x.Value == RecordStatus)
  181. .Select(x => x.Name).FirstOrDefault();
  182. }
  183. }
  184. public IEnumerable<Sys_User> staffUser { get; set; }
  185. public string staffNames {
  186. get
  187. {
  188. if (staffUser != null)
  189. {
  190. return string.Join("/", staffUser.Select(x => x.Name));
  191. }
  192. return "";
  193. }
  194. }
  195. public IEnumerable<ExaminationRoomLayoutView> ExaminationRoomLayoutView { get; set; }
  196. /// <summary>
  197. /// 教师姓名
  198. /// </summary>
  199. [DisplayName("教师姓名")]
  200. public string TeacherName
  201. {
  202. get
  203. {
  204. string name = string.Empty;
  205. if (ExaminationRoomLayoutView != null)
  206. name = string.Join(",", ExaminationRoomLayoutView.Select(s => s.TeacherNames));
  207. if (string.IsNullOrEmpty(name))
  208. {
  209. return "";
  210. }
  211. else
  212. {
  213. return name;
  214. }
  215. }
  216. }
  217. /// <summary>
  218. /// CreateTime
  219. /// </summary>
  220. public Nullable<System.DateTime> CreateTime { get; set; }
  221. /// <summary>
  222. /// CreateUserID
  223. /// </summary>
  224. public Nullable<System.Guid> CreateUserID { get; set; }
  225. /// <summary>
  226. /// ModifyUserID
  227. /// </summary>
  228. public Nullable<System.Guid> ModifyUserID { get; set; }
  229. /// <summary>
  230. /// ModifyTime
  231. /// </summary>
  232. public Nullable<System.DateTime> ModifyTime { get; set; }
  233. }
  234. }