Beispiel #1
0
        public static Raffle_info_tblInfo 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_Raffle_info_tblByGateAndTel_", Gate, "_,_", Tel);
            string value = RedisHelper.Get(key);

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

            if (item == null)
            {
                return(null);
            }
            RedisHelper.Set(key, item.Stringify(), itemCacheTimeout);
            return(item);
        }
Beispiel #2
0
        public static Raffle_info_tblInfo GetItem(uint?Id)
        {
            if (Id == null)
            {
                return(null);
            }
            if (itemCacheTimeout <= 0)
            {
                return(dal.GetItem(Id));
            }
            string key   = string.Concat("DC2016_BLL_Raffle_info_tbl_", Id);
            string value = RedisHelper.Get(key);

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

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