123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
-
- 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<DT_Lottery> QueryAll()
- {
- return TrendChartBLL.QueryAll();
- }
- public static List<ZXViewModel> GetTrendChart(int cid, int tid)
- {
- try
- {
- var data = TrendChartBLL.GetTrendChart(cid, tid);
- var enumerator = data.GetEnumerator();
- List<ZXViewModel> list = new List<ZXViewModel>();
- 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<ZXViewModel> GetTrendChartChache(int cid, int tid)
- {
- try
- {
- var data = AppCtrl.GetObj().GetTrendChartCache().GetTrendChart(tid, cid);
- var enumerator = data.GetEnumerator();
- List<ZXViewModel> list = new List<ZXViewModel>();
- 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<ZXViewModel> GetTrendChart(List<int> cid,List<int> tid)
- {
- try
- {
- var data = TrendChartBLL.GetTrendChart(cid, tid);
- List<ZXViewModel> list = new List<ZXViewModel>();
- 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;
- }
- }
- }
- }
|