public Dictionary <int, string> GetAllLessons() { Dictionary <int, string> categoryDictionary = new Dictionary <int, string>(); foreach (var lesson in lessonManager.GetAllLessons()) { categoryDictionary.Add(lesson.ID, lesson.Name); } return(categoryDictionary); }
private void LoadLessons() { foreach (Lesson lesson in LessonManager.GetAllLessons()) { if (lesson.day == DayOfWeek.Monday) { monday_list.Add(lesson); } else if (lesson.day == DayOfWeek.Tuesday) { tuesday_list.Add(lesson); } else if (lesson.day == DayOfWeek.Wednesday) { wednesday_list.Add(lesson); } else if (lesson.day == DayOfWeek.Thursday) { thursday_list.Add(lesson); } else if (lesson.day == DayOfWeek.Friday) { friday_list.Add(lesson); } } days_list.Add(monday_list); days_list.Add(tuesday_list); days_list.Add(wednesday_list); days_list.Add(thursday_list); days_list.Add(friday_list); foreach (List <Lesson> day_list in days_list) { day_list.Sort((x, y) => x.lesson_time.lesson_number.CompareTo(y.lesson_time.lesson_number)); } selected_listview = lvw_Lessons_Monday; }
public List <Lesson> GetAllLessons() { return(lessonManager.GetAllLessons()); }