ScheduleAdjustmentEditView.cs 4.6 KB

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