private void btnguardar_Click(object sender, EventArgs e) { // insertar if (editar == false) { try { dominio.InsertHab(txtcedula.Text, txtnombre.Text, txtapt.Text, txtmanzana.Text, txtedificio.Text); MessageBox.Show(" El registro fue existoso..."); mostrarhabitante(); limpiar(); } catch (Exception ex) { MessageBox.Show(" error..." + ex); } } //editar if (editar == true) { try { dominio.Edit(txtcedula.Text, txtnombre.Text, txtapt.Text, txtmanzana.Text, txtedificio.Text, id); MessageBox.Show(" Los Cambios fueron hechos..."); mostrarhabitante(); limpiar(); editar = false; } catch (Exception ex) { MessageBox.Show(" error..." + ex); } } }