123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using CB.Common;
- using CB.Framework;
- using System.Text.RegularExpressions;
- namespace CB.Wap.tb
- {
- public partial class list : WebPage
- {
- //走势图表
- protected string hTitle = "", hDescription = "", hKeywords = "";
- protected string chartData = "", chartName = "", recommend = "";
- //彩种相关
- protected string lotName = "", lotLogoCsss = "";
- protected string ShowtrendMenu = "", HidetrendMenu="";
- protected string navStr = "";
- protected void Page_Load(object sender, EventArgs e)
- {
- InitData();
- header1.ColumnName = lotName;
- }
- protected override void InitData()
- {
- int chartid = WRequest.GetQueryInt("chartid");
- if (0 >= chartid)
- { ShowError(); return; }
- var entity = CB.Data.Caches.GetTrendChartInfo(chartid);
- if (null == entity)
- { ShowError(); return; }
- chartName = entity.Name;
- hTitle = entity.hTitle;
- hDescription = entity.hDescription;
- hKeywords = entity.hKeywords;
- //this.header1.ColumnName = chartName;
- var lottery = CB.Data.Caches.GetLotteryInfo(entity.Cid);
- if (null != lottery)
- {
- lotName = lottery.Name;
- lotLogoCsss = GetLotteryLogoCss(entity.Cid);
- navStr = string.Format("<a href=\"/tb/{0}_{1}.htm\">{2}</a> - {3}", lottery.Id, chartid, lotName, chartName);
- }
- var list = CB.Data.Caches.GetTrendChartList(entity.Cid, 2004, 0);
- if (list.Count > 0)
- {
- for (int i = 0; i < list.Count; i++)
- {
- //modified by zizi at 2016-5-25
- var _name = LotteryNameReplace(list[i].Name, lottery.Name);//Regex.Replace(list[i].Name, "^" + lottery.Name, "", RegexOptions.IgnoreCase);
- ShowtrendMenu += "<li><a href=\"/tb/" + list[i].Cid + "_" + list[i].Id + ".htm\">" + _name + "</a></li>";
- if (list[i].Id == chartid)
- lotName = lottery.Name + _name;
- //if (i < 3)
- //{
- // ShowtrendMenu += "<li><a href=\"/tb/" + list[i].Cid + "_" + list[i].Id + ".htm\">" + Regex.Replace(list[i].Name, "^" + lottery.Name, "", RegexOptions.IgnoreCase) + "</a></li>";
- //}
- //else
- //{
- // HidetrendMenu += "<li><a href=\"/tb/" + list[i].Cid + "_" + list[i].Id + ".htm\">" + Regex.Replace(list[i].Name, "^" + lottery.Name, "", RegexOptions.IgnoreCase) + "</a></li>";
- //}
- }
- }
- else
- {
- ShowtrendMenu = "";
- }
- UpdateTrendSmart(entity.Id);
- chartData = BuildTemplateData(entity.TemplateId, null);
- var viewbag = new Dictionary<string, object>();
- viewbag.Add("lotTitle", "热门推荐");
- recommend = SmartRecommend(chartid, entity, lottery.Name, "电脑版遗漏", viewbag);
- base.InitData();
- }
- }
- }
|