예제 #1
0
 public void VirtualDeleteItem(long IdItem, MenuItemType itemType)
 {
     if (UserContext.isAnonymous)
     {
         View.DisplaySessionTimeout(rootObject.EditMenuBar(View.IdMenubar, View.PreviousView));
     }
     else
     {
         dtoItem item    = Service.GetFather(IdItem, itemType);
         Boolean deleted = false;
         if (item != null)
         {
             deleted = Service.VirtualDeleteItem(IdItem, itemType);
         }
         if (!deleted)
         {
             View.DeleteError(itemType);
         }
         else
         {
             View.LoadMenubar(Service.MenubarToTree(View.IdMenubar), item);
             this.SelectItem(item);
         }
     }
 }
예제 #2
0
 public void ItemToFirstDisplay(dtoItem source)
 {
     if (UserContext.isAnonymous)
     {
         View.DisplaySessionTimeout(rootObject.EditMenuBar(View.IdMenubar, View.PreviousView));
     }
     else
     {
         Service.ItemToFirstDisplay(source);
         View.LoadMenubar(Service.MenubarToTree(View.IdMenubar), source);
     }
 }
예제 #3
0
 public void ItemReorderedTo(dtoItem source, dtoItem destination)
 {
     if (UserContext.isAnonymous)
     {
         View.DisplaySessionTimeout(rootObject.EditMenuBar(View.IdMenubar, View.PreviousView));
     }
     else
     {
         Service.ItemReorderedTo(source, destination);
         View.LoadMenubar(Service.MenubarToTree(View.IdMenubar), source);
     }
 }
예제 #4
0
        public void SelectItem(dtoItem item)
        {
            MenuBarType menubarType = (item.Type == MenuItemType.Menubar) ? Service.GetMenubarType(item.Id) : Service.GetItemMenubarType(item.Id);

            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout(rootObject.EditMenuBar(View.IdMenubar, menubarType));
            }
            else
            {
                Boolean loadProfileTypes = (menubarType == MenuBarType.Portal || menubarType == MenuBarType.PortalAdministration);
                switch (item.Type)
                {
                case MenuItemType.Menubar:
                    View.LoadMenuBarInfo(Service.GetDtoMenubar(item.Id));
                    break;

                case MenuItemType.ItemColumn:
                    View.LoadColumnItem(Service.GetDtoColumn(item.Id));
                    break;

                case MenuItemType.TopItemMenu:
                    dtoTopMenuItem topItem = Service.GetDtoTopMenuItem(item.Id);
                    if (topItem == null)
                    {
                        View.ItemUnknown();
                    }
                    else if (loadProfileTypes)
                    {
                        View.LoadTopMenuItem(topItem, Service.GetDtoTranslations(item.Id), Service.GetItemProfilesAssignments(item.Id));
                    }
                    else
                    {
                        View.LoadTopMenuItem(topItem, Service.GetDtoTranslations(item.Id));
                    }
                    break;

                case MenuItemType.Separator:
                    dtoMenuItem separator = Service.GetDtoMenuItem(item.Id);
                    if (item == null)
                    {
                        View.ItemUnknown();
                    }
                    else
                    {
                        View.LoadSeparatorItem(separator);
                    }
                    break;

                case MenuItemType.None:
                    View.ItemUnknown();
                    break;

                default:
                    dtoMenuItem menuItem = Service.GetDtoMenuItem(item.Id);
                    if (menuItem == null)
                    {
                        View.ItemUnknown();
                    }
                    else if (loadProfileTypes)
                    {
                        View.LoadMenuItem(menuItem, Service.GetDtoTranslations(menuItem.Id), Service.GetItemProfilesAssignments(menuItem.Id), Service.GetItemAvailableProfileTypes((menuItem)), Service.GetMenuItemAvailableTypes(menuItem), Service.GetAvailableSubTypes(menuItem));
                    }
                    else
                    {
                        View.LoadMenuItem(menuItem, Service.GetDtoTranslations(menuItem.Id), Service.GetMenuItemAvailableTypes(menuItem), Service.GetAvailableSubTypes(menuItem));
                    }
                    break;
                }
            }
        }