Beispiel #1
0
        public bool AddCourse(CourseDAO course)
        {
            var c = CourseMapper.MapToCourse(course);
            var p = db.GetPerson(course.Professor.Id);

            return(db.AddCourse(c, p));
        }
Beispiel #2
0
        public CourseDAO GetCourse(int cid)
        {
            var course = db.GetCourse(cid);
            var c      = CourseMapper.MapToCourseDAO(course);

            return(c);
        }
Beispiel #3
0
        public bool DropCourse(CourseDAO course, PersonDAO person)
        {
            var c = CourseMapper.MapToCourse(course);
            var p = PersonMapper.MapToPerson(person);

            return(db.DropCourse(c, p));
        }
Beispiel #4
0
        public List <CourseDAO> GetAllOpenCourses()
        {
            var c = new List <CourseDAO>();

            foreach (var course in db.GetAllOpenCourses())
            {
                c.Add(CourseMapper.MapToCourseDAO(course));
            }

            return(c);
        }
Beispiel #5
0
        public List <CourseDAO> GetStudentSchedule(PersonDAO person)
        {
            var c = new List <CourseDAO>();

            foreach (var course in db.GetStudentSchedule(PersonMapper.MapToPerson(person)))
            {
                c.Add(CourseMapper.MapToCourseDAO(course));
            }

            return(c);
        }
Beispiel #6
0
        public List <PersonDAO> GetEnrolledStudentsByCourse(CourseDAO course)
        {
            var p = new List <PersonDAO>();

            foreach (var person in db.GetEnrolledStudentsByCourse(CourseMapper.MapToCourse(course)))
            {
                p.Add(PersonMapper.MapToPersonDAO(person));
            }

            return(p);
        }
Beispiel #7
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);
        }
Beispiel #8
0
        public bool CancelCourse(CourseDAO course)
        {
            var c = CourseMapper.MapToCourse(course);

            return(db.CancelCourse(c));
        }
Beispiel #9
0
        public bool ModifyCourse(CourseDAO course, int newCapacity, int newStart, int newEnd)
        {
            var c = CourseMapper.MapToCourse(course);

            return(db.ModifyCourse(c, newCapacity, newStart, newEnd));
        }