예제 #1
0
        internal ContentSnippet(vw_carrot_ContentSnippet c)
        {
            if (c != null) {
                SiteData site = SiteData.GetSiteFromCache(c.SiteID);

                this.Root_ContentSnippetID = c.Root_ContentSnippetID;
                this.SiteID = c.SiteID;
                this.ContentSnippetID = c.ContentSnippetID;
                this.ContentSnippetName = c.ContentSnippetName;
                this.ContentSnippetSlug = c.ContentSnippetSlug;
                this.ContentSnippetActive = c.ContentSnippetActive;
                this.IsLatestVersion = c.IsLatestVersion;
                this.ContentBody = c.ContentBody;

                this.CreateUserId = c.CreateUserId;
                this.CreateDate = site.ConvertUTCToSiteTime(c.CreateDate);
                this.EditUserId = c.EditUserId;
                this.EditDate = site.ConvertUTCToSiteTime(c.EditDate);
                this.GoLiveDate = site.ConvertUTCToSiteTime(c.GoLiveDate);
                this.RetireDate = site.ConvertUTCToSiteTime(c.RetireDate);

                this.Heartbeat_UserId = c.Heartbeat_UserId;
                this.EditHeartbeat = c.EditHeartbeat;

                this.VersionCount = c.VersionCount;

            }
        }
예제 #2
0
        internal ContentSnippet(vw_carrot_ContentSnippet c)
        {
            if (c != null)
            {
                SiteData site = SiteData.GetSiteFromCache(c.SiteID);

                this.Root_ContentSnippetID = c.Root_ContentSnippetID;
                this.SiteID               = c.SiteID;
                this.ContentSnippetID     = c.ContentSnippetID;
                this.ContentSnippetName   = c.ContentSnippetName;
                this.ContentSnippetSlug   = c.ContentSnippetSlug;
                this.ContentSnippetActive = c.ContentSnippetActive;
                this.IsLatestVersion      = c.IsLatestVersion;
                this.ContentBody          = c.ContentBody;

                this.CreateUserId = c.CreateUserId;
                this.CreateDate   = site.ConvertUTCToSiteTime(c.CreateDate);
                this.EditUserId   = c.EditUserId;
                this.EditDate     = site.ConvertUTCToSiteTime(c.EditDate);
                this.GoLiveDate   = site.ConvertUTCToSiteTime(c.GoLiveDate);
                this.RetireDate   = site.ConvertUTCToSiteTime(c.RetireDate);

                this.Heartbeat_UserId = c.Heartbeat_UserId;
                this.EditHeartbeat    = c.EditHeartbeat;

                this.VersionCount = c.VersionCount;
            }
        }
예제 #3
0
        public static ContentSnippet GetVersion(Guid snippetDataID)
        {
            ContentSnippet _item = null;

            using (CarrotCMSDataContext _db = CarrotCMSDataContext.GetDataContext()) {
                vw_carrot_ContentSnippet query = CompiledQueries.cqGetSnippetVersionByID(_db, snippetDataID);
                if (query != null)
                {
                    _item = new ContentSnippet(query);
                }
            }

            return(_item);
        }
예제 #4
0
        public static ContentSnippet GetSnippetBySlug(Guid siteID, string categorySlug, bool bActiveOnly)
        {
            ContentSnippet _item = null;

            using (CarrotCMSDataContext _db = CarrotCMSDataContext.GetDataContext()) {
                vw_carrot_ContentSnippet query = CompiledQueries.GetLatestContentSnippetBySlug(_db, siteID, bActiveOnly, categorySlug);
                if (query != null)
                {
                    _item = new ContentSnippet(query);
                }
            }

            return(_item);
        }
예제 #5
0
        public static ContentSnippet GetSnippetByID(Guid siteID, Guid rootSnippetID, bool bActiveOnly)
        {
            ContentSnippet _item = null;

            using (CarrotCMSDataContext _db = CarrotCMSDataContext.Create()) {
                vw_carrot_ContentSnippet query = CompiledQueries.GetLatestContentSnippetByID(_db, siteID, bActiveOnly, rootSnippetID);
                if (query != null)
                {
                    _item = new ContentSnippet(query);
                }
            }

            return(_item);
        }
예제 #6
0
        public static ContentSnippet Get(Guid rootSnippetID)
        {
            ContentSnippet _item = null;

            using (CarrotCMSDataContext _db = CarrotCMSDataContext.Create()) {
                vw_carrot_ContentSnippet query = CompiledQueries.cqGetLatestSnippetVersion(_db, rootSnippetID);
                if (query != null)
                {
                    _item = new ContentSnippet(query);
                }
            }

            return(_item);
        }