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.Wap.column { public partial class tool_3dsjhcx : WebPage { protected string columnName = "", css = "", openDay = "", openInfo = "", columnAbout, SelectHtml, Qishu, Info = "", logo = ""; protected string columnNav = ""; protected StringBuilder sp = new StringBuilder(); protected void Page_Load(object sender, EventArgs e) { InitData(); } protected override void InitData() { var entity = CB.Data.Caches.GetColumnInfo("3dsjhcx"); if (null == entity) { ShowError(); return; } columnName = entity.Name; columnAbout = entity.About; logo = entity.Logo; pageTitle = entity.hTitle; pageKeyWords = entity.hKeywords; pageDescription = entity.hDescription; this.header1.ColumnName = entity.Name; int term = WRequest.GetQueryInt("term", 0); int year = WRequest.GetQueryInt("year", 0); int topsize = WRequest.GetQueryInt("topsize", 0); const int minYear = 2002; int nowYear = DateTime.Now.Year; SelectHtml = @""; var qis = new List() { 20, 50, 80, 120 }; Qishu = @""; //Qishu = "近20期" + // "近50期" + // "近80期" + // "近120期"; List list; if (minYear <= year && year <= nowYear) { list = Caches.GetFC3DList(0, 0, year); Info = year.ToString() + "年"; } else if (topsize == 20 || topsize == 50 || topsize == 80 || topsize == 120) { list = Caches.GetFC3DList(topsize, 0, 0); Info = "近" + topsize.ToString() + "期"; } else if (term > 0) { list = Caches.GetFC3DList(0, term, 0); Info = term.ToString() + "期"; } else { list = Caches.GetFC3DList(10, 0, 0); Info = "近10期"; } //var list = Caches.GetFC3DList(topsize, OpenCodeType.ShiJiHao); if (null != list && 0 < list.Count) { int i = 1; foreach (var item in list) { IList d = item.ShiJiHao.ToIntArray(','); if (null == d) break; if (0 == i % 2) { sp.AppendLine(" "); } else { sp.AppendLine(" "); } sp.AppendLine(" " + item.Term.ToString() + ""); sp.AppendLine(" " + item.OpenTime.ToString("yyyy.MM.dd") + ""); sp.AppendLine(" " + item.ShiJiHao.Replace(",", ",") + ""); sp.AppendLine(" " + CB.Common.LotteryUtils.GetSum(d).ToString() + ""); if (0 <= item.OpenCode1) { sp.AppendLine(" " + item.OpenCode1 + "," + item.OpenCode2 + "," + item.OpenCode3 + ""); sp.AppendLine(" " + CB.Common.LotteryUtils.GetSum(item.OpenCode).ToString() + ""); sp.AppendLine(" " + GetContains(item.OpenCode, item.ShiJiHao) + ""); } else { sp.AppendLine(" ---"); sp.AppendLine(" ---"); sp.AppendLine(" ---"); } sp.AppendLine(" "); i++; } } columnNav = GetColumnNavForWap(entity.Lottery); base.InitData(); } private string GetContains(IList list, string numbers) { if (null == list || 0 >= list.Count || string.IsNullOrEmpty(numbers)) return ""; IList d = numbers.ToIntArray(','); if (null == d || 0 >= d.Count) return ""; int i = 0; foreach (var item in d) { if (list.Contains(item)) i++; } return 0 == i ? "" : i.ToString(); } } }