TimeSegmentView.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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.ExaminationManage
  8. {
  9. public class TimeSegmentView
  10. {
  11. public Guid? TimeSegmentID { get; set; }
  12. [DisplayName("是否补考时间")]
  13. public bool IsForResit { get; set; }
  14. public string IsForResitDesc { get { return IsForResit ? "是" : "否"; } }
  15. [DisplayName("考试日期")]
  16. public DateTime ExaminationDate { get; set; }
  17. public string ExaminationDateString
  18. {
  19. get
  20. {
  21. return ExaminationDate.ToString("yyyy-MM-dd");
  22. }
  23. }
  24. [DisplayName("开始时间")]
  25. public TimeSpan StartTime { get; set; }
  26. public string StartTimeString
  27. {
  28. get
  29. {
  30. return StartTime.ToString(@"hh\:mm");
  31. }
  32. }
  33. [DisplayName("结束时间")]
  34. public TimeSpan EndTime { get; set; }
  35. public string EndTimeString
  36. {
  37. get
  38. {
  39. return EndTime.ToString(@"hh\:mm");
  40. }
  41. }
  42. public string TimeSegmentName
  43. {
  44. get
  45. {
  46. return ExaminationDate.ToString("yyyy-MM-dd")
  47. + " " + StartTime.ToString(@"hh\:mm")
  48. + "-" + EndTime.ToString(@"hh\:mm");
  49. }
  50. }
  51. }
  52. }