using System; using System.Collections.Generic; using CB.Cache; using CB.Entity; namespace CB.Data { public partial class Caches { /// /// 彩种列表 /// /// public static IList GetLotteryList() { var cache = CBCache.GetCacheService(); IList list = cache.GetObject(CacheKeys.LotteryList) as IList; if (null == list) { list = LotteryService.ToList(); cache.AddObject(CacheKeys.LotteryList, list); } return list; } /// /// 根据区域aid获取所属区域的彩种 /// /// /// public static IList GetLotteryList(int aid) { var list = GetLotteryList(); if (null == list || 0 >= list.Count) return null; IList rlist = new List(); foreach (var item in list) { if (aid == item.Aid) rlist.Add(item); } return rlist; } /// /// 获取彩种详细 /// /// /// public static LotteryInfo GetLotteryInfo(int cid) { var list = GetLotteryList(); if (null == list || 0 >= list.Count) return null; LotteryInfo entity = null; foreach (var item in list) { if (cid == item.Cid) { entity = item; break; } } return entity; } } }