protected void cboLineaModeloPoput_OnSelectedIndexChanged(object sender, EventArgs e) { NegocioLineaBL oNegocioLineaBL = new NegocioLineaBL(); oNegocioLineaBL.ErrorEvent += new NegocioLineaBL.ErrorDelegate(Master.Transaction_ErrorEvent); Int32 idNegocioLinea; Int32.TryParse(this.cboLineaModeloPoput.SelectedValue.Trim(), out idNegocioLinea); try { this.cboLineaComercialModeloPoput.Items.Clear(); this.cboLineaComercialModeloPoput.DataSource = oNegocioLineaBL.GetListaLineaComercial(idNegocioLinea); this.cboLineaComercialModeloPoput.DataTextField = "Nom_linea"; this.cboLineaComercialModeloPoput.DataValueField = "nid_cod_tipo_linea"; this.cboLineaComercialModeloPoput.DataBind(); this.cboLineaComercialModeloPoput.Items.Insert(0, new ListItem()); this.cboLineaComercialModeloPoput.Items[0].Text = ConstanteBE.OBJECTO_SELECCIONE; this.cboLineaComercialModeloPoput.Items[0].Value = String.Empty; this.cboLineaModeloPoput.Attributes.Add("Enabled", "true"); this.cboLineaComercialModeloPoput.Attributes.Add("Enabled", "true"); } catch (Exception ex) { Master.Web_ErrorEvent(this, ex); } }
public void cargarCombo(String opcion) { NegocioLineaBL oNegocioLineaBL = new NegocioLineaBL(); cboLinea.DataSource = oNegocioLineaBL.GetListaLineaImportacion(_cod_negocio); cboLinea.DataValueField = "nid_negocio_linea"; cboLinea.DataTextField = "nom_linea"; cboLinea.DataBind(); String objeto = ConstanteBE.OBJECTO_TODOS; if (!opcion.Equals(String.Empty)) { if (opcion.Equals(ConstanteBE.OBJECTO_TIPO_SELECCIONE)) { objeto = ConstanteBE.OBJECTO_SELECCIONE; } } this.cboLinea.Items.Insert(0, new ListItem(objeto, String.Empty)); //this.cboLinea.SelectedValue = String.Empty; }