Exemplo n.º 1
0
        public static System.Collections.Generic.List <MLCategoryInfo> GetCategoriesAsListe(int PortalId, string Locale, bool FromCache)
        {
            System.Collections.Generic.Dictionary <string, StringInfo> dic = effority.Ealo.Controller.GetStringsByQualifier(CatQualifier, Locale, FromCache);
            CategoryController catController = new CategoryController();

            System.Collections.Generic.Dictionary <string, CategoryInfo> catDic    = catController.GetCatsByPortal(PortalId);
            System.Collections.Generic.List <MLCategoryInfo>             neueListe = new System.Collections.Generic.List <MLCategoryInfo>();

            foreach (CategoryInfo info in catDic.Values)
            {
                StringInfo     localizedCatName = null;
                MLCategoryInfo MLCatInfo        = new MLCategoryInfo(info);
                if (dic.TryGetValue(info.CatID, out localizedCatName))
                {
                    if (!string.IsNullOrEmpty(localizedCatName.StringText))
                    {
                        localizedCatName.FallBack       = MLCatInfo.CatName;
                        localizedCatName.FallbackIsNull = false;
                        MLCatInfo.MLCatName             = localizedCatName;
                    }
                }
                neueListe.Add(MLCatInfo);
            }
            return(neueListe);
        }
Exemplo n.º 2
0
        public static System.Collections.Generic.List <MLNewsInfo> GetNewsAsListe(int PortalId, string Locale, bool FromCache)
        {
            CategoryController catCont             = new CategoryController();
            Dictionary <string, CategoryInfo> cats = catCont.GetCatsByPortal(PortalId);

            System.Collections.Generic.List <MLNewsInfo> liste = new System.Collections.Generic.List <MLNewsInfo>();
            foreach (CategoryInfo catInfo in cats.Values)
            {
                liste.AddRange(GetNewsAsListeByCat(catInfo.CatID, Locale, FromCache));
            }
            return(liste);
        }