private void btnSalvar_Click(object sender, EventArgs e) { if (this.comando == "editar") { Modelo.Controle controle = new Modelo.Controle(); controle.AtualizarPacienteEndereco(txbCep.Text, txbRua.Text, txbNumero.Text, txbComplemento.Text, txbBairro.Text, txbEstado.Text, txbCidade.Text, this.idPacienteEndereco); if (controle.ToString().Equals("")) { MessageBox.Show("Atualização ok"); this.Close(); } } if (this.comando == "inserir") { Modelo.Controle controle = new Modelo.Controle(); controle.AdicionarPacienteEndereco(txbCep.Text, txbRua.Text, txbNumero.Text, txbComplemento.Text, txbBairro.Text, txbEstado.Text, txbCidade.Text, this.idPacienteEndereco); if (controle.ToString().Equals("")) { MessageBox.Show("Cadastro OK"); this.comando = "editar"; this.Close(); } } }