Exemple #1
0
 /// <summary>
 /// clear the hashtable key by key
 /// </summary>
 /// <param name="key"></param>
 /// <returns></returns>
 public static bool ClearCacheByKey(string key)
 {
     try
     {
         return(dataCache.DeleteCache(key));
     }
     catch (Exception)
     {
         return(false);
     }
 }
Exemple #2
0
        /// <summary>
        /// 清空过期缓存
        /// </summary>
        /// <param name="applicationId"></param>
        /// <param name="enterpriseId"></param>
        /// <returns></returns>
        public static bool DeleteExpiredCache(int applicationId, long enterpriseId)
        {
            YSWL.Common.DataCacheCore coreBll = new DataCacheCore(new CacheOption
            {
                CacheType           = CacheType.Redis,
                CancelProductKey    = true,
                DefaultDb           = 0,
                CancelEnterpriseKey = true,
                ReadWriteHosts      = SAASInfo.GetSystemValue("RedisCacheReadWriteHosts"),
                ReadOnlyHosts       = SAASInfo.GetSystemValue("RedisCacheReadOnlyHosts"),
            });
            string CacheKey = "SAAS_AppEndTime_" + applicationId + "_" + enterpriseId;

            return(coreBll.DeleteCache(CacheKey));
        }
Exemple #3
0
        /// <summary>
        /// 清除员工缓存数
        /// </summary>
        /// <param name="enterpriseId"></param>
        /// <returns></returns>
        public static bool ClearCacheSales(long enterpriseId)
        {
            YSWL.Common.DataCacheCore coreBll = new DataCacheCore(new CacheOption
            {
                CacheType           = CacheType.Redis,
                CancelProductKey    = true,
                CancelEnterpriseKey = true,
                DefaultDb           = 0,
                ReadWriteHosts      = SAASInfo.GetSystemValue("RedisCacheReadWriteHosts"),
                ReadOnlyHosts       = SAASInfo.GetSystemValue("RedisCacheReadOnlyHosts"),
            });
            string CacheKey = "SAAS_EnterpriseSales_" + enterpriseId;

            return(coreBll.DeleteCache(CacheKey));
        }