Example #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (CommodityId != 0)
            {
                hash ^= CommodityId.GetHashCode();
            }
            if (CommodityType != 0)
            {
                hash ^= CommodityType.GetHashCode();
            }
            if (ProductId.Length != 0)
            {
                hash ^= ProductId.GetHashCode();
            }
            if (Price != 0D)
            {
                hash ^= Price.GetHashCode();
            }
            if (AmountRmb != 0D)
            {
                hash ^= AmountRmb.GetHashCode();
            }
            if (Currency.Length != 0)
            {
                hash ^= Currency.GetHashCode();
            }
            return(hash);
        }
Example #2
0
        /// <summary>
        /// 删除缓存
        /// </summary>
        private void RefreshCacheRemove()
        {
            var list =
                GlobalCacheWrapper.GetData("G_CommodityPromotion:" + AppId, CommodityId.ToString(), CacheTypeEnum.redisSS,
                                           "BTPCache") as List <TodayPromotionDTO>;

            if (list == null || !list.Any())
            {
                return;
            }
            list.RemoveAll(c => c.Id == Id);
            GlobalCacheWrapper.Add("G_CommodityPromotion:" + AppId, CommodityId.ToString(), list, CacheTypeEnum.redisSS, "BTPCache");
        }
Example #3
0
        /// <summary>
        /// 向商品详情缓存中增加Cache
        /// </summary>
        private void ResfreshCacheAdd()
        {
            if (StartTime >= DateTime.Today.AddDays(1) || EndTime <= DateTime.Today || StartTime >= EndTime)
            {
                return;
            }
            var list =
                GlobalCacheWrapper.GetData("G_CommodityPromotion:" + AppId, CommodityId.ToString(), CacheTypeEnum.redisSS,
                                           "BTPCache") as List <TodayPromotionDTO> ?? new List <TodayPromotionDTO>();

            list.Add(ToEntityData());
            GlobalCacheWrapper.Add("G_CommodityPromotion:" + AppId, CommodityId.ToString(), list, CacheTypeEnum.redisSS, "BTPCache");
        }