Example #1
0
        private void BindData()
        {
            if (Request.QueryString["catid"] != null && !string.IsNullOrEmpty(Request.QueryString["catid"]))
            {
                SubCategories scat = new SubCategories();
                scat.GetSubCatsByCategoryID(Convert.ToInt32(Request.QueryString["catid"].ToString()));
                PagedDataSource pds = new PagedDataSource();
                pds.DataSource = scat.DefaultView;
                pds.AllowPaging = true;
                pds.PageSize = 6;
                pds.CurrentPageIndex = currentPageSub;
                uiDataListSub.DataSource = pds;
                uiDataListSub.DataBind();
                uiLinkButtonSubPrev.Enabled = true;
                uiLinkButtonSubNext.Enabled = true;
                if (currentPageSub == 0)
                {
                    uiLinkButtonSubPrev.Enabled = false;
                }

                if (currentPageSub == (pds.PageCount - 1))
                {
                    uiLinkButtonSubNext.Enabled = false;
                }
                uiPanelSubCats.Visible = true;
                uiPanelCats.Visible = false;
                uiPanelVideos.Visible = false;
            }
            else if (Request.QueryString["scatid"] != null && !string.IsNullOrEmpty(Request.QueryString["scatid"]))
            {
                GeneralVideos objData = new GeneralVideos();
                objData.GetGeneralVideosBySubCategoryID(Convert.ToInt32(Request.QueryString["scatid"].ToString()));
                PagedDataSource pds = new PagedDataSource();
                pds.DataSource = objData.DefaultView;
                pds.AllowPaging = true;
                pds.PageSize = 6;
                pds.CurrentPageIndex = currentPage;
                uiDataListVideos.DataSource = pds;
                uiDataListVideos.DataBind();
                uiLinkButtonPrev.Enabled = true;
                uiLinkButtonNext.Enabled = true;
                if (currentPage == 0)
                {
                    uiLinkButtonPrev.Enabled = false;
                }

                if (currentPage == (pds.PageCount - 1))
                {
                    uiLinkButtonNext.Enabled = false;
                }
                uiPanelSubCats.Visible = false;
                uiPanelCats.Visible = false;
                uiPanelVideos.Visible = true;

            }
            else
            {
                Categories scat = new Categories();
                scat.GetCategoriesByTypeID(1);
                PagedDataSource pds = new PagedDataSource();
                pds.DataSource = scat.DefaultView;
                pds.AllowPaging = true;
                pds.PageSize = 6;
                pds.CurrentPageIndex = currentPageCat;
                uiDataListCats.DataSource = pds;
                uiDataListCats.DataBind();
                uiLinkButtonCatPrev.Enabled = true;
                uiLinkButtonCatNext.Enabled = true;
                if (currentPageCat == 0)
                {
                    uiLinkButtonCatPrev.Enabled = false;
                }

                if (currentPageCat == (pds.PageCount - 1))
                {
                    uiLinkButtonCatNext.Enabled = false;
                }
                uiPanelSubCats.Visible = false;
                uiPanelCats.Visible = true;
                uiPanelVideos.Visible = false;
            }
        }
 private void LoadDDls()
 {
     Categories cats = new Categories();
     cats.GetCategoriesByTypeID(1);
     uiDropDownListAllCategories.DataSource = cats.DefaultView;
     uiDropDownListAllCategories.DataTextField = "Title";
     uiDropDownListAllCategories.DataValueField = "CategoryID";
     uiDropDownListAllCategories.DataBind();
     uiDropDownListAllCategories.SelectedIndex = 0;
 }
 private void BindData()
 {
     Categories objData = new Categories();
     objData.GetCategoriesByTypeID(2);
     uiGridViewCategories.DataSource = objData.DefaultView;
     uiGridViewCategories.DataBind();
 }
        private void LoadDDLs()
        {
            Categories objData = new Categories();
            objData.GetCategoriesByTypeID(1);
            uiDropDownListAllCategories.DataSource = objData.DefaultView;
            uiDropDownListAllCategories.DataTextField = "Title";
            uiDropDownListAllCategories.DataValueField = "CategoryID";
            uiDropDownListAllCategories.DataBind();
            uiDropDownListAllCategories.SelectedIndex = 0;

            SubCategories obj = new SubCategories();
            obj.GetSubCatsByCategoryID(Convert.ToInt32(uiDropDownListAllCategories.SelectedValue));
            uiDropDownListSubCats.DataSource = obj.DefaultView;
            uiDropDownListSubCats.DataTextField = "Title";
            uiDropDownListSubCats.DataValueField = "SubCategoryID";
            uiDropDownListSubCats.DataBind();
            uiDropDownListSubCats.SelectedIndex = 0;
        }