Exemple #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));
        }
 partial void Updateoxite_CMS_Page(oxite_CMS_Page instance);
 partial void Deleteoxite_CMS_Page(oxite_CMS_Page instance);
 partial void Insertoxite_CMS_Page(oxite_CMS_Page instance);