Beispiel #1
0
        public bool ScheduleCourse(int courseId, int professorId, int scheduleId, short capacity)
        {
            Course   course    = data.FindOrCreateCourse(courseId);
            Schedule schedule  = data.FindOrCreateSchedule(scheduleId);
            Person   professor = data.FindOrCreatePerson(professorId);

            return(data.ScheduleCourse(course, schedule, professor, capacity));
        }
Beispiel #2
0
        /// <summary>
        /// Convert CourseDAO into Course.
        /// </summary>
        /// <param name="courseDAO">The CourseDAO to convert.</param>
        /// <returns>The Course.</returns>
        public static Course MapToCourse(CourseDAO courseDAO)
        {
            RegistrationData data = new RegistrationData();

            Course course = data.FindOrCreateCourse(courseDAO.Id);

            course.CourseId     = courseDAO.Id;
            course.Title        = courseDAO.Title;
            course.Department   = MapToDepartment(courseDAO.CourseDepartment);
            course.DepartmentId = courseDAO.CourseDepartment.Id;
            course.Credit       = courseDAO.Credit;

            return(course);
        }