Ejemplo n.º 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;
                uiPanelPics.Visible = false;
            }
            else if (Request.QueryString["scatid"] != null && !string.IsNullOrEmpty(Request.QueryString["scatid"]))
            {
                GeneralPhotos objData = new GeneralPhotos();
                objData.GetGeneralPhotosBySubCategoryID(Convert.ToInt32(Request.QueryString["scatid"].ToString()));
                PagedDataSource pds = new PagedDataSource();
                objData.DefaultView.Sort = "ArTitle asc";
                pds.DataSource = objData.DefaultView;
                pds.AllowPaging = true;
                pds.PageSize = 6;
                pds.CurrentPageIndex = currentPage;
                uiDataListPics.DataSource = pds;
                uiDataListPics.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;
                uiPanelPics.Visible = true;
            }
            else
            {
                Categories scat = new Categories();
                scat.GetCategoriesByTypeID(2);
                PagedDataSource pds = new PagedDataSource();
                pds.DataSource = scat.DefaultView;
                pds.AllowPaging = true;
                pds.PageSize = 6;
                pds.CurrentPageIndex = currentPageSub;
                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;
                uiPanelPics.Visible = false;
            }
        }
Ejemplo n.º 2
0
 private void BindData()
 {
     GeneralPhotos objData = new GeneralPhotos();
     if (uiDropDownListSubCats.SelectedIndex > -1)
     {
         objData.GetGeneralPhotosBySubCategoryID(Convert.ToInt32(uiDropDownListSubCats.SelectedValue));
         objData.DefaultView.Sort = "ArTitle asc";
     }
     uiGridViewSubCategories.DataSource = objData.DefaultView;
     uiGridViewSubCategories.DataBind();
 }