p3list.aspx.cs 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using System.Text;
  8. using CB.Common;
  9. using CB.Entity;
  10. using CB.Framework;
  11. namespace CB.Web.Kjh.shijihao
  12. {
  13. public partial class p3list : WebPage
  14. {
  15. protected string navstr = "";
  16. protected DateTime date = DateTime.Now;
  17. protected StringBuilder sp = new StringBuilder();
  18. protected void Page_Load(object sender, EventArgs e)
  19. {
  20. InitData();
  21. }
  22. protected override void InitData()
  23. {
  24. var info = CB.Data.Caches.GetTCP3Info(0, OpenCodeType.KaiJiangHao);
  25. if (null != info)
  26. { date = info.OpenTime; }
  27. var num = WRequest.GetQueryInt("num", -1);
  28. var topSize = WRequest.GetQueryInt("topsize");
  29. var year = WRequest.GetQueryInt("year");
  30. IList<TCP3Info> list;
  31. if (0 <= num)
  32. {
  33. navstr = num + "号码";
  34. list = CB.Data.Caches.GetTCP3ListByNumber(num.ToString(), OpenCodeType.ShiJiHao);
  35. }
  36. else if (0 < year)
  37. {
  38. navstr = year.ToString() + "年";
  39. list = CB.Data.Caches.GetTCP3ListByYear(year, OpenCodeType.ShiJiHao);
  40. }
  41. else
  42. {
  43. List<int> n = new List<int>(new int[] { 20, 50, 80, 100 });
  44. if (!n.Contains(topSize))
  45. topSize = 20;
  46. navstr = "近" + topSize.ToString() + "期";
  47. list = CB.Data.Caches.GetTCP3List(topSize, OpenCodeType.ShiJiHao);
  48. }
  49. if (null != list && 0 < list.Count)
  50. {
  51. int i = 1;
  52. IList<int> d;
  53. foreach (var item in list)
  54. {
  55. d = item.ShiJiHao.ToIntArray(',');
  56. if (null == d)
  57. break;
  58. if (i > 0 && 0 == i % 2)
  59. { sp.AppendLine(" <tr class=\"bg_grey\">"); }
  60. else
  61. { sp.AppendLine(" <tr>"); }
  62. sp.AppendLine(" <td>" + item.Term.ToString() + "</td>");
  63. sp.AppendLine(" <td>" + item.OpenTime.ToString("yyyy.MM.dd") + "</td>");
  64. sp.AppendLine(" <td><span>" + item.ShiJiHao.Replace(",", ",") + "</span></td>");
  65. sp.AppendLine(" <td>" + CB.Common.LotteryUtils.GetProportionOfJO(d) + "</td>");
  66. sp.AppendLine(" <td>" + CB.Common.LotteryUtils.GetProportionOfDX(d, 5) + "</td>");
  67. sp.AppendLine(" <td>" + CB.Common.LotteryUtils.GetSpan(d).ToString() + "</td>");
  68. sp.AppendLine(" </tr>");
  69. i++;
  70. }
  71. }
  72. base.InitData();
  73. }
  74. }
  75. }