private void GetSZPL3Miss() { string Key = "Home_Room_Buy_GetSZPL3Miss"; lbMiss.Text = Shove._Web.Cache.GetCacheAsString(Key, ""); if (lbMiss.Text == "") { DataTable dt = new DAL.Tables.T_Isuses().Open("top 100 EndTime,WinLotteryNumber", "LotteryID = 63 and GETDATE()>EndTime and ISNULL(WinLotteryNumber,'')<>'' and IsOpened=1", "EndTime desc"); if (dt == null) { new Log("System").Write(this.GetType().FullName + "数据库繁忙,请重试(GetSZPL3Miss)"); return; } int[,] SZPL3 = new int[3, 10]; int Zu3MissCount = 0; string WinLotteryNumber; int WinNumber; DataRow[] drs = dt.Select("", "EndTime asc"); foreach (DataRow dr in drs) { WinLotteryNumber = dr["WinLotteryNumber"].ToString(); if (WinLotteryNumber.Length != 3) { continue; } for (int i = 0; i < WinLotteryNumber.Length; i++) { WinNumber = Shove._Convert.StrToInt(WinLotteryNumber.Substring(i, 1), 0); for (int j = 0; j < 10; j++) { if (j == WinNumber) { SZPL3[i, j] = 0; } else { SZPL3[i, j]++; } } } } drs = dt.Select("1=1", "EndTime desc"); foreach (DataRow dr in drs) { if (FilterRepeated(dr["WinLotteryNumber"].ToString()).Length == 2) { break; } Zu3MissCount++; } lbMiss.Text = GetSZPL3Miss(SZPL3) + "|" + Zu3MissCount.ToString(); Shove._Web.Cache.SetCache(Key, lbMiss.Text, 600); } }
private void Get3DBaoDianMiss() { string Key = "Home_Room_Buy_Get3DBaoDianMiss"; lbMiss.Text = Shove._Web.Cache.GetCacheAsString(Key, ""); lbMiss.Text = ""; if (lbMiss.Text == "") { DataTable dt = new DAL.Tables.T_Isuses().Open("EndTime,WinLotteryNumber", "LotteryID = 6 and GETDATE()>EndTime and ISNULL(WinLotteryNumber,'')<>'' and IsOpened=1", "EndTime asc"); if (dt == null) { new Log("System").Write(this.GetType().FullName + "数据库繁忙,请重试(Get3DBaoDianMiss)"); return; } int[] Miss = new int[28]; int[] LiLunMiss = new int[] { 1000, 333, 167, 100, 67, 48, 36, 28, 22, 18, 16, 14, 14, 13, 13, 14, 14, 16, 18, 22, 28, 36, 48, 67, 100, 167, 333, 1000 }; string WinLotteryNumber; int WinNumber; foreach (DataRow dr in dt.Rows) { WinLotteryNumber = dr["WinLotteryNumber"].ToString(); WinNumber = 0; if (WinLotteryNumber.Length != 3) { continue; } for (int i = 0; i < WinLotteryNumber.Length; i++) { WinNumber += Shove._Convert.StrToInt(WinLotteryNumber.Substring(i, 1), 0); } for (int i = 0; i < Miss.Length; i++) { if (i == WinNumber) { Miss[i] = 0; } else { Miss[i]++; } } } double scaleMax = 0; double scale = 0; for (int i = 0; i < 28; i++) { scale = Shove._Convert.StrToDouble(Miss[i].ToString(), 0); if (scale / LiLunMiss[i] >= scaleMax) { scaleMax = scale / LiLunMiss[i]; } } StringBuilder sb = new StringBuilder(); int count = Miss.Length / 14; for (int i = 0; i < count; i++) { sb.Append(" <table border=\"0\" cellpadding=\"0\" cellspacing=\"4\">") .Append("<tr>") .Append("<td class='blue' width='80px' align='center'>") .Append("本期遗漏") .Append("</td>"); for (int j = i * 14; j < (i + 1) * 14; j++) { if (Shove._Convert.StrToDouble(Miss[j].ToString(), 0) / LiLunMiss[j] >= scaleMax) { sb.Append("<td class='red12'>"); } else { sb.Append("<td class='hui12'>"); } sb.Append(Miss[j].ToString()) .Append("</td>"); } sb.Append("</tr>") .Append("<tr>") .Append("<td class='blue' width='80px' align='center'>") .Append("理论遗漏") .Append("</td>"); for (int j = i * 14; j < (i + 1) * 14; j++) { if (Shove._Convert.StrToDouble(Miss[j].ToString(), 0) / LiLunMiss[j] >= scaleMax) { sb.Append("<td class='red12'>"); } else { sb.Append("<td class='hui12'>"); } sb.Append(LiLunMiss[j].ToString()) .Append("</td>"); } sb.Append("</tr>") .Append("</table>-"); } lbMiss.Text = sb.ToString(); Shove._Web.Cache.SetCache(Key, lbMiss.Text, 600); } }