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