using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel; using System.ComponentModel.DataAnnotations; namespace EMIS.ViewModel.SchedulingManage.SchedulingSettings { public class CourseTimeHoursView { /// /// 主键ID /// [DisplayName("主键ID")] public Guid? CourseTimeHoursID { get; set; } /// /// 课程类别 /// [Required] [DisplayName("课程类别")] public Guid? CoursesTimeID { get; set; } [Required] [DisplayName("年级")] public int? Year { get; set; } [Required] [DisplayName("学时数")] public int? Hours { get; set; } /// /// 节次 /// [Required] [DisplayName("节次")] public int? StartTimes { get; set; } /// /// 节次 /// [Required] [DisplayName("节次")] public int? EndTimes { get; set; } /// /// 时间节段 /// [Required] [DisplayName("时间节段")] public int? TimesSegment { get; set; } /// /// 时间节段 /// [DisplayName("时间节段")] public string TimesSegmentName { get; set; } /// /// 开始时间 /// [DisplayName("开始时间")] public string StartDate { get { return (StartHour ?? 0).ToString().PadLeft(2, '0') + ":" + (StartMinutes ?? 0).ToString().PadLeft(2, '0'); } } /// /// 开始时间 /// [Required] [DisplayName("开始时间")] [Range(0, 23, ErrorMessage = "小时数必须是0到23之间")] public int? StartHour { get; set; } /// /// 开始时间 /// [Required] [DisplayName("开始时间")] [Range(0, 59, ErrorMessage = "分钟数必须是0到59之间")] public int? StartMinutes { get; set; } /// /// 结束时间 /// [DisplayName("结束时间")] public string EndDate { get { return (EndHour ?? 0).ToString().PadLeft(2, '0') + ":" + (EndMinutes ?? 0).ToString().PadLeft(2, '0'); } } /// /// 结束时间 /// [Required] [DisplayName("结束时间")] [Range(0, 23, ErrorMessage = "小时数必须是0到23之间")] public int? EndHour { get; set; } /// /// 结束时间 /// [Required] [DisplayName("结束时间")] [Range(0, 59, ErrorMessage = "分钟数必须是0到59之间")] public int? EndMinutes { get; set; } public string time_starTime_endTime { get { return TimesSegmentName + "(" + StartDate + "-" + EndDate + ")"; } } } }