public MiembroJuntaDirectiva buscarJunta(String cedula) { MiembroJuntaDirectiva entity = null; String consulta = "exec buscarJunta '" + cedula + "';"; ejecutarRetorno(consulta); if (dataset.Tables[0].Rows.Count == 0) { dataset.Dispose(); } else { entity = new MiembroJuntaDirectiva(); entity.setId(Convert.ToInt32(dataset.Tables[0].Rows[0]["id"].ToString())); entity.setNombre(dataset.Tables[0].Rows[0]["nombre"].ToString()); entity.setApellido(dataset.Tables[0].Rows[0]["apellido"].ToString()); entity.setCedula(dataset.Tables[0].Rows[0]["cedula"].ToString()); entity.setBancoId(Convert.ToInt32(dataset.Tables[0].Rows[0]["bancoId"].ToString())); entity.setAcciones(Convert.ToDouble(dataset.Tables[0].Rows[0]["acciones"].ToString())); entity.setCiudadNacimiento(Convert.ToInt32(dataset.Tables[0].Rows[0]["ciudad_id"].ToString())); entity.setFechaNacimiento(dataset.Tables[0].Rows[0]["fecha"].ToString()); entity.idDepartamento = Convert.ToInt32(dataset.Tables[0].Rows[0]["idDepto"].ToString()); entity.idPais = Convert.ToInt32(dataset.Tables[0].Rows[0]["idPais"].ToString()); } return(entity); }
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); }
public String solicitudGuardar(Int32 id, double acciones, String nombre, String apellido, String cedula, String fechaNacimiento, Int32 ciudadNacimiento, Int32 bancoId) { MiembroJuntaDirectiva entity = new MiembroJuntaDirectiva(id, acciones, nombre, apellido, cedula, fechaNacimiento, ciudadNacimiento, bancoId); return(juntaDAO.guardarJunta(entity)); }