예제 #1
0
        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);
        }
예제 #2
0
 private void CopyEditableFields(OpeningViewModel openingToEdit)
 {
     StartingDate = Convert.ToDateTime(openingToEdit.StartingDate);
     EndDate      = Convert.ToDateTime(openingToEdit.EndDate);
     Rate         = openingToEdit.HourlyPay;
 }