using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Text; using CB.Common; using CB.Entity; using CB.Framework; namespace CB.Web.Kjh.shijihao { public partial class _3dlist : WebPage { protected string navstr = ""; protected DateTime date = DateTime.Now; protected StringBuilder sp = new StringBuilder(); protected void Page_Load(object sender, EventArgs e) { InitData(); } protected override void InitData() { var info = CB.Data.Caches.GetFC3DInfo(0, OpenCodeType.KaiJiangHao); if (null != info) { date = info.OpenTime; } var num = WRequest.GetQueryInt("num",-1); var topSize = WRequest.GetQueryInt("topsize"); var year = WRequest.GetQueryInt("year"); IList list; if (0 <= num) { navstr = num + "号码"; list = CB.Data.Caches.GetFC3DListByNumber(num.ToString(), OpenCodeType.ShiJiHao); } else if (0 < year) { navstr = year.ToString() + "年"; list = CB.Data.Caches.GetFC3DListByYear(year, OpenCodeType.ShiJiHao); } else { List n = new List(new int[] { 20, 50, 80, 100 }); if (!n.Contains(topSize)) topSize = 20; navstr = "近" + topSize.ToString() + "期"; list = CB.Data.Caches.GetFC3DList(topSize, OpenCodeType.ShiJiHao); } if (null != list && 0 < list.Count) { int i = 1; IList d; foreach (var item in list) { d = item.ShiJiHao.ToIntArray(','); if (null == d) break; if (i > 0 && 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.GetProportionOfJO(d) + ""); sp.AppendLine(" " + CB.Common.LotteryUtils.GetProportionOfDX(d, 5) + ""); sp.AppendLine(" " + CB.Common.LotteryUtils.GetSpan(d).ToString() + ""); sp.AppendLine(" "); i++; } } base.InitData(); } } }