private void fillUnidades(DropDownList combo) { combo.Enabled = false; combo.Items.Clear(); combo.AppendDataBoundItems = true; combo.DataSource = psvm.getAllUnidades(); combo.DataValueField = "UNI_COD"; combo.DataTextField = "UNI_NOM"; combo.DataBind(); if (combo.Items.Count > 0) { combo.Enabled = true; comboUnidad_SelectedIndexChanged(combo, null); } else { combo.Enabled = false; combo.Items.Add(new ListItem("--AƱadir Unidad--", "")); ComboArea.Enabled = false; ComboArea.Items.Clear(); ComboArea.AppendDataBoundItems = true; ComboArea.Items.Add(new ListItem("--Ninguno--", "")); ComboArea.DataBind(); comboCargo.Enabled = false; comboCargo.Items.Clear(); comboCargo.AppendDataBoundItems = true; comboCargo.Items.Add(new ListItem("--Ninguno--", "")); comboCargo.DataBind(); } }
private void fillAreas() { ComboArea.Enabled = false; ComboArea.Items.Clear(); ComboArea.AppendDataBoundItems = true; ComboArea.DataSource = psvm.getAreasByUnidad(Convert.ToInt32(comboUnidad.SelectedItem.Value)); ComboArea.DataTextField = "ARE_NOM"; ComboArea.DataValueField = "ARE_COD"; ComboArea.DataBind(); if (ComboArea.Items.Count > 0) { ComboArea.Enabled = true; ComboArea_SelectedIndexChanged(ComboArea, null); } else { ComboArea.Enabled = false; ComboArea.Items.Clear(); ComboArea.AppendDataBoundItems = true; ComboArea.Items.Add(new ListItem("--Ninguno--", "")); ComboArea.DataBind(); comboCargo.Enabled = false; comboCargo.Items.Clear(); comboCargo.AppendDataBoundItems = true; comboCargo.Items.Add(new ListItem("--Ninguno--", "")); comboCargo.DataBind(); } }
public void Area() { ComboArea.DataSource = cnUsuarios.CargarAreas(); ComboArea.DataValueField = "Descripcion"; ComboArea.DataBind(); ComboArea.Items.Insert(0, new ListItem("Seleccionar")); }
public void Area() { //Codigo para el area se llena el comboArea ComboArea.DataSource = registroDoc.CargarArea(); ComboArea.DataValueField = "Descripcion"; ComboArea.DataBind(); ComboArea.Items.Insert(0, "Selecciona"); }