using Business.TrendChart; using Cache; using Common; using KJH55128_Rec.ViewModels; using Models.Entity.LotteryNumDB; using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace KJH55128_Rec.Business.TrendChart { public static class TrendChastApiBLL { public static List QueryAll() { return TrendChartBLL.QueryAll(); } public static List GetTrendChart(int cid, int tid) { try { var data = TrendChartBLL.GetTrendChart(cid, tid); var enumerator = data.GetEnumerator(); List list = new List(); while (enumerator.MoveNext()) { ZXViewModel tmp = new ZXViewModel() { Status = enumerator.Current.Status, Cid = enumerator.Current.Cid, hDescription = enumerator.Current.hDescription, hKeywords = enumerator.Current.hKeywords, hTitle = enumerator.Current.hTitle, Name = enumerator.Current.Name, OrderBy = enumerator.Current.OrderBy, TemplateId = enumerator.Current.TemplateId, Tid = enumerator.Current.Tid, type = enumerator.Current.type, Url = enumerator.Current.Url, Id = enumerator.Current.Id }; if (enumerator.Current.Tid == (int)EnumZXTid.走势图) { tmp.Url = string.Format("/zs/{0}_{1}.htm", tmp.Cid, tmp.Id); } if (enumerator.Current.Tid == (int)EnumZXTid.遗漏) { tmp.Url = string.Format("/yl/{0}_{1}.htm", tmp.Cid, tmp.Id); } list.Add(tmp); } return list; } catch (Exception ee) { LogHelper.Error(typeof(TrendChastApiBLL), "GetTrendChart" + ee.Message); return null; } } public static List GetTrendChartChache(int cid, int tid) { try { var data = AppCtrl.GetObj().GetTrendChartCache().GetTrendChart(tid, cid); var enumerator = data.GetEnumerator(); List list = new List(); while (enumerator.MoveNext()) { ZXViewModel tmp = new ZXViewModel() { Status = enumerator.Current.Status, Cid = enumerator.Current.Cid, hDescription = enumerator.Current.hDescription, hKeywords = enumerator.Current.hKeywords, hTitle = enumerator.Current.hTitle, Name = enumerator.Current.Name, OrderBy = enumerator.Current.OrderBy, TemplateId = enumerator.Current.TemplateId, Tid = enumerator.Current.Tid, type = enumerator.Current.type, Url = enumerator.Current.Url, Id = enumerator.Current.Id }; if (enumerator.Current.Tid == (int)EnumZXTid.走势图) { tmp.Url = string.Format("/zs/{0}_{1}.htm", tmp.Cid, tmp.Id); } if (enumerator.Current.Tid == (int)EnumZXTid.遗漏) { tmp.Url = string.Format("/yl/{0}_{1}.htm", tmp.Cid, tmp.Id); } list.Add(tmp); } return list; } catch (Exception ee) { LogHelper.Error(typeof(TrendChastApiBLL), ee.Message +":GetTrendChartChache"); return null; } } public static List GetTrendChart(List cid,List tid) { try { var data = TrendChartBLL.GetTrendChart(cid, tid); List list = new List(); var enumerator = data.GetEnumerator(); while (enumerator.MoveNext()) { ZXViewModel tmp = new ZXViewModel() { Status = enumerator.Current.Status, Cid = enumerator.Current.Cid, hDescription = enumerator.Current.hDescription, hKeywords = enumerator.Current.hKeywords, hTitle = enumerator.Current.hTitle, Name = enumerator.Current.Name, OrderBy = enumerator.Current.OrderBy, TemplateId = enumerator.Current.TemplateId, Tid = enumerator.Current.Tid, type = enumerator.Current.type, Url = enumerator.Current.Url, Id = enumerator.Current.Id }; if (enumerator.Current.Tid == (int)EnumZXTid.走势图) { tmp.Url = string.Format("/zs/{0}_{1}.htm", tmp.Cid, tmp.Id); } if (enumerator.Current.Tid == (int)EnumZXTid.遗漏) { tmp.Url = string.Format("/yl/{0}_{1}.htm", tmp.Cid, tmp.Id); } list.Add(tmp); } return list; } catch (Exception ee) { LogHelper.Error(typeof(TrendChastApiBLL), "GetTrendChart" + ee.Message); return null; } } } }