private async Task SetExistingData() { FirstNameBox.Text = doctor.Name; LastNameBox.Text = doctor.LastName; WorkExperienceBox.Text = doctor.WorkExperience.ToString(); LocalAccountViewModel account = Mapping.Mapper.Map <LocalAccountViewModel>( await localAccountService.GetByPrimaryKey(new LocalAccount() { IdLocalAccount = doctor.IdLocalAccount })); AccountComboBox.Items.Add(account); AccountComboBox.SelectedItem = account; foreach (DoctorClinic doctorClinic in doctor.GetClinics()) { doctorUtil.PutClinicInList(Mapping.Mapper.Map <DoctorClinicViewModel>(doctorClinic)); } foreach (DoctorMedicalTitle mt in doctor.GetMedicalTitles()) { DoctorMedicalTitleViewModel model = Mapping.Mapper.Map <DoctorMedicalTitleViewModel>(mt); model.SetMedicalTitleName(); doctorUtil.PutMedicalTitleInList(model); } }
public void HasMedicalTitle(DatePicker gettingTitleDatePicker, RoutedEventHandler onDelete) { MedicalTitleViewModel medicalTitleViewModel = (MedicalTitleViewModel)MedicalTitleComboBox.SelectedItem; DateTime gettingTitleDate = gettingTitleDatePicker.SelectedDate.Value; DoctorMedicalTitleViewModel doctorMedicalTitleViewModel = new DoctorMedicalTitleViewModel() { IdMedicalTitle = medicalTitleViewModel.IdMedicalTitle, GettingTitleDate = gettingTitleDate, IdDoctor = doctor.IdDoctor }; doctorMedicalTitleViewModel.SetMedicalTitleName(); doctor.GetMedicalTitles().Add(Mapping.Mapper.Map <DoctorMedicalTitle>(doctorMedicalTitleViewModel)); PutMedicalTitleInList(doctorMedicalTitleViewModel, onDelete); MedicalTitleComboBox.Items.Remove(medicalTitleViewModel); gettingTitleDatePicker.SelectedDate = null; }
private async void InitializeClinicsAndTitles() { NameBox.Text = doctor.Name; LastNameBox.Text = doctor.LastName; WorkExperinceBox.Text = doctor.WorkExperience.ToString(); AccountComboBox.SelectedItem = Mapping.Mapper.Map <LocalAccountViewModel>(await localAccountService.GetByPrimaryKey(new LocalAccount() { IdLocalAccount = doctor.IdLocalAccount })); foreach (DoctorClinic doctorClinic in doctor.GetClinics()) { var model = Mapping.Mapper.Map <DoctorClinicViewModel>(doctorClinic); doctorClinicsAndTitlesHelper.PutClinicInList(model, DeleteClinicButton_Click); } foreach (DoctorMedicalTitle mt in doctor.GetMedicalTitles()) { var model = Mapping.Mapper.Map <DoctorMedicalTitleViewModel>(mt); model.SetMedicalTitleName(); doctorClinicsAndTitlesHelper.PutMedicalTitleInList(model, DeleteMedicalTitleButton_Click); } }