private void CargarProductosBejerman() { try { BLL.Procedures.H_ARTICULOSDEPOSITO _prod = new BLL.Procedures.H_ARTICULOSDEPOSITO(); Entities.Procedures.H_ARTICULOSDEPOSITO _itemSeleccion = new Entities.Procedures.H_ARTICULOSDEPOSITO(); //Limpia el combo this.comboBoxProductos.SuspendLayout(); this.comboBoxProductos.DataSource = null; this.comboBoxProductos.Items.Clear(); //Carga el item de Seleccion _itemSeleccion.art_descgen = "<Seleccione un Artículo>"; _itemSeleccion.art_codgen = "0"; _ItemsArticulos = _prod.ItemList(); //Carga la lista para llenar el combo; _ItemsArticulos.Insert(0, _itemSeleccion); //Carga el combo this.comboBoxProductos.DisplayMember = BLL.Procedures.H_ARTICULOSDEPOSITO.ColumnNames.ART_DESCGEN; this.comboBoxProductos.ValueMember = BLL.Procedures.H_ARTICULOSDEPOSITO.ColumnNames.ART_CODGEN; this.comboBoxProductos.DataSource = _ItemsArticulos; this.comboBoxProductos.ResumeLayout(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CargarProductos() { try { BLL.Procedures.H_ARTICULOSDEPOSITO _prod = new BLL.Procedures.H_ARTICULOSDEPOSITO(); Entities.Procedures.H_ARTICULOSDEPOSITO _itemSeleccion = new Entities.Procedures.H_ARTICULOSDEPOSITO(); _ItemsArtDep = _prod.ItemList(); var q = (dynamic)null; q = (from item in _ItemsArtDep where item.subrubro.Contains("DE") || item.subrubro.Contains("DM") || item.subrubro.Contains("DMP") || item.subrubro.Contains("DRH") || item.subrubro.Contains("MEDI") select item).ToList <Entities.Procedures.H_ARTICULOSDEPOSITO>(); //Limpia el combo this.comboBoxProductos.SuspendLayout(); this.comboBoxProductos.DataSource = null; this.comboBoxProductos.Items.Clear(); //Carga el item de Seleccion _itemSeleccion.art_descgen = "<Seleccione un Artículo>"; _itemSeleccion.art_codgen = "0"; //_ItemsArtDep = _prod.ItemList(); q.Insert(0, _itemSeleccion); //Carga el combo this.comboBoxProductos.DisplayMember = BLL.Procedures.H_ARTICULOSDEPOSITO.ColumnNames.ART_DESCGEN; this.comboBoxProductos.ValueMember = BLL.Procedures.H_ARTICULOSDEPOSITO.ColumnNames.ART_CODGEN; this.comboBoxProductos.DataSource = q; this.comboBoxProductos.ResumeLayout(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void comboBoxrubro_SelectedIndexChanged(object sender, EventArgs e) { //MUESTRA LOS ARTICULOS DE ESE RUBRO try { var q = (dynamic)null; q = (from item in _articulosItem where item.rubro.Contains(this.comboBoxrubro.SelectedValue.ToString()) select item).ToList <Entities.Procedures.H_ARTICULOSDEPOSITO>(); //cargo el combo con los articulos filtrados por este rubro Entities.Procedures.H_ARTICULOSDEPOSITO _itemSeleccion = new Entities.Procedures.H_ARTICULOSDEPOSITO(); //Limpia el combo this.comboBoxProductoxRubro.SuspendLayout(); this.comboBoxProductoxRubro.DataSource = null; this.comboBoxProductoxRubro.Items.Clear(); //Carga el item de Seleccion _itemSeleccion.art_descgen = "<Seleccione un Artículo>"; _itemSeleccion.art_codgen = "0"; q.Insert(0, _itemSeleccion); //Carga el combo this.comboBoxProductoxRubro.DisplayMember = BLL.Procedures.H_ARTICULOSDEPOSITO.ColumnNames.ART_DESCGEN; this.comboBoxProductoxRubro.ValueMember = BLL.Procedures.H_ARTICULOSDEPOSITO.ColumnNames.ART_CODGEN; this.comboBoxProductoxRubro.DataSource = q; this.comboBoxProductoxRubro.SelectedIndex = 0; this.comboBoxProductoxRubro.ResumeLayout(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }