Exemplo n.º 1
0
        protected void cmbEweCategory_SelectedIndexChanged(object sender, EventArgs e)
        {
            EweBL eweBL = new EweBL();

            /*lstSubCategory.DataSource = eweBL.GetEweCategories(int.Parse(cmbEweCategory.SelectedValue));
             * lstSubCategory.DataTextField = "name";
             * lstSubCategory.DataValueField = "eweCategoryID";
             * lstSubCategory.DataBind();*/

            lstSubCategory.Items.Clear();
            DataTable categories = eweBL.GetEweCategories(int.Parse(cmbEweCategory.SelectedValue), int.Parse(cmbCategory.SelectedValue));

            for (int i = 0; i < categories.Rows.Count; i++)
            {
                lstSubCategory.Items.Add(new ListItem(categories.Rows[i]["name"].ToString(), categories.Rows[i]["eweCategoryID"].ToString()));
                lstSubCategory.Items[i].Selected = categories.Rows[i]["selected"].ToString() == "1" ? true : false;
                if (categories.Rows[i]["isNew"].ToString() == "1")
                {
                    lstSubCategory.Items[i].Attributes.Add("style", "background-color:yellow");
                }
            }

            lstCategory.Items.Clear();
            addCategories();
        }
Exemplo n.º 2
0
        private void loadIntoForm()
        {
            EweBL eweBL = new EweBL();

            cmbEweCategory.DataSource     = eweBL.GetEweCategories(null, null);
            cmbEweCategory.DataValueField = "eweCategoryID";
            cmbEweCategory.DataTextField  = "name";
            cmbEweCategory.DataBind();

            CategoryBL categoryBL = new CategoryBL();

            cmbCategory.DataSource     = categoryBL.GetCategories();
            cmbCategory.DataTextField  = "name";
            cmbCategory.DataValueField = "categoryID";
            cmbCategory.DataBind();
        }
Exemplo n.º 3
0
        private void loadIntoForm()
        {
            EweBL eweBL = new EweBL();

            cmbEweCategory.DataSource     = eweBL.GetEweCategories(null, null);
            cmbEweCategory.DataValueField = "eweCategoryID";
            cmbEweCategory.DataTextField  = "name";
            cmbEweCategory.DataBind();

            CategoryBL categoryBL = new CategoryBL();

            //cmbCategory.DataSource = categoryBL.GetCategories("sortOrder", false);
            cmbCategory.DataSource     = categoryBL.GetNestedCategoriesDataTable();
            cmbCategory.DataTextField  = "name";
            cmbCategory.DataValueField = "categoryID";
            cmbCategory.DataBind();
        }