Ejemplo n.º 1
0
 private void BindOption_Category()
 {
     this.listCategory.DataSource     = PE_DAL.GetAllCatalogSubject(true);
     this.listCategory.DataTextField  = "name";
     this.listCategory.DataValueField = "id";
     this.listCategory.DataBind();
     this.listCategory.Items.Insert(0, new ListItem("[Select Category]", "0"));
 }
Ejemplo n.º 2
0
        public CascadingDropDownNameValue[] GetCategory(string knownCategoryValues, string category)
        {
            List <Subject> a = PE_DAL.GetAllCatalogSubject(true);

            List <CascadingDropDownNameValue> values = new List <CascadingDropDownNameValue>();

            foreach (Subject b in a)
            {
                string cat_name = b.SubjName;
                int    cat_id   = b.SubjID;
                values.Add(new CascadingDropDownNameValue(cat_name, cat_id.ToString()));
            }
            return(values.ToArray());
        }