protected void uiDropDownListPages_SelectedIndexChanged(object sender, EventArgs e)
 {
     Categories cats = new Categories();
     cats.GetCategoriesByTypeIDAndPageID(4, Convert.ToInt32(uiDropDownListPages.SelectedValue));
     uiDropDownListAllCategories.DataSource = cats.DefaultView;
     uiDropDownListAllCategories.DataTextField = "Title";
     uiDropDownListAllCategories.DataValueField = "CategoryID";
     uiDropDownListAllCategories.DataBind();
     if (cats.RowCount > 0)
         uiDropDownListAllCategories.SelectedIndex = 0;
 }
        private void LoadFilesCats()
        {
            Categories cats = new Categories();
            cats.GetCategoriesByTypeIDAndPageID(3, CurrentPage.PageID);
            uiDropDownListAllCategories.DataSource = cats.DefaultView;
            uiDropDownListAllCategories.DataTextField = "Title";
            uiDropDownListAllCategories.DataValueField = "CategoryID";
            uiDropDownListAllCategories.DataBind();
            if (cats.RowCount > 0)
                uiDropDownListAllCategories.SelectedIndex = 0;

            SubCategories Scats = new SubCategories();
            if (uiDropDownListAllCategories.SelectedIndex != -1)
            {
                Scats.GetSubCatsByCategoryID(Convert.ToInt32(uiDropDownListAllCategories.SelectedValue));
            }
            uiDropDownListsubCats.DataSource = Scats.DefaultView;
            uiDropDownListsubCats.DataTextField = "Title";
            uiDropDownListsubCats.DataValueField = "SubCategoryID";
            uiDropDownListsubCats.DataBind();

            if (Scats.RowCount > 0)
                LoadFiles();
        }
Example #3
0
        private void LoadFilesCats()
        {
            int pid = 0;
            if (Request.QueryString["pid"] != null)
            {
                try
                {
                    pid = Convert.ToInt32(Request.QueryString["pid"].ToString());
                }
                catch (Exception ex)
                {
                    pid = 0;
                }
            }

            Pages page = new Pages();
            page.LoadByPrimaryKey(pid);

            Categories cat = new Categories();
            cat.GetCategoriesByTypeIDAndPageID(3, pid);
            PagedDataSource pds = new PagedDataSource();
            pds.DataSource = cat.DefaultView;
            pds.AllowPaging = true;
            pds.PageSize = 6;
            pds.CurrentPageIndex = currentFileCat;
            uiDataListCats.DataSource = pds;
            uiDataListCats.DataBind();

            uiLinkButtonCatPrev.Enabled = true;
            uiLinkButtonCatNext.Enabled = true;

            if (currentFileCat == 0)
            {
                uiLinkButtonCatPrev.Enabled = false;
            }

            if (currentFileCat == (pds.PageCount - 1))
            {
                uiLinkButtonCatNext.Enabled = false;
            }

            uiPanelSubCats.Visible = false;
            uiPanelCats.Visible = true;
            uiPanelFiles.Visible = false;
        }
        private void LoadDDls()
        {
            Pages pages = new Pages();
            pages.LoadAll();
            uiDropDownListPages.DataSource = pages.DefaultView;
            uiDropDownListPages.DataTextField = "ArTitle";
            uiDropDownListPages.DataValueField = "PageID";
            uiDropDownListPages.DataBind();
            uiDropDownListPages.SelectedIndex = 0;

            Categories cats = new Categories();
            cats.GetCategoriesByTypeIDAndPageID(4, Convert.ToInt32(uiDropDownListPages.SelectedValue));
            uiDropDownListAllCategories.DataSource = cats.DefaultView;
            uiDropDownListAllCategories.DataTextField = "Title";
            uiDropDownListAllCategories.DataValueField = "CategoryID";
            uiDropDownListAllCategories.DataBind();
            if (cats.RowCount > 0)
                uiDropDownListAllCategories.SelectedIndex = 0;
        }
 private void BindData()
 {
     Categories objData = new Categories();
     objData.GetCategoriesByTypeIDAndPageID(4, Convert.ToInt32(uiDropDownListPages.SelectedValue));
     uiGridViewCategories.DataSource = objData.DefaultView;
     uiGridViewCategories.DataBind();
 }