public EditOpeningViewModel(OpeningViewModel openingToEdit, OpeningService openingService, CompanyService companyService, QualificationService qualificationService) { OpeningToEdit = openingToEdit; _openingService = openingService; _companyService = companyService; _qualificationService = qualificationService; Companies = new ObservableCollection <DataLayer.EfClasses.Company>(companyService.GetCompanies()); Qualifications = new ObservableCollection <DataLayer.EfClasses.Qualification>(qualificationService.GetQualifications()); SelectedCompany = Companies.First(c => c.CompanyName == openingToEdit.CompanyName); SelectedQualification = Qualifications.First(c => c.QualificationCode == openingToEdit.Qualification); CopyEditableFields(openingToEdit); }
private void CopyEditableFields(OpeningViewModel openingToEdit) { StartingDate = Convert.ToDateTime(openingToEdit.StartingDate); EndDate = Convert.ToDateTime(openingToEdit.EndDate); Rate = openingToEdit.HourlyPay; }