Пример #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));
        }
Пример #2
0
        /// <summary>
        /// Convert PersonDAO into Person.
        /// </summary>
        /// <param name="personDAO">The PersonDAO to convert.</param>
        /// <returns>The Person.</returns>
        public static Person MapToPerson(PersonDAO personDAO)
        {
            RegistrationData data = new RegistrationData();

            Person person = data.FindOrCreatePerson(personDAO.Id);

            person.PersonId = personDAO.Id;
            person.Name     = personDAO.Name;

            return(person);
        }