Пример #1
0
        public ActionResult AssociationTypeChanged(MenuItemAssociationType currentValue)
        {
            MenuItemDto menuItemDto = GetTempDataManager().GetTempData <MenuItemDto>(TempDataConstants.DTO);

            menuItemDto.AssociationType = currentValue;
            GetTempDataManager().SetTempData(TempDataConstants.DTO, menuItemDto);
            string jsonMessage = string.Empty;

            switch (currentValue)
            {
            case MenuItemAssociationType.EMPTY_LINK:
            case MenuItemAssociationType.HOME:
                break;

            case MenuItemAssociationType.LINK:
                jsonMessage = "#linkFormGroup";
                break;

            case MenuItemAssociationType.LINK_TO_LIST:
                jsonMessage = "#entityTypeFormGroup";
                break;

            case MenuItemAssociationType.LINK_TO_SPECIFIC:
                jsonMessage = "#entityTypeFormGroup,#specificEntityFormGroup";
                break;
            }
            //if (IsSelected(menuItemDto, MenuItemAssociationType.LINK_TO_LIST, MenuItemEntityType.BLOG))
            //{
            //    jsonMessage += ",#blogCategoryFormGroup";
            //}
            return(Json(jsonMessage));
        }
Пример #2
0
 private string GenerateLinkToList(MenuItemAssociationType associationType, MenuItemEntityType menuEntityType, Guid?blogCategoryId)
 {
     if (MenuItemAssociationType.LINK_TO_LIST.Equals(associationType) && MenuItemEntityType.BLOG.Equals(menuEntityType))
     {
         return(string.Format("/{0}/{1}?BlogCategoryId={2}", menuEntityType.ToString().ToLower(), WebConstants.VIEW_INDEX, blogCategoryId));
     }
     return(string.Format("/{0}/{1}", menuEntityType.ToString().ToLower(), WebConstants.VIEW_INDEX));
 }
Пример #3
0
 internal List <MenuItemDto> GetMenuItems(MenuItemAssociationType associationType, Guid?parentMenuItemId)
 {
     return(_modelContext.Set <MenuItem>()
            .Where(x => x.ParentMenuItemId == parentMenuItemId && x.AssociationType == associationType)
            .OrderBy(x => x.Order)
            .Select(x => new MenuItemDto()
     {
         Id = x.Id, Name = x.Name, Url = x.Url, BuiltIn = x.BuiltIn, HasChildren = x.SubMenuItems.Count > 0, Level = x.Level, AssociationType = x.AssociationType
     })
            .ToList());
 }
Пример #4
0
 private string GenerateLinkToList(MenuItemAssociationType associationType, MenuItemEntityType menuEntityType, Guid?blogCategoryId)
 {
     return(string.Format("/{0}/{1}", menuEntityType.ToString().ToLower(), WebConstants.VIEW_INDEX));
 }