Ejemplo n.º 1
0
        public PagedList <CategoryModel> GetAllCategoryParent(PagingParams pagingParams)
        {
            DisplayCategory category = new DisplayCategory();

            category.objUser = this.objUser;
            var query = new List <CategoryModel>((List <CategoryModel>)category.DisplayCategoryParent()).AsQueryable();
            IQueryable <CategoryModel> filter;

            filter = query.Where(p => p.category_name.StartsWith(pagingParams.Query ?? string.Empty, StringComparison.InvariantCultureIgnoreCase));

            return(new PagedList <CategoryModel>(filter, pagingParams.PageNumber, pagingParams.PageSize));
        }
Ejemplo n.º 2
0
        public PagedList <CategoryModel> GetAllSubCategories(PagingParams pagingParams, string id)
        {
            DisplayCategory category = new DisplayCategory();

            category.objUser = this.objUser;
            var query = new List <CategoryModel>((List <CategoryModel>)category.DisplaySubCategory(id)).AsQueryable();
            IQueryable <CategoryModel> filter;


            if (pagingParams.Term.ToUpper() == "TYPE")
            {
                filter = query.Where(p => p.category_type.StartsWith(pagingParams.Query ?? string.Empty, StringComparison.InvariantCultureIgnoreCase));
            }
            else
            {
                filter = query.Where(p => p.category_name.StartsWith(pagingParams.Query ?? string.Empty, StringComparison.InvariantCultureIgnoreCase));
            }

            return(new PagedList <CategoryModel>(filter, pagingParams.PageNumber, pagingParams.PageSize));
        }