Example #1
0
            public static ItemCache Cached(long pickListId)
            {
                Dictionary <string, ItemCache> cache = ResSettings.GetCache(typeof(ResPickList)) as Dictionary <string, ItemCache>;


                if (cache == null)
                {
                    ResSettings.SetCache(cache = new Dictionary <string, ItemCache>(), typeof(ResPickList));
                }


                foreach (var p in cache)
                {
                    if (p.Value.PKID == pickListId)
                    {
                        return(p.Value);
                    }
                }

                return(Cached(APBplDef.ResPickListBpl.PrimaryGet(pickListId).InnerKey));
            }
Example #2
0
            public static ItemCache Cached(string innerKey)
            {
                Dictionary <string, ItemCache> cache = ResSettings.GetCache(typeof(ResPickList)) as Dictionary <string, ItemCache>;


                if (cache == null)
                {
                    ResSettings.SetCache(cache = new Dictionary <string, ItemCache>(), typeof(ResPickList));
                }


                if (cache.ContainsKey(innerKey))
                {
                    return(cache[innerKey]);
                }


                ItemCache itemCache = new ItemCache(APBplDef.ResPickListItemBpl.GetByPickListInnerKey(innerKey));

                cache[innerKey] = itemCache;


                return(itemCache);
            }