using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CB.Common; using CB.Data; using CB.Entity; using CB.Framework; namespace CB.Web.Kjh.History { public partial class p3 : WebPage { protected string Html = "", SelectHtml = "", Qishu = "", LastTerm = "", PageTitle = ""; private int year = 0, topsize = 0, newterm = 0; protected void Page_Load(object sender, EventArgs e) { InitData(); } protected override void InitData() { TCP3Info entity = Caches.GetTCP3Info(0, OpenCodeType.KaiJiangHao); if (entity == null) { ShowError(); return; } kjsj = entity.OpenTime.ToString("yyyy年MM月dd日"); djsj = entity.OpenTime.AddDays(60).ToString("yyyy年MM月dd日"); LastTerm = entity.Term.ToString(); year = WRequest.GetQueryInt("year", 0); topsize = WRequest.GetQueryInt("topsize", 0); newterm = WRequest.GetQueryInt("newterm", 0); List lists = new List(); if (year > 0) { lists = Caches.GetTCP3List(0, 0, year); PageTitle = year.ToString() + "年"; } else if (topsize == 50 || topsize == 80 || topsize == 120) { lists = Caches.GetTCP3List(topsize, 0, 0); PageTitle = "近" + topsize.ToString() + "期"; } else if (newterm > 0) { lists = Caches.GetTCP3List(0, newterm, 0); } else { lists = Caches.GetTCP3List(15, 0, 0); PageTitle = "近15期"; } Html = GetKjhHistotry(lists); lotMuen = GetLotMunes(); InitSelectYear(); base.InitData(); } /// /// 初始化下拉年份 /// private void InitSelectYear() { int minYear = 2004; int nowYear = DateTime.Now.Year; SelectHtml = @""; string style = "class='redQishu'"; Qishu = "近50期" + "近80期" + "近120期"; } private string GetKjhHistotry(List lists) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < lists.Count; i++) { //291740962,42 5356078^一等奖|7|7072680,二等奖|183|99103,三等奖|1465|3000,四等奖|64270|200,五等奖|1089509|10,六等奖|8453034|5 List money = lists[i].Detail.Split('^').ToList()[0].Split(',').ToList(); List bonus = lists[i].Detail.Split('^').ToList()[1].Split(',').ToList(); //if (money[1].Length == 8) money[1] = "0" + money[1]; //string jiangci = (money[1].Length > 8 ? money[1].Substring(0, money[1].Length - 7) : ""); //if (jiangci.Length > 0) // jiangci = jiangci.Substring(0, jiangci.Length - 1) + "." + jiangci.Substring(jiangci.Length - 1, 1); string trclass = ""; if (i % 2 == 0) trclass = "bg_grey"; sb.Append(@" " + lists[i].Term + @" " + lists[i].OpenTime.ToString("yyyy.MM.dd") + @"
  • " + lists[i].OpenCode1 + @"
  • " + lists[i].OpenCode2 + @"
  • " + lists[i].OpenCode3 + @"
" + money[0] + @" " + bonus[0].Split('|')[1] + @"注" + bonus[0].Split('|')[2] + @"元 " + bonus[1].Split('|')[1] + @"注" + bonus[1].Split('|')[2] + @"元 " + bonus[2].Split('|')[1] + @"注" + bonus[2].Split('|')[2] + @"元 详情走势 "); } return sb.ToString(); } } }