list.aspx.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using CB.Common;
  8. using CB.Framework;
  9. using System.Text.RegularExpressions;
  10. namespace CB.Wap.tb
  11. {
  12. public partial class list : WebPage
  13. {
  14. //走势图表
  15. protected string hTitle = "", hDescription = "", hKeywords = "";
  16. protected string chartData = "", chartName = "", recommend = "";
  17. //彩种相关
  18. protected string lotName = "", lotLogoCsss = "";
  19. protected string ShowtrendMenu = "", HidetrendMenu="";
  20. protected string navStr = "";
  21. protected void Page_Load(object sender, EventArgs e)
  22. {
  23. InitData();
  24. header1.ColumnName = lotName;
  25. }
  26. protected override void InitData()
  27. {
  28. int chartid = WRequest.GetQueryInt("chartid");
  29. if (0 >= chartid)
  30. { ShowError(); return; }
  31. var entity = CB.Data.Caches.GetTrendChartInfo(chartid);
  32. if (null == entity)
  33. { ShowError(); return; }
  34. chartName = entity.Name;
  35. hTitle = entity.hTitle;
  36. hDescription = entity.hDescription;
  37. hKeywords = entity.hKeywords;
  38. //this.header1.ColumnName = chartName;
  39. var lottery = CB.Data.Caches.GetLotteryInfo(entity.Cid);
  40. if (null != lottery)
  41. {
  42. lotName = lottery.Name;
  43. lotLogoCsss = GetLotteryLogoCss(entity.Cid);
  44. navStr = string.Format("<a href=\"/tb/{0}_{1}.htm\">{2}</a> - {3}", lottery.Id, chartid, lotName, chartName);
  45. }
  46. var list = CB.Data.Caches.GetTrendChartList(entity.Cid, 2004, 0);
  47. if (list.Count > 0)
  48. {
  49. for (int i = 0; i < list.Count; i++)
  50. {
  51. //modified by zizi at 2016-5-25
  52. var _name = LotteryNameReplace(list[i].Name, lottery.Name);//Regex.Replace(list[i].Name, "^" + lottery.Name, "", RegexOptions.IgnoreCase);
  53. ShowtrendMenu += "<li><a href=\"/tb/" + list[i].Cid + "_" + list[i].Id + ".htm\">" + _name + "</a></li>";
  54. if (list[i].Id == chartid)
  55. lotName = lottery.Name + _name;
  56. //if (i < 3)
  57. //{
  58. // ShowtrendMenu += "<li><a href=\"/tb/" + list[i].Cid + "_" + list[i].Id + ".htm\">" + Regex.Replace(list[i].Name, "^" + lottery.Name, "", RegexOptions.IgnoreCase) + "</a></li>";
  59. //}
  60. //else
  61. //{
  62. // HidetrendMenu += "<li><a href=\"/tb/" + list[i].Cid + "_" + list[i].Id + ".htm\">" + Regex.Replace(list[i].Name, "^" + lottery.Name, "", RegexOptions.IgnoreCase) + "</a></li>";
  63. //}
  64. }
  65. }
  66. else
  67. {
  68. ShowtrendMenu = "";
  69. }
  70. UpdateTrendSmart(entity.Id);
  71. chartData = BuildTemplateData(entity.TemplateId, null);
  72. var viewbag = new Dictionary<string, object>();
  73. viewbag.Add("lotTitle", "热门推荐");
  74. recommend = SmartRecommend(chartid, entity, lottery.Name, "电脑版遗漏", viewbag);
  75. base.InitData();
  76. }
  77. }
  78. }