CoursesTimeView.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.ComponentModel.DataAnnotations;
  6. using System.ComponentModel;
  7. namespace EMIS.ViewModel.CalendarManage
  8. {
  9. public class CoursesTimeView
  10. {
  11. /// <summary>
  12. /// 主键ID
  13. /// </summary>
  14. [DisplayName("主键ID")]
  15. public Guid? CoursesTimeID { get; set; }
  16. /// <summary>
  17. /// 节次
  18. /// </summary>
  19. [Required]
  20. [DisplayName("开始节次")]
  21. public int? StartTimes { get; set; }
  22. [Required]
  23. [DisplayName("结束节次")]
  24. public int? EndTimes { get; set; }
  25. public string Times
  26. {
  27. get
  28. {
  29. return StartTimes.Value.ToString() + "-" + EndTimes.Value.ToString();
  30. }
  31. }
  32. /// <summary>
  33. /// 时间段
  34. /// </summary>
  35. [Required]
  36. [DisplayName("时间段")]
  37. public int? TimesSegment { get; set; }
  38. /// <summary>
  39. /// 时间段
  40. /// </summary>
  41. [DisplayName("时间段")]
  42. public string TimesSegmentName { get; set; }
  43. /// <summary>
  44. /// 开始时间
  45. /// </summary>
  46. [DisplayName("开始时间")]
  47. public string StartDate {
  48. get
  49. {
  50. return (StartHour ?? 0).ToString().PadLeft(2, '0')
  51. + ":"
  52. + (StartMinutes ?? 0).ToString().PadLeft(2, '0');
  53. }
  54. }
  55. /// <summary>
  56. /// 开始时间
  57. /// </summary>
  58. [Required]
  59. [DisplayName("开始时间")]
  60. [Range(0, 23, ErrorMessage = "小时数必须是0到23之间")]
  61. public int? StartHour { get; set; }
  62. /// <summary>
  63. /// 开始时间
  64. /// </summary>
  65. [Required]
  66. [DisplayName("开始时间")]
  67. [Range(0, 59, ErrorMessage = "分钟数必须是0到59之间")]
  68. public int? StartMinutes { get; set; }
  69. /// <summary>
  70. /// 结束时间
  71. /// </summary>
  72. [DisplayName("结束时间")]
  73. public string EndDate
  74. {
  75. get
  76. {
  77. return (EndHour ?? 0).ToString().PadLeft(2, '0')
  78. + ":"
  79. + (EndMinutes ?? 0).ToString().PadLeft(2, '0');
  80. }
  81. }
  82. /// <summary>
  83. /// 结束时间
  84. /// </summary>
  85. [Required]
  86. [DisplayName("结束时间")]
  87. [Range(0, 23, ErrorMessage = "小时数必须是0到23之间")]
  88. public int? EndHour { get; set; }
  89. /// <summary>
  90. /// 结束时间
  91. /// </summary>
  92. [Required]
  93. [DisplayName("结束时间")]
  94. [Range(0, 59, ErrorMessage = "分钟数必须是0到59之间")]
  95. public int? EndMinutes { get; set; }
  96. /// <summary>
  97. /// 学时数
  98. /// </summary>
  99. [DisplayName("学时数")]
  100. public int? Workhours
  101. {
  102. get
  103. {
  104. return this.EndTimes.Value - this.StartTimes.Value + 1;
  105. }
  106. }
  107. /// <summary>
  108. /// 上课时间
  109. /// </summary>
  110. [DisplayName("上课时间")]
  111. public string time_starTime_endTime
  112. {
  113. get
  114. {
  115. return TimesSegmentName + "(" + StartDate + "-" + EndDate + ")";
  116. }
  117. }
  118. /// <summary>
  119. /// 创建人
  120. /// </summary>
  121. [DisplayName("创建人")]
  122. public Guid? CreateUserID { get; set; }
  123. /// <summary>
  124. /// 创建时间
  125. /// </summary>
  126. [DisplayName("创建时间")]
  127. public DateTime? CreateTime { get; set; }
  128. /// <summary>
  129. /// 更新人
  130. /// </summary>
  131. [DisplayName("更新人")]
  132. public Guid? ModifyUserID { get; set; }
  133. /// <summary>
  134. /// 更新时间
  135. /// </summary>
  136. [DisplayName("更新时间")]
  137. public DateTime? ModifyTime { get; set; }
  138. }
  139. }