public static void ChangeParent(string idChild, string idParent) { PSCPortal.CMS.Menu child = (PSCPortal.CMS.Menu)MenuList.Search(t => ((PSCPortal.CMS.Menu)t).Id == new Guid(idChild)); PSCPortal.CMS.Menu parent = (PSCPortal.CMS.Menu)MenuList.Search(t => ((PSCPortal.CMS.Menu)t).Id == new Guid(idParent)); child.Parent = parent; child.Update(); MenuList.UpdatePostionChilds(parent); }
protected SiteMapNode GetSiteNodeFromMenu(PSCPortal.CMS.Menu menu) { SiteMapNode siteNode = new SiteMapNode(); siteNode.Id = menu.Id; siteNode.Name = menu.Name; siteNode.NavigationUrl = menu.NavigationURL; siteNode.Children = new List <SiteMapNode>(); if (menu.HasChildren) { var children = menu.GetChildren(); foreach (PSCPortal.Framework.Core.BusinessObjectHierarchical mc in children) { siteNode.Children.Add(GetSiteNodeFromMenu((PSCPortal.CMS.Menu)mc.Item)); } } return(siteNode); }
public static void MenuNew() { PSCPortal.CMS.Menu item = new PSCPortal.CMS.Menu(); item.Id = Guid.NewGuid(); PSCDialog.DataShare = new MenuArgs(item, false); }