Example #1
0
        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());
        }
Example #2
0
        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();
        }
Example #3
0
 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();
     }
 }