123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel;
- namespace EMIS.ViewModel.CalendarManage
- {
- public class CoursesTimeView
- {
- /// <summary>
- /// 主键ID
- /// </summary>
- [DisplayName("主键ID")]
- public Guid? CoursesTimeID { get; set; }
- /// <summary>
- /// 节次
- /// </summary>
- [Required]
- [DisplayName("开始节次")]
- public int? StartTimes { get; set; }
- [Required]
- [DisplayName("结束节次")]
- public int? EndTimes { get; set; }
- public string Times
- {
- get
- {
- return StartTimes.Value.ToString() + "-" + EndTimes.Value.ToString();
- }
- }
- /// <summary>
- /// 时间段
- /// </summary>
- [Required]
- [DisplayName("时间段")]
- public int? TimesSegment { get; set; }
- /// <summary>
- /// 时间段
- /// </summary>
- [DisplayName("时间段")]
- public string TimesSegmentName { get; set; }
- /// <summary>
- /// 开始时间
- /// </summary>
- [DisplayName("开始时间")]
- public string StartDate {
- get
- {
- return (StartHour ?? 0).ToString().PadLeft(2, '0')
- + ":"
- + (StartMinutes ?? 0).ToString().PadLeft(2, '0');
- }
- }
- /// <summary>
- /// 开始时间
- /// </summary>
- [Required]
- [DisplayName("开始时间")]
- [Range(0, 23, ErrorMessage = "小时数必须是0到23之间")]
- public int? StartHour { get; set; }
- /// <summary>
- /// 开始时间
- /// </summary>
- [Required]
- [DisplayName("开始时间")]
- [Range(0, 59, ErrorMessage = "分钟数必须是0到59之间")]
- public int? StartMinutes { get; set; }
- /// <summary>
- /// 结束时间
- /// </summary>
- [DisplayName("结束时间")]
- public string EndDate
- {
- get
- {
- return (EndHour ?? 0).ToString().PadLeft(2, '0')
- + ":"
- + (EndMinutes ?? 0).ToString().PadLeft(2, '0');
- }
- }
- /// <summary>
- /// 结束时间
- /// </summary>
- [Required]
- [DisplayName("结束时间")]
- [Range(0, 23, ErrorMessage = "小时数必须是0到23之间")]
- public int? EndHour { get; set; }
- /// <summary>
- /// 结束时间
- /// </summary>
- [Required]
- [DisplayName("结束时间")]
- [Range(0, 59, ErrorMessage = "分钟数必须是0到59之间")]
- public int? EndMinutes { get; set; }
- /// <summary>
- /// 学时数
- /// </summary>
- [DisplayName("学时数")]
- public int? Workhours
- {
- get
- {
- return this.EndTimes.Value - this.StartTimes.Value + 1;
- }
- }
- /// <summary>
- /// 上课时间
- /// </summary>
- [DisplayName("上课时间")]
- public string time_starTime_endTime
- {
- get
- {
- return TimesSegmentName + "(" + StartDate + "-" + EndDate + ")";
- }
- }
- /// <summary>
- /// 创建人
- /// </summary>
- [DisplayName("创建人")]
- public Guid? CreateUserID { get; set; }
- /// <summary>
- /// 创建时间
- /// </summary>
- [DisplayName("创建时间")]
- public DateTime? CreateTime { get; set; }
- /// <summary>
- /// 更新人
- /// </summary>
- [DisplayName("更新人")]
- public Guid? ModifyUserID { get; set; }
- /// <summary>
- /// 更新时间
- /// </summary>
- [DisplayName("更新时间")]
- public DateTime? ModifyTime { get; set; }
- }
- }
|