private void Load_Consulta(int consultaId) { // preencher dropdown medico MedicoController medicoController = new MedicoController(); cbMedico.ItemsSource = medicoController.readMedicos(); // preencher dropdown paciente PacienteController pacienteController = new PacienteController(); cbPaciente.ItemsSource = pacienteController.readPacientes(); // preencher dropdown secretaria SecretariaController secretariaController = new SecretariaController(); cbSecretaria.ItemsSource = secretariaController.readSecretaria(); ConsultaController consultaController = new ConsultaController(); Consulta consulta = consultaController.readConsulta(consultaId); txtId.Text = consulta.Id.ToString(); cbMedico.SelectedValue = consulta.Medico.MedicoId; cbPaciente.SelectedValue = consulta.Paciente.PacienteId; cbSecretaria.SelectedValue = consulta.Secretaria.SecretariaId; dpConsulta.SelectedDate = consulta.Hora; }
private void Window_Loaded(object sender, RoutedEventArgs e) { // preencher dropdown medico MedicoController medicoController = new MedicoController(); cbMedico.ItemsSource = medicoController.readMedicos(); // preencher dropdown paciente PacienteController pacienteController = new PacienteController(); cbPaciente.ItemsSource = pacienteController.readPacientes(); // preencher dropdown secretaria SecretariaController secretariaController = new SecretariaController(); cbSecretaria.ItemsSource = secretariaController.readSecretaria(); }