private void CargarComboBoxes() { var dDireccion = new DDireccion(); DireccionComboBox.DataSource = null; DireccionComboBox.DataSource = dDireccion.SelectDirecciones(); DireccionComboBox.DisplayMember = "Direccion"; DireccionComboBox.ValueMember = "CodDir"; }
public FrmEditarCliente(Clientes owner) { _owner = owner; InitializeComponent(); this.Id_Cliente = Convert.ToInt32(_owner.ObtenerSeleccion().Cells["ID"].Value); this.textBoxNombre.Text = Convert.ToString(_owner.ObtenerSeleccion().Cells["NOMBRE"].Value); this.textBoxApellido.Text = Convert.ToString(_owner.ObtenerSeleccion().Cells["APELLIDO"].Value); this.textBoxCuil.Text = Convert.ToString(_owner.ObtenerSeleccion().Cells["CUIL"].Value); this.textBoxRazonSocial.Text = Convert.ToString(_owner.ObtenerSeleccion().Cells["RAZON SOCIAL"].Value); this.textBoxCuit.Text = Convert.ToString(_owner.ObtenerSeleccion().Cells["CUIT"].Value); this.textBoxTelFijo.Text = Convert.ToString(_owner.ObtenerSeleccion().Cells["TELEFONO FIJO"].Value); this.textBoxTelMovil.Text = Convert.ToString(_owner.ObtenerSeleccion().Cells["TELEFONO MOVIL"].Value); this.textBoxEmail.Text = Convert.ToString(_owner.ObtenerSeleccion().Cells["EMAIL"].Value); int tipoCliente = Convert.ToInt32(_owner.ObtenerSeleccion().Cells["TIPO CLIENTE"].Value); if (tipoCliente == 1) { radioButtonPersona.Checked = true; } else { radioButtonEmpresa.Checked = true; } idDireccion = Convert.ToInt32(_owner.ObtenerSeleccion().Cells["ID DIRECCION"].Value); DDireccion direccion = NDireccion.BuscarPorId(idDireccion); this.textBoxCalle.Text = direccion.Calle; this.textBoxNumero.Text = direccion.Numero.ToString(); this.textBoxPiso.Text = direccion.Piso; this.textBoxDepto.Text = direccion.Departamento; this.textBoxCiudad.Text = direccion.Ciudad; this.textBoxProvincia.Text = direccion.Provincia; this.textBoxPais.Text = direccion.Pais; this.textBoxCP.Text = direccion.Codigo_Postal.ToString(); //recuperar datos de direccion y mostrarlos }