GetLatestContentList() static private method

static private GetLatestContentList ( CarrotCMSDataContext ctx, Guid siteID, bool bActiveOnly ) : IQueryable
ctx CarrotCMSDataContext
siteID Guid
bActiveOnly bool
return IQueryable
示例#1
0
        public List <SiteNav> GetMasterNavigation(Guid siteID, bool bActiveOnly)
        {
            List <SiteNav> lstContent = (from ct in CannedQueries.GetLatestContentList(db, siteID, bActiveOnly)
                                         select new SiteNav(ct)).ToList();

            return(lstContent);
        }
示例#2
0
        public List <SiteNav> GetLatestUpdates(Guid siteID, int iUpdates, bool bActiveOnly)
        {
            List <SiteNav> lstContent = (from ct in CannedQueries.GetLatestContentList(db, siteID, bActiveOnly)
                                         orderby ct.EditDate descending
                                         select new SiteNav(ct)).Take(iUpdates).ToList();

            return(lstContent);
        }
示例#3
0
        public List <SiteNav> GetLatestContentPagedList(Guid siteID, ContentPageType.PageType postType, bool bActiveOnly,
                                                        int pageSize, int pageNumber, string sortField, string sortDir)
        {
            IQueryable <vw_carrot_Content> query1 = null;

            if (postType == ContentPageType.PageType.ContentEntry)
            {
                query1 = CannedQueries.GetLatestContentList(db, siteID, bActiveOnly);
            }
            else
            {
                query1 = CannedQueries.GetLatestBlogList(db, siteID, bActiveOnly);
            }

            return(PerformDataPagingQueryableContent(siteID, bActiveOnly, pageSize, pageNumber, sortField, sortDir, query1));
        }
示例#4
0
        public List <SiteNav> GetLevelDepthNavigation(Guid siteID, int iDepth, bool bActiveOnly)
        {
            List <SiteNav> lstContent = null;
            List <Guid>    lstSub     = new List <Guid>();

            if (iDepth < 1)
            {
                iDepth = 1;
            }

            if (iDepth > 10)
            {
                iDepth = 10;
            }

            List <Guid> lstTop = CompiledQueries.TopLevelPages(db, siteID, false).Select(z => z.Root_ContentID).ToList();

            while (iDepth > 1)
            {
                lstSub = (from ct in CannedQueries.GetLatestContentList(db, siteID, bActiveOnly)
                          where ct.SiteID == siteID &&
                          ct.ShowInSiteNav == true &&
                          (ct.PageActive == true || bActiveOnly == false) &&
                          ct.IsLatestVersion == true &&
                          (ct.GoLiveDate < DateTime.UtcNow || bActiveOnly == false) &&
                          (ct.RetireDate > DateTime.UtcNow || bActiveOnly == false) &&
                          (!lstTop.Contains(ct.Root_ContentID) && lstTop.Contains(ct.Parent_ContentID.Value))
                          select ct.Root_ContentID).Distinct().ToList();

                lstTop = lstTop.Union(lstSub).ToList();

                iDepth--;
            }

            lstContent = (from ct in CannedQueries.GetLatestContentList(db, siteID, bActiveOnly)
                          orderby ct.NavOrder, ct.NavMenuText
                          where ct.SiteID == siteID &&
                          ct.ShowInSiteNav == true &&
                          (ct.PageActive == true || bActiveOnly == false) &&
                          ct.IsLatestVersion == true &&
                          (ct.GoLiveDate < DateTime.UtcNow || bActiveOnly == false) &&
                          (ct.RetireDate > DateTime.UtcNow || bActiveOnly == false) &&
                          lstTop.Contains(ct.Root_ContentID)
                          select new SiteNav(ct)).ToList();

            return(lstContent);
        }
示例#5
0
        public List <SiteNav> GetTwoLevelNavigation(Guid siteID, bool bActiveOnly)
        {
            List <SiteNav> lstContent = null;

            List <Guid> lstTop = CompiledQueries.TopLevelPages(db, siteID, false).Select(z => z.Root_ContentID).ToList();

            lstContent = (from ct in CannedQueries.GetLatestContentList(db, siteID, bActiveOnly)
                          orderby ct.NavOrder, ct.NavMenuText
                          where ct.SiteID == siteID &&
                          (ct.PageActive == true || bActiveOnly == false) &&
                          (ct.GoLiveDate < DateTime.UtcNow || bActiveOnly == false) &&
                          (ct.RetireDate > DateTime.UtcNow || bActiveOnly == false) &&
                          ct.IsLatestVersion == true &&
                          (lstTop.Contains(ct.Root_ContentID) || lstTop.Contains(ct.Parent_ContentID.Value))
                          select new SiteNav(ct)).ToList();

            return(lstContent);
        }
示例#6
0
        public int GetSiteContentCount(Guid siteID)
        {
            int iCount = CannedQueries.GetLatestContentList(db, siteID, false).Count();

            return(iCount);
        }