ScheduleStopEditView.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.ViewModel.CacheManage;
  6. using System.ComponentModel;
  7. using System.ComponentModel.DataAnnotations;
  8. using EMIS.Entities;
  9. using EMIS.ViewModel.EducationManagement;
  10. namespace EMIS.ViewModel.EducationSchedule
  11. {
  12. public class ScheduleStopEditView
  13. {
  14. public Guid? EducationSchedulingID { get; set; }
  15. public Guid? EducationSchedulingWeekNumID { get; set; }
  16. public Guid EducationMissionClassID { get; set; }
  17. public Guid? SchoolyearID { get; set; }
  18. public string EducationMissionClassName { get; set; }
  19. public Guid? CoursematerialID { get; set; }
  20. public string CourseCode { get; set; }
  21. public string CourseName { get; set; }
  22. public int? EducationMissionClassStartWeekNum { get; set; }
  23. public int? EducationMissionClassEndWeekNum { get; set; }
  24. public List<int?> EducationMissionClassWeekNumList
  25. {
  26. get
  27. {
  28. List<int?> weekList = new List<int?>();
  29. for (var i = this.EducationMissionClassStartWeekNum; i <= this.EducationMissionClassEndWeekNum; i++)
  30. {
  31. weekList.Add(i);
  32. }
  33. return weekList;
  34. }
  35. }
  36. public Guid? UserID { get; set; }
  37. public string UserName { get; set; }
  38. public int? WeekNum { get; set; }
  39. public int? Weekday { get; set; }
  40. public string WeekdayDesc
  41. {
  42. get
  43. {
  44. return WeekDayView.GetWeekdayName(Weekday);
  45. }
  46. }
  47. public int? TimesSegment { get; set; }
  48. public string TimesSegmentDesc
  49. {
  50. get
  51. {
  52. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_TimesSegment.ToString())
  53. .Where(x => x.Value == TimesSegment)
  54. .Select(x => x.Name).FirstOrDefault();
  55. }
  56. }
  57. public Guid? CoursesTimeID { get; set; }
  58. public int? StartHour { get; set; }
  59. public int? StartMinutes { get; set; }
  60. public int? EndHour { get; set; }
  61. public int? EndMinutes { get; set; }
  62. [Required(ErrorMessage = "请填写要调整到星期几")]
  63. public int? ToWeekday { get; set; }
  64. [Required(ErrorMessage = "请填写要调整到哪一节")]
  65. public Guid? ToCoursesTimeID { get; set; }
  66. public string CoursesTimeName
  67. {
  68. get
  69. {
  70. return (StartHour ?? 0).ToString().PadLeft(2, '0')
  71. + ":"
  72. + (StartMinutes ?? 0).ToString().PadLeft(2, '0')
  73. + "-"
  74. + (EndHour ?? 0).ToString().PadLeft(2, '0')
  75. + ":"
  76. + (EndMinutes ?? 0).ToString().PadLeft(2, '0');
  77. }
  78. }
  79. public int? ClassroomTypeID { get; set; }
  80. public string ClassroomTypeName
  81. {
  82. get
  83. {
  84. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ClassroomType.ToString())
  85. .Where(x => x.Value == ClassroomTypeID)
  86. .Select(x => x.Name).FirstOrDefault();
  87. }
  88. }
  89. public int? ToClassroomTypeID { get; set; }
  90. public string ToClassroomTypeName
  91. {
  92. get
  93. {
  94. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ClassroomType.ToString())
  95. .Where(x => x.Value == ToClassroomTypeID)
  96. .Select(x => x.Name).FirstOrDefault();
  97. }
  98. }
  99. public Guid? ClassroomID { get; set; }
  100. public string ClassroomName { get; set; }
  101. [Required(ErrorMessage = "请填写要调整后的教室")]
  102. public Guid? ToClassroomID { get; set; }
  103. public int? ToWeekNum { get; set; }
  104. public Guid? ToUserID { get; set; }
  105. public string CollegeName { get; set; }
  106. public IEnumerable<MissionClassTeacherView> TeacherList { get; set; }
  107. public string TeacherNames
  108. {
  109. get
  110. {
  111. string name = string.Empty;
  112. if (TeacherList != null)
  113. name = string.Join(",", TeacherList.Select(s => s.Name));
  114. if (string.IsNullOrEmpty(name))
  115. {
  116. return "";
  117. }
  118. else
  119. {
  120. return name;
  121. }
  122. }
  123. }
  124. }
  125. }