private void btnAdicionar_Click(object sender, EventArgs e) { switch (tabCadastrar.SelectedTab.Name) { case "tabConsulta": var consultaHelper = new ConsultaHelper(this); consultaHelper.cadastrarConsulta(); break; case "tabPaciente": var pacienteHelper = new PacienteHelper(this); pacienteHelper.cadastrarPaciente(); break; case "tabMedico": var medicoHelper = new MedicoHelper(this); medicoHelper.cadastrarMedico(); break; case "tabConvenio": var convenioHelper = new ConvenioHelper(this); convenioHelper.cadastrarConvenio(); break; } }
private void carregaConvenio(object sender, EventArgs e) { try { var convenio = new ConvenioHelper(this); convenio.carregaConvenios(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }