コード例 #1
0
        private void createTable(ComponentDTO componentDTO)
        {
            string str = componentDTO.InheritedType.GenericType.TokenizeString;

            componentEntity.getInheritedTokenList(componentDTO.InheritedTypeId);

            BLL.BLComponent.updateComponentRender(componentDTO);
        }
コード例 #2
0
ファイル: BLComponent.cs プロジェクト: hasanzadegan/Picasso3
        public List <ComponentTokenDTO> getComponentTotalTokenList(decimal componentId, decimal projectId, decimal pageId)
        {
            List <ComponentTokenDTO> tokenList = new List <ComponentTokenDTO>();

            ComponentDTO  componentDTO           = componentEntity.getComponentInfo(componentId);
            string        TokenizeString         = componentDTO.InheritedType.GenericType.TokenizeString;
            List <string> placeHolderList        = Parser.getPlaceHolderList(TokenizeString, Constant.pattern);
            Dictionary <string, string> TokenDic = new Dictionary <string, string>();

            foreach (string placeHolder in placeHolderList)
            {
                if (!TokenDic.Keys.Contains(Parser.clean(placeHolder)) && !Parser.clean(placeHolder).Contains("Page."))
                {
                    TokenDic.Add(Parser.clean(placeHolder), "");
                }
            }

            List <InheritedTokenDTO> inheritedTokenList = componentEntity.getInheritedTokenList(componentDTO.InheritedTypeId);
            List <ComponentTokenDTO> componentTokenList = componentEntity.getComponentTokenList(componentId);

            foreach (KeyValuePair <string, string> tokenNameValue in TokenDic)
            {
                ComponentTokenDTO token = new ComponentTokenDTO();
                token.TokenName   = tokenNameValue.Key;
                token.ComponentId = componentId;
                List <InheritedTokenDTO> inheritedTokenDTO = inheritedTokenList.Where(w => w.TokenName == tokenNameValue.Key).ToList();
                if (inheritedTokenDTO.Count > 0)
                {
                    token.InheritedTokenId    = inheritedTokenDTO.First().InheritedTokenId;
                    token.InheritedTokenValue = inheritedTokenDTO.First().TokenValue;
                    token.InheritedTypeId     = inheritedTokenDTO.First().InheritedTypeId.Value;
                }

                List <ComponentTokenDTO> componentTokenDTO = componentTokenList.Where(w => w.TokenName == tokenNameValue.Key).ToList();
                if (componentTokenDTO.Count > 0)
                {
                    token.InheritedTokenId = componentTokenDTO.First().InheritedTokenId;
                    token.ComponentId      = componentTokenDTO.First().ComponentId;
                    token.ComponentTokenId = componentTokenDTO.First().ComponentTokenId;
                    token.TokenValue       = componentTokenDTO.First().TokenValue;
                    token.Overrided        = true;
                }
                tokenList.Add(token);
            }

            return(tokenList);
        }