BaseWorkTimeView.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.ViewModel.Cache;
  6. namespace EMIS.ViewModel.CalendarManage
  7. {
  8. public class BaseWorkTimeView
  9. {
  10. /// <summary>
  11. /// 节次
  12. /// </summary>
  13. public int StartTimes { get; set; }
  14. public int EndTimes { get; set; }
  15. public string Times
  16. {
  17. get
  18. {
  19. return StartTimes.ToString() + "-" + EndTimes.ToString();
  20. }
  21. }
  22. /// <summary>
  23. /// 时间节段
  24. /// </summary>
  25. public int TimesSegment { get; set; }
  26. /// <summary>
  27. /// TimesSegment
  28. /// </summary>
  29. public string TimesSegmentName
  30. {
  31. get
  32. {
  33. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_TimesSegment.ToString())
  34. .Where(x => x.Value == TimesSegment)
  35. .Select(x => x.Name).FirstOrDefault();
  36. }
  37. }
  38. /// <summary>
  39. /// 开始时间(小时)
  40. /// </summary>
  41. public int StartHour { get; set; }
  42. /// <summary>
  43. /// 开始时间(分钟)
  44. /// </summary>
  45. public int StartMinutes { get; set; }
  46. /// <summary>
  47. /// 结束时间(小时)
  48. /// </summary>
  49. public int EndHour { get; set; }
  50. /// <summary>
  51. /// 结束时间(分钟)
  52. /// </summary>
  53. public int EndMinutes { get; set; }
  54. public int Workhours
  55. {
  56. get
  57. {
  58. return EndTimes - StartTimes + 1;
  59. }
  60. }
  61. }
  62. }