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; }
public AddStudyProgramViewModel(AddStudyProgramView view, StudyProgram editSP, IEventAggregator eventArgs) { this.editSP = editSP; this.view = view; this.eventArgs = eventArgs; Departments = new ObservableCollection <Department>(ServiceDataProvider.GetAllDepartments()); if (editSP != null) { Name = editSP.Name; DepartmentId = editSP.DepartmentId; SelffinancedPlaces = editSP.SelffinancedPlaces; BudgetPlaces = editSP.BudgetPlaces; Tuition = editSP.Tuition; } }
public DepartmentViewModel() { Departments = new ObservableCollection <Department>(ServiceDataProvider.GetAllDepartments()); ServiceDataProvider.AddDepartmentNotification += ServiceDataProvider_AddDepartmentNotification; }