/// <summary>Deletes a <see cref="Course"/>.</summary> /// <param name="deleteCourse"><see cref="Course"/> to be deleted</param> public static void DeleteCourse(Course deleteCourse) { // if a course is deleted, all classes that teach it need to be deleted // all teachers who teach a class with that course need to have that class deleted // all students enrolled in a class with that course need to have that class deleted JSONInteraction.DeleteCourse(deleteCourse); foreach (SchoolClass cls in AllClasses) { if (cls.Course == deleteCourse) { DeleteClass(cls); } } AllCourses.Remove(deleteCourse); }