Пример #1
0
 public void AddTeacher(Teacher teacher)
 {
     foreach (var subject in teacher.Subjects)
     {
         this.unitOfWork.SubjectRepository.Update(subject);
     }
     this.unitOfWork.TeacherRepository.Add(teacher);
     this.SaveTeacher();
 }
Пример #2
0
 public void UpdateProfile(Teacher teacher)
 {
     foreach (var subject in teacher.Subjects)
     {
         var temp = this.unitOfWork.SubjectRepository.GetById(subject.Id);
         this.unitOfWork.SubjectRepository.Update(temp);
     }
     this.unitOfWork.TeacherRepository.Update(teacher);
     this.unitOfWork.SaveChanges();
 }
Пример #3
0
 public void RemoveTeacher(Teacher teacher)
 {
     this.unitOfWork.TeacherRepository.Delete(teacher);
     this.SaveTeacher();
 }