GetContentByCategoryURL() static private method

static private GetContentByCategoryURL ( CarrotCMSDataContext ctx, Guid siteID, bool bActiveOnly, string sCatURL ) : IQueryable
ctx CarrotCMSDataContext
siteID Guid
bActiveOnly bool
sCatURL string
return IQueryable
Example #1
0
        public List <SiteNav> GetFilteredContentPagedList(SiteData currentSite, string sFilterPath, bool bActiveOnly,
                                                          int pageSize, int pageNumber, string sortField, string sortDir)
        {
            IQueryable <vw_carrot_Content> query1 = null;
            Guid siteID = currentSite.SiteID;
            bool bFound = false;

            if (currentSite.CheckIsBlogCategoryPath(sFilterPath))
            {
                query1 = CannedQueries.GetContentByCategoryURL(db, siteID, bActiveOnly, sFilterPath);
                bFound = true;
            }
            if (currentSite.CheckIsBlogTagPath(sFilterPath))
            {
                query1 = CannedQueries.GetContentByTagURL(db, siteID, bActiveOnly, sFilterPath);
                bFound = true;
            }
            if (currentSite.CheckIsBlogEditorFolderPath(sFilterPath))
            {
                query1 = CannedQueries.GetContentByUserURL(db, siteID, bActiveOnly, sFilterPath);
                bFound = true;
            }
            if (currentSite.CheckIsBlogDateFolderPath(sFilterPath))
            {
                BlogDatePathParser p = new BlogDatePathParser(currentSite, sFilterPath);
                query1 = CannedQueries.GetLatestBlogListDateRange(db, siteID, p.DateBeginUTC, p.DateEndUTC, bActiveOnly);
                bFound = true;
            }
            if (!bFound)
            {
                query1 = CannedQueries.GetLatestBlogList(db, siteID, bActiveOnly);
            }

            return(PerformDataPagingQueryableContent(siteID, bActiveOnly, pageSize, pageNumber, sortField, sortDir, query1));
        }
Example #2
0
        public int GetFilteredContentPagedCount(SiteData currentSite, string sFilterPath, bool bActiveOnly)
        {
            IQueryable <vw_carrot_Content> query1 = null;
            Guid siteID = currentSite.SiteID;
            bool bFound = false;

            if (currentSite.CheckIsBlogCategoryPath(sFilterPath))
            {
                query1 = CannedQueries.GetContentByCategoryURL(db, siteID, bActiveOnly, sFilterPath);
                bFound = true;
            }
            if (currentSite.CheckIsBlogTagPath(sFilterPath))
            {
                query1 = CannedQueries.GetContentByTagURL(db, siteID, bActiveOnly, sFilterPath);
                bFound = true;
            }
            if (currentSite.CheckIsBlogEditorFolderPath(sFilterPath))
            {
                query1 = CannedQueries.GetContentByUserURL(db, siteID, bActiveOnly, sFilterPath);
                bFound = true;
            }
            if (currentSite.CheckIsBlogDateFolderPath(sFilterPath))
            {
                BlogDatePathParser p = new BlogDatePathParser(currentSite, sFilterPath);
                query1 = CannedQueries.GetLatestBlogListDateRange(db, siteID, p.DateBeginUTC, p.DateEndUTC, bActiveOnly);
                bFound = true;
            }
            if (!bFound)
            {
                query1 = CannedQueries.GetLatestBlogList(db, siteID, bActiveOnly);
            }

            return(query1.Count());
        }