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)); }
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)); }
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); }
//Returns list of TutoringTimes which are available for booking public List <TutoringTime> GetAllAvailableTutoringTimes() { TutoringTimeDb ttDb = new TutoringTimeDb(); return(CompleteTeacherObjectsInList(ttDb.GetAllAvailableTutoringTimes())); }
public int RemoveTutoringTime(int teacherId, DateTime date, string time) { TutoringTimeDb ttDb = new TutoringTimeDb(); return(ttDb.RemoveTutoringTime(teacherId, date, time)); }
public List <TutoringTime> GetTtTimesByDate(DateTime date) { TutoringTimeDb ttDb = new TutoringTimeDb(); return(CompleteTeacherObjectsInList(ttDb.GetTtByDate(date))); }
public List <TutoringTime> GetTtTimesByTeacherId(int teacherId) { TutoringTimeDb ttDb = new TutoringTimeDb(); return(CompleteTeacherObjectsInList(ttDb.GetTtTimesByTeacherId(teacherId))); }