public static void AddFolder(string Path, string Title, Nullable <int> ParentId) { InventioNavigationNode NewNode = new InventioNavigationNode(); NewNode.NodeType = InventioNavigationNodeType.Folder; NewNode.ParentId = ParentId; NewNode.Url = Path + "/" + Tc.Inventio.Framework.Web.UrlHelper.Slug(Title); NewNode.Title = Title; NavigationWorker.Add(NewNode, NavigationWorker.RepositoryWebConfig); }
public static void RemovePage(string path) { if (!string.IsNullOrWhiteSpace(path)) { InventioNavigationNode nav = NavigationWorker.SelectByPath(path, NavigationWorker.RepositoryWebConfig); if (nav != null) { NavigationWorker.Remove(nav.Id, NavigationWorker.RepositoryWebConfig); } // eliminamos navigation InventioPage page = PageWorker.SelectByPath(path, PageWorker.RepositoryWebConfig); if (page != null) { PageWorker.Remove(page.Id, PageWorker.RepositoryWebConfig); } // eliminamos página } }
public static void AddPage(string Path, string title, int IdLayout, Nullable <int> ParentId) { bool ok = !string.IsNullOrWhiteSpace(Path) && !string.IsNullOrWhiteSpace(title); if (ok) { // añadimos página InventioPage NewPage = new InventioPage(); NewPage.Path = Path + "/" + Tc.Inventio.Framework.Web.UrlHelper.Slug(title); NewPage.Title = title; NewPage.IdLayout = IdLayout; PageWorker.Add(NewPage, PageWorker.RepositoryWebConfig); // añadimos entrada en navigation InventioNavigationNode NewNode = new InventioNavigationNode(); NewNode.NodeType = InventioNavigationNodeType.Page; NewNode.ParentId = ParentId; NewNode.Url = NewPage.Path; NewNode.Title = title; NavigationWorker.Add(NewNode, NavigationWorker.RepositoryWebConfig); } }
public static InventioNavigationNode ReadNavigationNodes() { return(NavigationWorker.SelectAll(NavigationWorker.RepositoryWebConfig)); }