public AddStudentViewModel(AddStudentView view, Student editStudent, IEventAggregator eventAggr) { this.view = view; this.editStudent = editStudent; this.eventAggr = eventAggr; if (editStudent != null) { StudentName = editStudent.NameAndSurname; StudyProgramId = editStudent.StudyProgramId; DepartmentId = editStudent.DepartmentId; Address = editStudent.Address; Phone = editStudent.Phone; BirthPlace = editStudent.BirthPlace; BirthDate = editStudent.BirthDate; StudyYear = editStudent.StudyYear; Balance = editStudent.Balance; Username = editStudent.Username; Password = editStudent.Password; } StudyPrograms = new ObservableCollection <StudyProgram>(ServiceDataProvider.GetAllStudyPrograms()); Departments = ServiceDataProvider.GetAllDepartments(); view.cbxDepartments.SelectionChanged += CbxDepartments_SelectionChanged; }
private AddStudentView Collect() { var model = new AddStudentView(); model.Classes = studentRepository.GetClasses(); return(model); }
private void AddStudentExecute() { AddStudentView addStudentView = new AddStudentView(); var flag = addStudentView.ShowDialog(); if (flag == false) { InitialList(); } }
private void ExecuteEdit(object p) { if (p != null && p is Student) { var student = p as Student; AddStudentView studentView = new AddStudentView(student); studentView.ShowDialog(); } }
private void OnAddStudent() { //StudentCollection.Add(new StudentModel {LastName="fgh",FirstName="klwe" }); AddStudentView studentView = new AddStudentView() { DataContext = new AddStudentViewModel(AddStudentInCollection) }; studentView.ShowDialog(); }
public void AddStudentView() { AddStudentView addstudentview = new AddStudentView(); addstudentview.ShowDialog(); }
private void ExecuteOpening(object p) { AddStudentView studentView = new AddStudentView(); studentView.ShowDialog(); }