Esempio n. 1
0
 public static Teacher ToModel(this TeacherEditViewModel Model)
 {
     return(new Teacher()
     {
         ID = Model.ID,
         Name = Model.Name,
         BirthDate = Model.BirthDate
     });
 }
 public static Teacher ToModel(this TeacherEditViewModel EditModel)
 {
     return(new Teacher()
     {
         ID = EditModel.ID,
         Name = EditModel.Name,
         Email = EditModel.Email,
         Phone = EditModel.Phone,
     });
 }
        /// <summary>
        /// The methode AddTeacherCommand use to open a new edit to add the teacher in
        /// </summary>
        private void AddTeacher()
        {
            TeacherEditViewModel teacherEditViewModel = new TeacherEditViewModel();
            var editTeacher = new EditTeacher
            {
                DataContext = teacherEditViewModel
            };
            bool? didListChange = editTeacher.ShowDialog();

            if (didListChange == true)
            {
                addTeachersToPersons();
            }
        }