/// <summary> /// 刷新喷漆打折服务缓存 /// </summary> /// <returns></returns> public bool RefreshPaintDiscountConfigCache() { var result = false; try { var models = dbScopeManagerProductcatalogRead.Execute(conn => DalPaintDiscountConfig.GetAllPaintDiscountService(conn)); var servicePids = models?.Select(s => s.ServicePid).Distinct().ToList(); if (servicePids != null && servicePids.Any()) { using (var client = new Service.Config.CacheClient()) { var cacheResult = client.RefreshPaintDiscountConfigCache(servicePids); cacheResult.ThrowIfException(true); result = cacheResult.Result; } } } catch (Exception ex) { Logger.Error("RefreshPaintDiscountConfigCache", ex); } return(result); }
/// <summary> /// 获取所有喷漆打折服务 /// </summary> /// <returns></returns> public List <PaintDiscountServiceModel> GetAllPaintDiscountService() { var result = null as List <PaintDiscountServiceModel>; try { result = dbScopeManagerProductcatalogRead.Execute (conn => DalPaintDiscountConfig.GetAllPaintDiscountService(conn)); } catch (Exception ex) { Logger.Error("GetAllPaintDiscountService", ex); } return(result ?? new List <PaintDiscountServiceModel>()); }