TrendChastApiBLL.cs 5.9 KB

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