/// <summary> /// 清除特殊车型附加安装费服务缓存 /// </summary> /// <returns></returns> public bool RefreshVehicleAdditionalPriceCache() { var key = "VehicleAdditionalPriceSwitch"; var keys = new List <string>() { key }; using (var client = new Tuhu.Service.Shop.CacheClient()) { var cacheResult = client.RemoveCaches(keys); cacheResult.ThrowIfException(true); return(cacheResult.Result); } }
public void CleanCache(string activityid) { try { Guid actid; if (Guid.TryParse(activityid, out actid)) { using (var client = new Tuhu.Service.Shop.CacheClient()) { var result = client.UpdateShopBeautyActivityByActivityId(actid); result.ThrowIfException(true); } } } catch (Exception ex) { throw ex; } }
public ActionResult Save(SE_MDBeautyCategoryConfigModel model) { bool result = false; if (model != null) { // SE_MDBeautyCategoryConfigBLL.GetPidsFromMDBeautyCategoryProductConfigByCategoryIds(new); if (model.Id > 0) { result = SE_MDBeautyCategoryConfigBLL.Update(model); } else { result = SE_MDBeautyCategoryConfigBLL.Insert(model); } //刷新分类缓存 try { using (var client = new Tuhu.Service.Shop.CacheClient()) { var clientResult = client.UpdateBeautyAvailableCategories(); if (clientResult.Result) { TempData["UpdateBeautyAvailableCategories"] = "刷新美容分类缓存成功!"; } else { TempData["UpdateBeautyAvailableCategories"] = clientResult.ErrorMessage; } } } catch { } } return(RedirectToAction("Index")); }
/// <summary> /// 刷新保养项目加价服务缓存 /// </summary> /// <returns></returns> public bool RefreshBaoYangInstallFeeConfigCache() { var result = true; try { var serviceIds = GetAllBaoYangServices(); if (serviceIds != null && serviceIds.Any()) { var keys = serviceIds.Select(s => $"ServicePrice/BaoYangInstallFeeConfig/{s.ServiceId}"); using (var client = new Tuhu.Service.Shop.CacheClient()) { var cacheResult = client.RemoveCaches(keys); cacheResult.ThrowIfException(true); result = cacheResult.Result; } } } catch (Exception ex) { Logger.Error("RefreshBaoYangInstallFeeConfigCache", ex); } return(result); }