Exemple #1
0
        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 WorkInClinic(DatePicker sinceDatePicker, DatePicker untilDatePicker, RoutedEventHandler onDelete)
        {
            ClinicViewModel       clinicViewModel       = ClinicComboBox.SelectedItem as ClinicViewModel;
            DateTime              since                 = sinceDatePicker.SelectedDate.Value;
            DateTime?             until                 = untilDatePicker.SelectedDate != null ? untilDatePicker.SelectedDate : null;
            DoctorClinicViewModel doctorClinicViewModel = new DoctorClinicViewModel()
            {
                IdClinic  = clinicViewModel.IdClinic,
                Since     = since,
                UntilDate = until,
                IdDoctor  = doctor.IdDoctor
            };

            doctor.GetClinics().Add(Mapping.Mapper.Map <DoctorClinic>(doctorClinicViewModel));
            PutClinicInList(doctorClinicViewModel, onDelete);
            untilDatePicker.SelectedDate = null;
            sinceDatePicker.SelectedDate = null;
            ClinicComboBox.SelectedItem  = null;
        }
Exemple #3
0
        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);
            }
        }