Exemple #1
0
        public static ScheduleDAO MapToScheduleDAO(Schedule schedule)
        {
            var s = new ScheduleDAO();

            s.Id     = schedule.ScheduleId;
            s.Person = PersonMapper.MapToPersonDAO(schedule.Person);
            s.Course = CourseMapper.MapToCourseDAO(schedule.Course);
            s.Active = schedule.Active;

            return(s);
        }
        public static Course MapToCourse(CourseDAO course)
        {
            var c = new Course();

            c.CourseId   = course.Id;
            c.Title      = course.Title;
            c.Department = course.Department;
            c.Professor  = PersonMapper.MapToPerson(course.Professor).PersonId;
            c.StartTime  = course.StartTime;
            c.EndTime    = course.EndTime;
            c.Capacity   = course.Capacity;
            c.Credit     = course.Credit;
            c.Active     = course.Active;

            return(c);
        }
Exemple #3
0
        public bool AddPerson(PersonDAO person)
        {
            var p = PersonMapper.MapToPerson(person);

            return(db.AddPerson(p));
        }
Exemple #4
0
        public bool RemoveStudent(PersonDAO student)
        {
            var p = PersonMapper.MapToPerson(student);

            return(db.RemoveStudent(p));
        }