private void tBCedula_KeyPress(object sender, KeyPressEventArgs e) { if ((int)e.KeyChar == (int)Keys.Enter) { String cedula = tBCedula.Text; if (cedula.Length != 0) { MiembroJuntaDirectiva junta = juntaControlador.solicitudBuscar(cedula); if (junta != null) { cBPais.SelectedValue = junta.idPais; cBDepartamento.SelectedValue = junta.idDepartamento; cBCiudad.SelectedValue = junta.getCiudadNacimiento(); tBNombre.Text = junta.getNombre(); tBApellido.Text = junta.getApellido(); tBacciones.Text = junta.getAcciones().ToString(); dTPFecha.Text = junta.getFechaNacimiento(); aux = junta.getId(); habilitarCampos(); btnGuardar.Enabled = false; btnEditar.Enabled = true; btnEliminar.Enabled = true; } else { MessageBox.Show("El usuario no existe, por favor adicionalo"); habilitarCampos(); btnGuardar.Enabled = true; btnEditar.Enabled = false; btnEliminar.Enabled = false; } } } }
public String guardarJunta(MiembroJuntaDirectiva entity) { String consulta = "exec guardarJunta " + entity.getId() + ",'" + entity.getCedula() + "','" + entity.getNombre() + "','" + entity.getApellido() + "'," + entity.getAcciones() + ",'" + entity.getFechaNacimiento() + "'," + entity.getCiudadNacimiento() + "," + entity.getBancoId() + ";"; ejecutarRetorno(consulta); String info = dataset.Tables[0].Rows[0]["respuesta"].ToString(); return(info); }