Пример #1
0
        protected void LoadItems(string sortField = "ProductId", dg.Sql.SortDirection sortDirection = dg.Sql.SortDirection.ASC)
        {
            if (!HasEditPermission)
            {
                dgFilters.Columns[dgFilters.Columns.Count - 1].Visible = false;
            }

            dgFilters.VirtualItemCount = ProductController.GetAllFilter().Count;
            if (dgFilters.VirtualItemCount == 0)
            {
                phHasItems.Visible   = false;
                phHasNoItems.Visible = true;
                lblNoItems.Text      = FiltersStrings.GetText(@"MessageNoFiltersFound");
            }
            else
            {
                phHasItems.Visible   = true;
                phHasNoItems.Visible = false;

                if (dgFilters.PageSize * dgFilters.CurrentPageIndex > dgFilters.VirtualItemCount)
                {
                    dgFilters.CurrentPageIndex         = 0;
                    hfCurrentPageIndex_dgFilters.Value = dgFilters.CurrentPageIndex.ToString();
                }
                List <FilterUI> filters = ProductController.GetAllFilter(dgFilters.PageSize, dgFilters.CurrentPageIndex);
                BindList(filters);
            }
        }
        protected void LoadItems(string sortField = "CategoryId", dg.Sql.SortDirection sortDirection = dg.Sql.SortDirection.ASC)
        {
            if (!HasEditPermission)
            {
                dgSubCategories.Columns[dgSubCategories.Columns.Count - 1].Visible = false;
            }
            if (Int64.Parse(ddlCategory.SelectedValue) != 0)
            {
                dgSubCategories.VirtualItemCount = ProductController.GetSubCategories(Int64.Parse(ddlCategory.SelectedValue)).Count;
            }
            else
            {
                dgSubCategories.VirtualItemCount = ProductController.GetSubCategories().Count;
            }

            if (dgSubCategories.VirtualItemCount == 0)
            {
                phHasItems.Visible   = false;
                phHasNoItems.Visible = true;
                lblNoItems.Text      = CategoriesStrings.GetText(@"MessageNoSubCategoriesFound");
            }
            else
            {
                phHasItems.Visible   = true;
                phHasNoItems.Visible = false;

                if (dgSubCategories.PageSize * dgSubCategories.CurrentPageIndex > dgSubCategories.VirtualItemCount)
                {
                    dgSubCategories.CurrentPageIndex         = 0;
                    hfCurrentPageIndex_dgSubCategories.Value = dgSubCategories.CurrentPageIndex.ToString();
                }
                List <CategoryUI> categories = ProductController.GetSubCategories(Int64.Parse(ddlCategory.SelectedValue), dgSubCategories.PageSize, dgSubCategories.CurrentPageIndex);
                //foreach (CategoryUI item in categories)
                //{
                //    item.Filters = ProductController.GetAllFilter();
                //}

                BindList(categories);
            }
        }
Пример #3
0
        protected void LoadItems(string sortField = "CampaignId", dg.Sql.SortDirection sortDirection = dg.Sql.SortDirection.ASC)
        {
            CampaignCollection col = CampaignController.GetAllCampaign(dgCampaign.PageSize, dgCampaign.CurrentPageIndex);

            BindList(col);
        }