using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel; using System.ComponentModel.DataAnnotations; namespace EMIS.ViewModel.ExaminationManage { public class TimeSegmentView { public Guid? TimeSegmentID { get; set; } [DisplayName("是否补考时间")] public bool IsForResit { get; set; } public string IsForResitDesc { get { return IsForResit ? "是" : "否"; } } [DisplayName("考试日期")] public DateTime ExaminationDate { get; set; } public string ExaminationDateString { get { return ExaminationDate.ToString("yyyy-MM-dd"); } } [DisplayName("开始时间")] public TimeSpan StartTime { get; set; } public string StartTimeString { get { return StartTime.ToString(@"hh\:mm"); } } [DisplayName("结束时间")] public TimeSpan EndTime { get; set; } public string EndTimeString { get { return EndTime.ToString(@"hh\:mm"); } } public string TimeSegmentName { get { return ExaminationDate.ToString("yyyy-MM-dd") + " " + StartTime.ToString(@"hh\:mm") + "-" + EndTime.ToString(@"hh\:mm"); } } } }