Ejemplo n.º 1
0
        /// <summary>
        /// 根据PageTypeKey获取页面元素
        /// </summary>
        /// <param name="pageTypeKey"></param>
        public static Dictionary <string, List <StorePageElement> > GetPageElementByPageTypeKey(string pageTypeKey)
        {
            List <StorePageElement> list = StoreDA.GetPageElementByPageTypeKey(pageTypeKey);
            Dictionary <string, List <StorePageElement> > dic = new Dictionary <string, List <StorePageElement> >();

            if (list != null && list.Count > 0)
            {
                foreach (var item in list)
                {
                    if (!string.IsNullOrEmpty(item.ElementGroupName))
                    {
                        if (dic.ContainsKey(item.ElementGroupName))
                        {
                            dic[item.ElementGroupName].Add(item);
                        }
                        else
                        {
                            List <StorePageElement> elements = new List <StorePageElement>();
                            elements.Add(item);
                            dic.Add(item.ElementGroupName, elements);
                        }
                    }
                }
            }

            return(dic);
        }