Exemplo n.º 1
0
        public static BaishiRewardInfo GetItemByGateAndTel(string Gate, string Tel)
        {
            if (Gate == null || Tel == null)
            {
                return(null);
            }
            if (itemCacheTimeout <= 0)
            {
                return(dal.GetItemByGateAndTel(Gate, Tel));
            }
            string key   = string.Concat("DC2016_BLL_BaishiRewardByGateAndTel_", Gate, "_,_", Tel);
            string value = RedisHelper.Get(key);

            if (!string.IsNullOrEmpty(value))
            {
                try { return(new BaishiRewardInfo(value)); } catch { }
            }
            BaishiRewardInfo item = dal.GetItemByGateAndTel(Gate, Tel);

            if (item == null)
            {
                return(null);
            }
            RedisHelper.Set(key, item.Stringify(), itemCacheTimeout);
            return(item);
        }
Exemplo n.º 2
0
        public static BaishiRewardInfo GetItem(uint?Id)
        {
            if (Id == null)
            {
                return(null);
            }
            if (itemCacheTimeout <= 0)
            {
                return(dal.GetItem(Id));
            }
            string key   = string.Concat("DC2016_BLL_BaishiReward_", Id);
            string value = RedisHelper.Get(key);

            if (!string.IsNullOrEmpty(value))
            {
                try { return(new BaishiRewardInfo(value)); } catch { }
            }
            BaishiRewardInfo item = dal.GetItem(Id);

            if (item == null)
            {
                return(null);
            }
            RedisHelper.Set(key, item.Stringify(), itemCacheTimeout);
            return(item);
        }