12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using CB.Cache;
- using CB.Entity;
- namespace CB.Data
- {
- public partial class Caches
- {
- /// <summary>
- /// 走势图项配置
- /// </summary>
- /// <returns></returns>
- public static IList<TrendChartItemInfo> GetTrendChartItemList()
- {
- var cache = CBCache.GetCacheService();
- IList<TrendChartItemInfo> list = cache.GetObject(CacheKeys.TrendChartItemList) as IList<TrendChartItemInfo>;
- if (null == list)
- {
- list = TrendChartItemService.ToList();
- cache.AddObject(CacheKeys.TrendChartItemList, list);
- }
- return list;
- }
- /// <summary>
- /// 获取走势图项配置
- /// </summary>
- /// <param name="chartId"></param>
- /// <param name="chartType"></param>
- /// <returns></returns>
- public static IList<TrendChartItemInfo> GetTrendChartItemList(int chartId, TrendChartType chartType)
- {
- var list = GetTrendChartItemList();
- if (null == list || 0 >= list.Count)
- return null;
- IList<TrendChartItemInfo> r = new List<TrendChartItemInfo>();
- foreach (var item in list)
- {
- if (chartId == item.ChartId && chartType == item.ChartType)
- r.Add(item);
- }
- return r;
- }
- }
- }
|