using System; using System.Collections.Generic; using System.Linq; using System.Text; using EMIS.ViewModel.CacheManage; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using EMIS.Entities; using EMIS.ViewModel.EducationManagement; namespace EMIS.ViewModel.EducationSchedule { public class ScheduleStopEditView { public Guid? EducationSchedulingID { get; set; } public Guid? EducationSchedulingWeekNumID { get; set; } public Guid EducationMissionClassID { get; set; } public Guid? SchoolyearID { get; set; } public string EducationMissionClassName { get; set; } public Guid? CoursematerialID { get; set; } public string CourseCode { get; set; } public string CourseName { get; set; } public int? EducationMissionClassStartWeekNum { get; set; } public int? EducationMissionClassEndWeekNum { get; set; } public List EducationMissionClassWeekNumList { get { List weekList = new List(); for (var i = this.EducationMissionClassStartWeekNum; i <= this.EducationMissionClassEndWeekNum; i++) { weekList.Add(i); } return weekList; } } public Guid? UserID { get; set; } public string UserName { get; set; } public int? WeekNum { get; set; } public int? Weekday { get; set; } public string WeekdayDesc { get { return WeekDayView.GetWeekdayName(Weekday); } } public int? TimesSegment { get; set; } public string TimesSegmentDesc { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_TimesSegment.ToString()) .Where(x => x.Value == TimesSegment) .Select(x => x.Name).FirstOrDefault(); } } public Guid? CoursesTimeID { get; set; } public int? StartHour { get; set; } public int? StartMinutes { get; set; } public int? EndHour { get; set; } public int? EndMinutes { get; set; } [Required(ErrorMessage = "请填写要调整到星期几")] public int? ToWeekday { get; set; } [Required(ErrorMessage = "请填写要调整到哪一节")] public Guid? ToCoursesTimeID { get; set; } public string CoursesTimeName { get { return (StartHour ?? 0).ToString().PadLeft(2, '0') + ":" + (StartMinutes ?? 0).ToString().PadLeft(2, '0') + "-" + (EndHour ?? 0).ToString().PadLeft(2, '0') + ":" + (EndMinutes ?? 0).ToString().PadLeft(2, '0'); } } public int? ClassroomTypeID { get; set; } public string ClassroomTypeName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ClassroomType.ToString()) .Where(x => x.Value == ClassroomTypeID) .Select(x => x.Name).FirstOrDefault(); } } public int? ToClassroomTypeID { get; set; } public string ToClassroomTypeName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ClassroomType.ToString()) .Where(x => x.Value == ToClassroomTypeID) .Select(x => x.Name).FirstOrDefault(); } } public Guid? ClassroomID { get; set; } public string ClassroomName { get; set; } [Required(ErrorMessage = "请填写要调整后的教室")] public Guid? ToClassroomID { get; set; } public int? ToWeekNum { get; set; } public Guid? ToUserID { get; set; } public string CollegeName { get; set; } public IEnumerable TeacherList { get; set; } public string TeacherNames { get { string name = string.Empty; if (TeacherList != null) name = string.Join(",", TeacherList.Select(s => s.Name)); if (string.IsNullOrEmpty(name)) { return ""; } else { return name; } } } } }