Ejemplo n.º 1
0
 private void CopyPasteRecursive(Page source, Page destination)
 {
     var pagesToCopy = Repository.Data.Get<Page>().Where(x => x.Parent.Id == source.Id).All();
     foreach (var pageToCopy in pagesToCopy)
     {
         var copy = (Page) pageToCopy.Clone();
         copy.Parent = destination;
         copy.WebSiteId = destination.WebSiteId;
         Repository.Data.Save(copy);
         CopyPasteRecursive(pageToCopy, copy);
     }
 }
        public void PageInsertTest()
        {
            var page = new Page {
                    Name = String.Empty,
                    WebSiteId = _webSite.Id,
                    MenuStatus = (MenuStatus) 5 };

            Assert.Throws<ValidationArgumentException>(() => Repository.Data.Save(page));
        }
Ejemplo n.º 3
0
 private void ChangeWebSiteRecursive(Page page)
 {
     var children = Repository.Data.Get<Page>().Where(x => x.Parent.Id == page.Id).All();
     foreach (var child in children)
     {
         child.WebSiteId = page.WebSiteId;
         Repository.Data.Save(child);
         ChangeWebSiteRecursive(child);
     }
 }
 private Page CreatePage()
 {
     var page = new Page
     {
         MenuStatus = MenuStatus.NotInMenu,
         PageType = CreatePageType(),
         WebSiteId = _webSite.Id,
         Name = "Page - " + Guid.NewGuid().ToString(),
         PageTemplate = CreatePageTemplate(),
         Seo = new SeoProfile(),
         UrlName = "www.litium.home.aspx"
     };
     Repository.Data.Save(page);
     return page;
 }