TrendChastApiBLL.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. 
  2. using Business.TrendChart;
  3. using Cache;
  4. using Cache.Cache;
  5. using Common;
  6. using KJH55128_Rec.ViewModels;
  7. using Models.Entity.LotteryNumDB;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Linq;
  11. using System.Web;
  12. namespace KJH55128_Rec.Business.TrendChart
  13. {
  14. public static class TrendChastApiBLL
  15. {
  16. public static List<DT_Lottery> QueryAll()
  17. {
  18. return TrendChartBLL.QueryAll();
  19. }
  20. public static List<ZXViewModel> GetTrendChart(int cid, int tid)
  21. {
  22. try
  23. {
  24. var data = TrendChartBLL.GetTrendChart(cid, tid);
  25. var enumerator = data.GetEnumerator();
  26. List<ZXViewModel> list = new List<ZXViewModel>();
  27. while (enumerator.MoveNext())
  28. {
  29. ZXViewModel tmp = new ZXViewModel()
  30. {
  31. Status = enumerator.Current.Status,
  32. Cid = enumerator.Current.Cid,
  33. hDescription = enumerator.Current.hDescription,
  34. hKeywords = enumerator.Current.hKeywords,
  35. hTitle = enumerator.Current.hTitle,
  36. Name = enumerator.Current.Name,
  37. OrderBy = enumerator.Current.OrderBy,
  38. TemplateId = enumerator.Current.TemplateId,
  39. Tid = enumerator.Current.Tid,
  40. type = enumerator.Current.type,
  41. Url = enumerator.Current.Url,
  42. Id = enumerator.Current.Id
  43. };
  44. if (enumerator.Current.Tid == (int)EnumZXTid.走势图)
  45. {
  46. tmp.Url = string.Format("/zs/{0}_{1}.htm", tmp.Cid, tmp.Id);
  47. }
  48. if (enumerator.Current.Tid == (int)EnumZXTid.遗漏)
  49. {
  50. tmp.Url = string.Format("/yl/{0}_{1}.htm", tmp.Cid, tmp.Id);
  51. }
  52. list.Add(tmp);
  53. }
  54. return list;
  55. }
  56. catch (Exception ee)
  57. {
  58. LogHelper.Error(typeof(TrendChastApiBLL), "GetTrendChart" + ee.Message);
  59. return null;
  60. }
  61. }
  62. public static List<ZXViewModel> GetTrendChartChache(int cid, int tid)
  63. {
  64. try
  65. {
  66. var data = TrendChartCache.GetTrendChart(tid, cid);
  67. var enumerator = data.GetEnumerator();
  68. List<ZXViewModel> list = new List<ZXViewModel>();
  69. while (enumerator.MoveNext())
  70. {
  71. ZXViewModel tmp = new ZXViewModel()
  72. {
  73. Status = enumerator.Current.Status,
  74. Cid = enumerator.Current.Cid,
  75. hDescription = enumerator.Current.hDescription,
  76. hKeywords = enumerator.Current.hKeywords,
  77. hTitle = enumerator.Current.hTitle,
  78. Name = enumerator.Current.Name,
  79. OrderBy = enumerator.Current.OrderBy,
  80. TemplateId = enumerator.Current.TemplateId,
  81. Tid = enumerator.Current.Tid,
  82. type = enumerator.Current.type,
  83. Url = enumerator.Current.Url,
  84. Id = enumerator.Current.Id
  85. };
  86. if (enumerator.Current.Tid == (int)EnumZXTid.走势图)
  87. {
  88. tmp.Url = string.Format("/zs/{0}_{1}.htm", tmp.Cid, tmp.Id);
  89. }
  90. if (enumerator.Current.Tid == (int)EnumZXTid.遗漏)
  91. {
  92. tmp.Url = string.Format("/yl/{0}_{1}.htm", tmp.Cid, tmp.Id);
  93. }
  94. list.Add(tmp);
  95. }
  96. return list;
  97. }
  98. catch (Exception ee)
  99. {
  100. LogHelper.Error(typeof(TrendChastApiBLL), ee.Message +":GetTrendChartChache");
  101. return null;
  102. }
  103. }
  104. public static List<ZXViewModel> GetTrendChart(List<int> cid,List<int> tid)
  105. {
  106. try
  107. {
  108. var data = TrendChartBLL.GetTrendChart(cid, tid);
  109. List<ZXViewModel> list = new List<ZXViewModel>();
  110. var enumerator = data.GetEnumerator();
  111. while (enumerator.MoveNext())
  112. {
  113. ZXViewModel tmp = new ZXViewModel()
  114. {
  115. Status = enumerator.Current.Status,
  116. Cid = enumerator.Current.Cid,
  117. hDescription = enumerator.Current.hDescription,
  118. hKeywords = enumerator.Current.hKeywords,
  119. hTitle = enumerator.Current.hTitle,
  120. Name = enumerator.Current.Name,
  121. OrderBy = enumerator.Current.OrderBy,
  122. TemplateId = enumerator.Current.TemplateId,
  123. Tid = enumerator.Current.Tid,
  124. type = enumerator.Current.type,
  125. Url = enumerator.Current.Url,
  126. Id = enumerator.Current.Id
  127. };
  128. if (enumerator.Current.Tid == (int)EnumZXTid.走势图)
  129. {
  130. tmp.Url = string.Format("/zs/{0}_{1}.htm", tmp.Cid, tmp.Id);
  131. }
  132. if (enumerator.Current.Tid == (int)EnumZXTid.遗漏)
  133. {
  134. tmp.Url = string.Format("/yl/{0}_{1}.htm", tmp.Cid, tmp.Id);
  135. }
  136. list.Add(tmp);
  137. }
  138. return list;
  139. }
  140. catch (Exception ee)
  141. {
  142. LogHelper.Error(typeof(TrendChastApiBLL), "GetTrendChart" + ee.Message);
  143. return null;
  144. }
  145. }
  146. }
  147. }