Beispiel #1
0
 public static void SaveLessonTime(LessonTime given_lesson_time)
 {
     if (!MyData.my_lessontimes_list.Exists(x => x.lesson_number == given_lesson_time.lesson_number))
     {
         MyData.my_lessontimes_list.Add(given_lesson_time);
     }
     else
     {
         throw new ArgumentException("lessontime already exists", "lesson_time.lesson_number");
     }
 }
Beispiel #2
0
 public static void DeleteLesson(DayOfWeek given_day, LessonTime given_lesson_time)
 {
     MyData.my_lessons_list.Remove(MyData.my_lessons_list.Find(x => x.day == given_day && x.lesson_time == given_lesson_time));
 }
Beispiel #3
0
 public static Lesson GetLesson(DayOfWeek day, LessonTime lesson_time)
 {
     return(MyData.my_lessons_list.Find(x => x.day == day && x.lesson_time == lesson_time));
 }
Beispiel #4
0
 public static void DeleteLessonTime(LessonTime time)
 {
     MyData.my_lessontimes_list.Remove(time);
 }