private void btnIncluirPaciente_Click(object sender, EventArgs e) { var repositorio = new PacienteRepository(); var paciente = new Paciente() { Nome = txtBoxNome.Text, Telefone = txtBoxTelefone.Text }; try { repositorio.CadastrarPaciente(paciente); MessageBox.Show("Paciente cadastrado com sucesso !"); }catch (Exception ex) { MessageBox.Show("Erro ao cadastrar o paciente !" + ex.Message); } }