private void CargarProveedor(string _codEmp) { try { BLL.Procedures._H_PROVEEDORES _prov = new BLL.Procedures._H_PROVEEDORES(); _prov.ItemList(_codEmp); Entities.Procedures._H_PROVEEDORES _itemSeleccion = new Entities.Procedures._H_PROVEEDORES(); //Limpia el combo this.comboBoxProveed.SuspendLayout(); this.comboBoxProveed.DataSource = null; this.comboBoxProveed.Items.Clear(); //Carga el item de Seleccion _itemSeleccion.pro_razsoc = "<Seleccione un Proveedor>"; _itemSeleccion.pro_cod = "0"; _prov.Result.Insert(0, _itemSeleccion); //Carga el combo this.comboBoxProveed.DisplayMember = BLL.Procedures._H_PROVEEDORES.ColumnNames.PRO_RAZSOC; this.comboBoxProveed.ValueMember = BLL.Procedures._H_PROVEEDORES.ColumnNames.PRO_COD; this.comboBoxProveed.DataSource = _prov.Result.ToArray(); this.comboBoxProveed.ResumeLayout(); this.comboBoxProveed.SelectedIndex = 0; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CargarProveedores() { try { BLL.Procedures._H_PROVEEDORES _prov = new BLL.Procedures._H_PROVEEDORES(); _prov.ItemList(Clases.Usuario.EmpresaLogeada.EmpresaIngresada.Trim()); Entities.Procedures._H_PROVEEDORES _itemSeleccion = new Entities.Procedures._H_PROVEEDORES(); //Limpia el combo this.comboBoxProveed.SuspendLayout(); this.comboBoxProveed.DataSource = null; this.comboBoxProveed.Items.Clear(); //Carga el item de Seleccion _itemSeleccion.pro_razsoc = "<Todos los Proveedores>"; _itemSeleccion.pro_cod = "0"; _prov.Result.Insert(0, _itemSeleccion); //Carga el combo this.comboBoxProveed.DisplayMember = BLL.Procedures._H_PROVEEDORES.ColumnNames.PRO_RAZSOC; this.comboBoxProveed.ValueMember = BLL.Procedures._H_PROVEEDORES.ColumnNames.PRO_COD; this.comboBoxProveed.DataSource = _prov.Result.ToArray(); this.comboBoxProveed.ResumeLayout(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CargarProveedor(string _codEmp) { try { BLL.Procedures._H_PROVEEDORES _prov = new BLL.Procedures._H_PROVEEDORES(); _prov.ItemList(_codEmp); Entities.Procedures._H_PROVEEDORES _itemSeleccion = new Entities.Procedures._H_PROVEEDORES(); //Limpia el combo this.comboBoxProveed.SuspendLayout(); this.comboBoxProveed.DataSource = null; this.comboBoxProveed.Items.Clear(); //Carga el item de Seleccion _itemSeleccion.pro_razsoc = "<Seleccione un Proveedor>"; _itemSeleccion.pro_cod = "0"; _prov.Result.Insert(0, _itemSeleccion); //*** auto complit //AutoCompleteStringCollection sourcename = new AutoCompleteStringCollection(); //sourcename.AddRange(_prov.Result.ToString()); //comboBoxProveed.AutoCompleteCustomSource = _prov.Result.ToArray(); //comboBoxProveed.AutoCompleteMode = AutoCompleteMode.Suggest; //comboBoxProveed.AutoCompleteSource = AutoCompleteSource.CustomSource; //Carga el combo this.comboBoxProveed.DisplayMember = BLL.Procedures._H_PROVEEDORES.ColumnNames.PRO_RAZSOC; this.comboBoxProveed.ValueMember = BLL.Procedures._H_PROVEEDORES.ColumnNames.PRO_COD; this.comboBoxProveed.DataSource = _prov.Result.ToArray(); this.comboBoxProveed.ResumeLayout(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }