using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using EMIS.Entities; namespace EMIS.ViewModel.EducationSchedule { public class ClassroomExcessiveUseView { public ClassroomExcessiveUseView() { this.Scheduling = new List(); } public System.Guid ClassroomExcessiveUseID { get; set; } [Required] [DisplayName("教室")] public Nullable ClassroomID { get; set; } public string ClassroomName { get; set; } [Required] [DisplayName("学年学期")] public Nullable SchoolyearID { get; set; } public string SchoolyearCode { get; set; } [Required] [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "UsingCollege")] public Nullable CollegeID { get; set; } public string CollegeName { get; set; } [Required] [DisplayName("使用人")] public Nullable UserID { get; set; } public string UserName { get; set; } [Required] [DisplayName("活动内容")] public string Content { get; set; } [DisplayName("时间安排")] public List Scheduling { get; set; } public string SchedulingString { get { var schedulingStringList = Scheduling.OrderBy(x => x.StartTimes) .Select(x => new { x.Weekday, x.WeekdayDesc, x.CoursesTimeID, x.StartTimes, x.EndTimes, x.StartHour, x.StartMinute, x.EndHour, x.EndMinute, WeekNums = x.WeekNumList.ToList().GetWeekNumString() }) .Select(x => string.Format("{0}第{1}-{2}节({3})", x.WeekdayDesc, x.StartTimes, x.EndTimes, x.WeekNums)); return string.Join(",", schedulingStringList); } } [DisplayName("申请人")] public Guid? CreateUserID { get; set; } public string CreateUserName { get; set; } public DateTime? CreateTime { get; set; } public string CreateTimeStr { get { return CreateTime == null ? "" : CreateTime.Value.ToString(); } } } }