Пример #1
0
        public void ModifyMenu(MenuItemInfo menu)
        {
            try
            {
                MenuItemEntity entity = new MenuItemEntity();
                entity.Id              = menu.Id;
                entity.Index           = menu.Index;
                entity.InnerId         = menu.InnerId;
                entity.IsInner         = menu.IsInner;
                entity.IsListType      = menu.IsListType;
                entity.IsOpenNewWindow = menu.IsOpenNewWindow;
                entity.Level           = menu.Level;
                entity.Name            = menu.Name;
                entity.OuterUrl        = menu.OuterUrl;
                entity.ParentId        = menu.ParentId;

                PageManager manager = new PageManager(DbAccess);
                manager.ModifyEntity <MenuItemEntity>(entity);
            }
            catch (Exception ex)
            {
                throw HandleException("Page", "AddMenu - " + menu.Name, ex);
            }
        }
Пример #2
0
        public void AddMenu(MenuItemInfo menu)
        {
            try
            {
                MenuItemEntity entity = new MenuItemEntity();
                entity.Index = menu.Index;
                entity.InnerId = menu.InnerId;
                entity.IsInner = menu.IsInner;
                entity.IsListType = menu.IsListType;
                entity.IsOpenNewWindow = menu.IsOpenNewWindow;
                entity.Level = menu.Level;
                entity.Name = menu.Name;
                entity.OuterUrl = menu.OuterUrl;
                entity.ParentId = menu.ParentId;

                PageManager manager = new PageManager(DbAccess);
                manager.AddEntity<MenuItemEntity>(entity);
                menu.Id = entity.Id;
            }
            catch (Exception ex)
            {
                throw HandleException("Page", "AddMenu - " + menu.Name, ex);
            }
        }