using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CB.Framework; using CB.Common; using System.Text; using CB.Entity; using System.Text.RegularExpressions; namespace CB.Wap { public partial class list : WebPage { protected StringBuilder sp = new StringBuilder(); protected string lotteryName = ""; protected void Page_Load(object sender, EventArgs e) { InitData(); header1.ColumnName = lotteryName; } protected override void InitData() { var cid = WRequest.GetQueryInt("cid"); var lottery = CB.Data.Caches.GetLotteryInfo(cid); if (null == lottery) { ShowError(); return; } lotteryName = lottery.Name; var css = GetLotteryLogoCss(lottery.Cid); //switch (lottery.Id) //{ // case 1: // css = "fc3d"; // break; // case 2: // css = "p3"; // break; // case 3: // css = "p5"; // break; // case 4: // css = "ssq"; // break; // case 5: // css = "qlc"; // break; // case 9: // css = "22x5"; // break; // case 12: // css = "dlt"; // break; // case 19: // css = "qxc"; // break; // default: // css = "fc3d"; // break; //} var list = CB.Data.Caches.GetTrendChartList(cid, 2001, 0); if (null != list && 0 < list.Count) { sp.Append("
"); sp.AppendFormat("

走势图

", css); sp.Append("
"); sp.Append("
"); //modified by zizi,at 2016-6-13 //新增地方彩和高频彩后限制输出内容,补齐缺失列 int z = 1; foreach (var item in list) { var exceptionCids = new int[] {15, 20}; var splitCid = 29; if ((lottery.Cid < splitCid && !exceptionCids.Contains(lottery.Cid) && !item.Name.Contains("手机版")) || ((lottery.Cid >= splitCid || exceptionCids.Contains(lottery.Cid)) && item.Name.Contains("手机版"))) { if (z%3 == 1) { sp.Append("
    "); } var _name = LotteryNameReplace(item.Name, lottery.Name); //TODO: 2016-7-15 保持移动端和pc端的地址一致 var _id = MobPcConvert.GetSyncIdFromM(item.Id); if (_id == 0) _id = item.Id; sp.AppendFormat("
  • {0}{1}
  • ", // style=\"color:#2574c5\" //Regex.Replace(item.Name, "^" + lottery.Name, "", RegexOptions.IgnoreCase), _name, GetTrendChartStatus(item.Status), item.Cid, _id);//item.Id); if (z%3 == 0)//|| z == list.Count) { //if (z == list.Count && list.Count%3 != 0) //{ // int ts = 3 - list.Count%3; // for (int j = 0; j < ts; j++) // { // sp.Append("
  • "); // } //} sp.Append("
"); } z++; } } var n1 = (z-1)%3; if (n1 > 0 && z > 3) { for (int j = n1; j < 3; j++) { sp.Append("
  • "); } sp.Append(""); } sp.Append("
    "); } list = CB.Data.Caches.GetTrendChartList(cid, 2002, 0); if (null != list && 0 < list.Count) { sp.Append("
    "); sp.AppendFormat("

    缩水工具

    ", css); sp.Append("
    "); sp.Append("
    "); int s = 1; foreach (var item in list) { if (s % 3 == 1) { sp.Append("
      "); } sp.AppendFormat("
    • {0}{1}
    • ",// style=\"color:#2574c5\" Regex.Replace(item.Name, "^" + lottery.Name, "", RegexOptions.IgnoreCase), GetTrendChartStatus(item.Status), item.Url); if (s % 3 == 0 || s == list.Count) { if (s == list.Count && list.Count % 3 != 0) { int ts = 3 - list.Count % 3; for (int j = 0; j < ts; j++) { sp.Append("
    • "); } } sp.Append("
    "); } s++; } sp.Append("
    "); } list = CB.Data.Caches.GetTrendChartList(cid, 2003, 0); if (null != list && 0 < list.Count) { sp.Append("
    "); sp.AppendFormat("

    遗漏

    ", css); sp.Append("
    "); sp.Append("
    "); int y = 1; foreach (var item in list) { if (y % 3 == 1) { sp.Append("
      "); } sp.AppendFormat("
    • {0}{1}
    • ",// style=\"color:#2574c5\" Regex.Replace(item.Name, "^" + lottery.Name, "", RegexOptions.IgnoreCase), GetTrendChartStatus(item.Status), item.Cid, item.Id); if (y % 3 == 0 || y == list.Count) { if (y == list.Count && list.Count % 3 != 0) { int ts = 3 - list.Count % 3; for (int j = 0; j < ts; j++) { sp.Append("
    • "); } } sp.Append("
    "); } y++; } sp.Append("
    "); } list = CB.Data.Caches.GetTrendChartList(cid, 2004, 0); if (null != list && 0 < list.Count) { sp.Append("
    "); sp.AppendFormat("

    图表

    ", css); sp.Append("
    "); sp.Append("
    "); int tb = 1; foreach (var item in list) { if (tb % 3 == 1) { sp.Append("
      "); } sp.AppendFormat("
    • {0}{1}
    • ",// style=\"color:#2574c5\" Regex.Replace(item.Name, "^" + lottery.Name, "", RegexOptions.IgnoreCase), GetTrendChartStatus(item.Status), item.Cid, item.Id); if (tb % 3 == 0 || tb == list.Count) { if (tb == list.Count && list.Count % 3 != 0) { int ts = 3 - list.Count % 3; for (int j = 0; j < ts; j++) { sp.Append("
    • "); } } sp.Append("
    "); } tb++; } sp.Append("
    "); } list = CB.Data.Caches.GetTrendChartList(); List nlist = list.Where(it=>it.Status==TrendChartStatus.Hot).ToList(); if (null != nlist && 0 < nlist.Count) { sp.Append("
    "); sp.AppendFormat("

    热门专题

    ", css); sp.Append("
    "); sp.Append("
    "); int tb = 1; foreach (var item in nlist) { if (tb % 3 == 1) { sp.Append("
      "); } sp.AppendFormat("
    • {0}{1}
    • ",// style=\"color:#2574c5\" Regex.Replace(item.Name, "^" + lottery.Name, "", RegexOptions.IgnoreCase), GetTrendChartStatus(item.Status), item.Cid, item.Id); if (tb % 3 == 0 || tb == list.Count) { if (tb == list.Count && list.Count % 3 != 0) { int ts = 3 - list.Count % 3; for (int j = 0; j < ts; j++) { sp.Append("
    • "); } } sp.Append("
    "); } tb++; } sp.Append("
    "); } base.InitData(); } private string GetTrendChartStatus(TrendChartStatus status) { switch (status) { case TrendChartStatus.New: return ""; case TrendChartStatus.Hot: return ""; } return ""; } } }