123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel;
- using EMIS.Entities;
- using EMIS.ViewModel.CacheManage;
- namespace EMIS.ViewModel.ExaminationManage
- {
- public class ExaminationPlanView
- {
- /// <summary>
- /// ExaminationPlanID
- /// </summary>
- public System.Guid ExaminationPlanID { get; set; }
- [Required]
- [DisplayName("学年学期")]
- public Nullable<System.Guid> SchoolyearID { get; set; }
- public string SchoolyearCode { get; set; }
- [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "Campus")]
- public Nullable<System.Guid> CampusID { get; set; }
- public string CampusName { get; set; }
- [Required]
- [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "College")]
- public Nullable<System.Guid> CollegeID { get; set; }
- public string CollegeName { get; set; }
- [Required]
- [DisplayName("考试科目")]
- public Nullable<System.Guid> CoursematerialID { get; set; }
- public string CoursematerialName { get; set; }
- [Required]
- [DisplayName("考试方式")]
- public Nullable<int> ExaminationModeID { get; set; }
- public string ExaminationModeName
- {
- get
- {
- return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ExaminationMode.ToString())
- .Where(x => x.Value == ExaminationModeID)
- .Select(x => x.Name).FirstOrDefault();
- }
- }
- [Required]
- [DisplayName("考试形式")]
- public Nullable<int> ExaminationStyleID { get; set; }
- public string ExaminationStyleName
- {
- get
- {
- return IdNameExt.GetDictionaryItem(DictionaryItem.EX_ExaminationStyle.ToString())
- .Where(x => x.Value == ExaminationStyleID)
- .Select(x => x.Name).FirstOrDefault();
- }
- }
- [Required]
- [DisplayName("考试性质")]
- public Nullable<int> ExamsCategoryID { get; set; }
- public string ExamsCategoryName
- {
- get
- {
- return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ExamsCategory.ToString())
- .Where(x => x.Value == ExamsCategoryID)
- .Select(x => x.Name).FirstOrDefault();
- }
- }
- public Nullable<Guid> EducationMissionID { get; set; }
- public Guid? ClassmajorID { get; set; }
- [Required]
- [DisplayName("班级名称")]
- public string ClassName { get; set; }
- [Required]
- [DisplayName("考试日期")]
- public Nullable<System.DateTime> ExaminationDate { get; set; }
- [Required]
- [DisplayName("开始时间")]
- public Nullable<System.TimeSpan> StartTime { get; set; }
- public string StartTimeStr
- {
- get
- {
- if (StartTime.HasValue)
- {
- if (StartTime.Value.Minutes == 0)
- {
- return StartTime.Value.Hours + ":00" ;
- }
- else
- {
- return StartTime.Value.Hours + ":" + StartTime.Value.Minutes;
- }
- }
- else
- {
- return null;
- }
- }
- }
- [Required]
- [DisplayName("结束时间")]
- public Nullable<System.TimeSpan> EndTime { get; set; }
- public string EndTimeStr
- {
- get
- {
- if (EndTime.HasValue)
- {
- if (EndTime.Value.Minutes == 0)
- {
- return EndTime.Value.Hours + ":00";
- }
- else
- {
- return EndTime.Value.Hours + ":" + EndTime.Value.Minutes;
- }
- }
- else
- {
- return null;
- }
- }
- }
- public string ExaminationTime
- {
- get
- {
- return (StartTime.HasValue && EndTime.HasValue) ? StartTime.Value.ToString("hh\\:mm") + "-" + EndTime.Value.ToString("hh\\:mm") : "";
- }
- }
- public int? ClassroomNum
- {
- get
- {
- return CF_Classroom.Count();
- }
- }
- public IEnumerable<CF_Classroom> CF_Classroom { get; set; }
- public string ClassroomNames
- {
- get
- {
- return string.Join(",", CF_Classroom.Select(x => x.Name).ToList());
- }
- }
-
- public IEnumerable<CF_Student> Students { get; set; }
- [DisplayName("学生人数")]
- public int? MissionStudentCount { get; set; }
- [DisplayName("排考人数")]
- public int? StudentCount { get; set; }
- /// <summary>
- /// 课程结束周次
- /// </summary>
- public int? CourseEndWeekNum { get; set; }
- /// <summary>
- /// 最大排考周次,主要用于排序,不能直接从WeekNum算出……
- /// </summary>
- public int? MaxWeekNum { get; set; }
- public HashSet<EM_EducationMissionExamWeekNum> WeekNum { get; set; }
- public string WeekNumString
- {
- get
- {
- if (WeekNum != null)
- {
- return string.Join(@"\", WeekNum.Where(x => x.WeeklyNum.HasValue).Select(x => x.WeeklyNum.ToString()));
- }
- return "";
- }
- }
- /// <summary>
- /// RecordStatus
- /// </summary>
- public Nullable<int> RecordStatus { get; set; }
- public string RecordStatusDesc
- {
- get
- {
- return IdNameExt.GetDictionaryItem(DictionaryItem.EX_ExaminationPlanStatus.ToString())
- .Where(x => x.Value == RecordStatus)
- .Select(x => x.Name).FirstOrDefault();
- }
- }
- public IEnumerable<Sys_User> staffUser { get; set; }
- public string staffNames {
- get
- {
- if (staffUser != null)
- {
- return string.Join("/", staffUser.Select(x => x.Name));
- }
- return "";
- }
- }
-
-
- public IEnumerable<ExaminationRoomLayoutView> ExaminationRoomLayoutView { get; set; }
- /// <summary>
- /// 教师姓名
- /// </summary>
- [DisplayName("教师姓名")]
- public string TeacherName
- {
- get
- {
- string name = string.Empty;
- if (ExaminationRoomLayoutView != null)
- name = string.Join(",", ExaminationRoomLayoutView.Select(s => s.TeacherNames));
- if (string.IsNullOrEmpty(name))
- {
- return "";
- }
- else
- {
- return name;
- }
- }
- }
- /// <summary>
- /// CreateTime
- /// </summary>
- public Nullable<System.DateTime> CreateTime { get; set; }
- /// <summary>
- /// CreateUserID
- /// </summary>
- public Nullable<System.Guid> CreateUserID { get; set; }
- /// <summary>
- /// ModifyUserID
- /// </summary>
- public Nullable<System.Guid> ModifyUserID { get; set; }
- /// <summary>
- /// ModifyTime
- /// </summary>
- public Nullable<System.DateTime> ModifyTime { get; set; }
- }
- }
|