コード例 #1
0
        public Page Save(Page page)
        {
            oxite_CMS_Page pageToSave = null;

            if (page.ID != Guid.Empty)
            {
                pageToSave = context.oxite_CMS_Pages.FirstOrDefault(p => p.SiteID == page.Site.ID && p.PageID == page.ID);
            }

            if (pageToSave == null)
            {
                pageToSave = new oxite_CMS_Page();

                pageToSave.SiteID = page.Site.ID;
                pageToSave.PageID = page.ID != Guid.Empty ? page.ID : Guid.NewGuid();

                context.oxite_CMS_Pages.InsertOnSubmit(pageToSave);
            }

            pageToSave.TemplateName  = page.TemplateName;
            pageToSave.Title         = page.Title;
            pageToSave.Description   = page.Description;
            pageToSave.Slug          = page.Slug;
            pageToSave.PublishedDate = page.Published;

            context.SubmitChanges();

            return(GetPage(pageToSave.SiteID, pageToSave.Slug));
        }
コード例 #2
0
 partial void Updateoxite_CMS_Page(oxite_CMS_Page instance);
コード例 #3
0
 partial void Deleteoxite_CMS_Page(oxite_CMS_Page instance);
コード例 #4
0
 partial void Insertoxite_CMS_Page(oxite_CMS_Page instance);