GetLatestBlogListDateRange() static private méthode

static private GetLatestBlogListDateRange ( CarrotCMSDataContext ctx, Guid siteID, DateTime dateBegin, DateTime dateEnd, bool bActiveOnly ) : IQueryable
ctx CarrotCMSDataContext
siteID Guid
dateBegin DateTime
dateEnd DateTime
bActiveOnly bool
Résultat IQueryable
Exemple #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));
        }
Exemple #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());
        }
Exemple #3
0
        public List <ContentDateLinks> GetSingleMonthBlogUpdateList(SiteData currentSite, DateTime monthDate, bool bActiveOnly)
        {
            List <ContentDateLinks> lstContent = new List <ContentDateLinks>();
            DateTime dateBegin = monthDate.AddDays(0 - monthDate.Day).AddDays(1);
            DateTime dateEnd   = dateBegin.AddMonths(1).AddMilliseconds(-1);

            if (currentSite != null)
            {
                dateBegin = currentSite.ConvertSiteTimeToUTC(dateBegin);
                dateEnd   = currentSite.ConvertSiteTimeToUTC(dateEnd);
            }

            IQueryable <vw_carrot_Content> query1 = CannedQueries.GetLatestBlogListDateRange(db, currentSite.SiteID, dateBegin, dateEnd, bActiveOnly);

            lstContent = (from p in query1
                          group p by p.GoLiveDateLocal.Date into g
                          select new ContentDateLinks {
                PostDate = g.Key, UseCount = g.Count()
            }).ToList();

            lstContent.ToList().ForEach(q => q.TheSite = currentSite);

            return(lstContent);
        }