Example #1
0
        public AddCourseResults AddCourse(Course course)
        {
            // Check to see if the student is already enrolled in the course
            if (_courses.Contains(course))
                return AddCourseResults.AlreadyEnrolled;
            // Check to see if the course exceeds the students alloted hours
            if ((course.WeeklyHours + CurrentEnrolledHours) > MaxWeeklyHours)
                return AddCourseResults.OverHours;
            // Add the student to the course
            _courses.Add(course);

            // Return that everything has worked
            return AddCourseResults.Added;
        }
Example #2
0
 public bool DelCourse(Course course)
 {
     if (!_courses.Contains(course)) return false;
     _courses.Remove(course);
     return true;
 }