TrendChartCssConfigCache.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using CB.Cache;
  6. using CB.Entity;
  7. namespace CB.Data
  8. {
  9. public partial class Caches
  10. {
  11. /// <summary>
  12. /// 走势图项CSS配置
  13. /// </summary>
  14. /// <returns></returns>
  15. public static IList<ChartCssConfigInfo> GetTrendChartItemCssConfigList()
  16. {
  17. var cache = CBCache.GetCacheService();
  18. IList<ChartCssConfigInfo> list = cache.GetObject(CacheKeys.TrendChartCssConfigList) as IList<ChartCssConfigInfo>;
  19. if (null == list)
  20. {
  21. list = ChartCssConfigService.ToList();
  22. cache.AddObject(CacheKeys.TrendChartCssConfigList, list);
  23. }
  24. return list;
  25. }
  26. /// <summary>
  27. /// 走势图项CSS配置
  28. /// </summary>
  29. /// <returns></returns>
  30. public static ChartCssConfigInfo GetTrendChartItemCssConfig(int id)
  31. {
  32. IList<ChartCssConfigInfo> List = GetTrendChartItemCssConfigList();
  33. if (List!=null && List.Count>0)
  34. {
  35. foreach (var item in List)
  36. {
  37. if (item.Id == id)
  38. {
  39. return item;
  40. }
  41. }
  42. }
  43. return null;
  44. }
  45. }
  46. }