CourseTimeHoursView.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.ComponentModel;
  6. using System.ComponentModel.DataAnnotations;
  7. namespace EMIS.ViewModel.SchedulingManage.SchedulingSettings
  8. {
  9. public class CourseTimeHoursView
  10. {
  11. /// <summary>
  12. /// 主键ID
  13. /// </summary>
  14. [DisplayName("主键ID")]
  15. public Guid? CourseTimeHoursID { get; set; }
  16. /// <summary>
  17. /// 课程类别
  18. /// </summary>
  19. [Required]
  20. [DisplayName("课程类别")]
  21. public Guid? CoursesTimeID { get; set; }
  22. [Required]
  23. [DisplayName("年级")]
  24. public int? Year { get; set; }
  25. [Required]
  26. [DisplayName("学时数")]
  27. public int? Hours { get; set; }
  28. /// <summary>
  29. /// 节次
  30. /// </summary>
  31. [Required]
  32. [DisplayName("节次")]
  33. public int? StartTimes { get; set; }
  34. /// <summary>
  35. /// 节次
  36. /// </summary>
  37. [Required]
  38. [DisplayName("节次")]
  39. public int? EndTimes { get; set; }
  40. /// <summary>
  41. /// 时间节段
  42. /// </summary>
  43. [Required]
  44. [DisplayName("时间节段")]
  45. public int? TimesSegment { get; set; }
  46. /// <summary>
  47. /// 时间节段
  48. /// </summary>
  49. [DisplayName("时间节段")]
  50. public string TimesSegmentName { get; set; }
  51. /// <summary>
  52. /// 开始时间
  53. /// </summary>
  54. [DisplayName("开始时间")]
  55. public string StartDate
  56. {
  57. get
  58. {
  59. return (StartHour ?? 0).ToString().PadLeft(2, '0')
  60. + ":"
  61. + (StartMinutes ?? 0).ToString().PadLeft(2, '0');
  62. }
  63. }
  64. /// <summary>
  65. /// 开始时间
  66. /// </summary>
  67. [Required]
  68. [DisplayName("开始时间")]
  69. [Range(0, 23, ErrorMessage = "小时数必须是0到23之间")]
  70. public int? StartHour { get; set; }
  71. /// <summary>
  72. /// 开始时间
  73. /// </summary>
  74. [Required]
  75. [DisplayName("开始时间")]
  76. [Range(0, 59, ErrorMessage = "分钟数必须是0到59之间")]
  77. public int? StartMinutes { get; set; }
  78. /// <summary>
  79. /// 结束时间
  80. /// </summary>
  81. [DisplayName("结束时间")]
  82. public string EndDate
  83. {
  84. get
  85. {
  86. return (EndHour ?? 0).ToString().PadLeft(2, '0')
  87. + ":"
  88. + (EndMinutes ?? 0).ToString().PadLeft(2, '0');
  89. }
  90. }
  91. /// <summary>
  92. /// 结束时间
  93. /// </summary>
  94. [Required]
  95. [DisplayName("结束时间")]
  96. [Range(0, 23, ErrorMessage = "小时数必须是0到23之间")]
  97. public int? EndHour { get; set; }
  98. /// <summary>
  99. /// 结束时间
  100. /// </summary>
  101. [Required]
  102. [DisplayName("结束时间")]
  103. [Range(0, 59, ErrorMessage = "分钟数必须是0到59之间")]
  104. public int? EndMinutes { get; set; }
  105. public string time_starTime_endTime
  106. {
  107. get
  108. {
  109. return TimesSegmentName + "(" + StartDate + "-" + EndDate + ")";
  110. }
  111. }
  112. }
  113. }