Exemple #1
0
        public int RegisterBooking(int childId, int tutoringTimeId)
        {
            TutoringTime tt = new TutoringTime();

            tt.Id    = tutoringTimeId;
            tt.Child = new Child(childId);

            TutoringTimeDb ttDb = new TutoringTimeDb();

            return(ttDb.RegisterBooking(tt));
        }
Exemple #2
0
        public int CreateTutoringTime(DateTime date, int teacherId, string time)
        {
            TutoringTime tt = new TutoringTime();

            tt.Date    = date;
            tt.Teacher = new Teacher(teacherId);
            tt.Time    = time;

            TutoringTimeDb ttDb = new TutoringTimeDb();

            return(ttDb.CreateTutoringTime(tt));
        }
Exemple #3
0
        public TutoringTime GetTtTimesByTime(DateTime date, string time, int teacherId)
        {
            TutoringTimeDb ttDb = new TutoringTimeDb();

            //Constructs and adds complete Teacher object to TutoringTime
            //Returns improved object
            PersonCtrl   pCtrl      = new PersonCtrl();
            TutoringTime tt         = ttDb.GetTtTimesByTime(date, time, teacherId);
            TutoringTime completeTt = new TutoringTime();

            completeTt = tt;
            if (tt != null)
            {
                completeTt.Teacher = (Teacher)pCtrl.GetPerson(teacherId);
            }
            return(completeTt);
        }
Exemple #4
0
        //Returns list of TutoringTimes which are available for booking
        public List <TutoringTime> GetAllAvailableTutoringTimes()
        {
            TutoringTimeDb ttDb = new TutoringTimeDb();

            return(CompleteTeacherObjectsInList(ttDb.GetAllAvailableTutoringTimes()));
        }
Exemple #5
0
        public int RemoveTutoringTime(int teacherId, DateTime date, string time)
        {
            TutoringTimeDb ttDb = new TutoringTimeDb();

            return(ttDb.RemoveTutoringTime(teacherId, date, time));
        }
Exemple #6
0
        public List <TutoringTime> GetTtTimesByDate(DateTime date)
        {
            TutoringTimeDb ttDb = new TutoringTimeDb();

            return(CompleteTeacherObjectsInList(ttDb.GetTtByDate(date)));
        }
Exemple #7
0
        public List <TutoringTime> GetTtTimesByTeacherId(int teacherId)
        {
            TutoringTimeDb ttDb = new TutoringTimeDb();

            return(CompleteTeacherObjectsInList(ttDb.GetTtTimesByTeacherId(teacherId)));
        }