private void CreateTeacher() { Teacher newTeacher = new Teacher(); TeacherEditorWindow target = new TeacherEditorWindow(newTeacher) { Owner = this.SourceWindow }; SwitchWindows(target, true); this.TeacherList = new ObservableCollection <Teacher>(_contextDal.FindAll()); }
private void EditTeacher(object param) { TeacherEditorWindow target = new TeacherEditorWindow((Teacher)((DataGrid)param).SelectedItem) { Owner = this.SourceWindow }; SwitchWindows(target, true); this.TeacherList = new ObservableCollection <Teacher>(_contextDal.FindAll()); this.SessionGroupList = ReloadActiveSessionGroupList(); this.TeamList = ReloadActiveTeamList(); }
public TeacherEditorWindowViewModel(TeacherEditorWindow teacherEditorWindow, Teacher teacher) { this.SourceWindow = teacherEditorWindow; this._contextDal = new TeacherDAL(); UsersDal = new UsersDAL(); this.SelectedTeacher = teacher; this.SaveCommand = new RelayCommand(SaveTeacher, CanExecute); if (teacher.Users == null) { teacher.Users = new Users(); } }