private void UpdateForm() { var oldStudent = _studentForm.GetStudent(); var updatedStudent = _studentBll.GetStudent(oldStudent); _studentForm.LoadStudent(updatedStudent); _studentForm.LoadEnrolledCourses(updatedStudent.Courses.ToList()); var availableCourses = _courseBll.GetCourses(); foreach (var course in updatedStudent.Courses) { availableCourses.Remove(course); } _studentForm.LoadAvailableCourses(availableCourses); _studentForm.LoadStudentGrades(updatedStudent.Grades.ToList()); }