コード例 #1
0
        public List <ReferenceDto> GetByPrefix(MenuItemEntityType entityType, string prefix)
        {
            switch (entityType)
            {
            case MenuItemEntityType.USER:
                return(_userDao.FindByPrefix(prefix, x => new ReferenceDto()
                {
                    Id = x.Id, Label = x.FirstName + " " + x.Surname
                }));

            case MenuItemEntityType.EXHIBITION:
                return(_genericDao.FindByPrefix <Exhibition>(new ExhibitionFilterDto()
                {
                    Name = prefix
                }, x => new ReferenceDto()
                {
                    Id = x.Id, Label = x.Name
                }));

            case MenuItemEntityType.PAINTING:
                return(_genericDao.FindByPrefix <Painting>(new PaintingFilterDto()
                {
                    Title = prefix
                }, x => new ReferenceDto()
                {
                    Id = x.Id, Label = x.Title
                }));
            }
            return(null);
        }
コード例 #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
        public ActionResult EntityTypeChanged(MenuItemEntityType currentValue)
        {
            string      jsonMessage = string.Empty;
            MenuItemDto menuItemDto = GetTempDataManager().GetTempData <MenuItemDto>(TempDataConstants.DTO);

            menuItemDto.EntityType = currentValue;
            GetTempDataManager().SetTempData(TempDataConstants.DTO, menuItemDto);
            //if (IsSelected(menuItemDto, AssociationType.LINK_TO_LIST, MenuEntityType.BLOG))
            //{
            //    jsonMessage += "#blogCategoryFormGroup";
            //}
            return(Json(jsonMessage));
        }
コード例 #4
0
        public List <ReferenceDto> GetByPrefix(MenuItemEntityType entityType, string prefix)
        {
            switch (entityType)
            {
            case MenuItemEntityType.USER:
                return(_userDao.FindByPrefix(prefix, x => new ReferenceDto()
                {
                    Id = x.Id, Label = x.FirstName + " " + x.Surname
                }));

            case MenuItemEntityType.BLOG:
                return(_genericDao.FindByPrefix <Blog>(new BlogFilterDto()
                {
                    Name = prefix
                }, x => new ReferenceDto()
                {
                    Id = x.Id, Label = x.Name
                }));

            case MenuItemEntityType.EVENT:
                return(_genericDao.FindByPrefix <Event>(new EventFilterDto()
                {
                    Theme = prefix
                }, x => new ReferenceDto()
                {
                    Id = x.Id, Label = x.Theme
                }));

            case MenuItemEntityType.SEMINAR:
                return(_genericDao.FindByPrefix <Seminar>(new EventFilterDto()
                {
                    Theme = prefix
                }, x => new ReferenceDto()
                {
                    Id = x.Id, Label = x.Theme
                }));

            case MenuItemEntityType.PRODUCT:
                return(_genericDao.FindByPrefix <Product>(new ProductFilterDto()
                {
                    Name = prefix
                }, x => new ReferenceDto()
                {
                    Id = x.Id, Label = x.Name
                }));
            }
            return(null);
        }
コード例 #5
0
 private string GenerateLinkToSpecificLink(MenuItemEntityType menuEntityType, ReferenceString userDefinableReference)
 {
     return(string.Format("/{0}/{1}/{2}", menuEntityType.ToString().ToLower(), WebConstants.VIEW_DETAILS, userDefinableReference.GetId()));
 }
コード例 #6
0
 private string GenerateLinkToList(MenuItemAssociationType associationType, MenuItemEntityType menuEntityType, Guid?blogCategoryId)
 {
     return(string.Format("/{0}/{1}", menuEntityType.ToString().ToLower(), WebConstants.VIEW_INDEX));
 }