private void GetSZPL3Miss() { string key = "Home_Room_Buy_GetSZPL3Miss"; this.lbMiss.Text = Shove._Web.Cache.GetCacheAsString(key, ""); if (this.lbMiss.Text == "") { DataTable table = new Tables.T_Isuses().Open("top 100 EndTime,WinLotteryNumber", "LotteryID = 63 and GETDATE()>EndTime and ISNULL(WinLotteryNumber,'')<>'' and IsOpened=1", "EndTime desc"); if (table == null) { new Log("System").Write(base.GetType().FullName + "数据库繁忙,请重试(GetSZPL3Miss)"); } else { int[,] numArray = new int[3, 10]; int num = 0; foreach (DataRow row in table.Select("", "EndTime asc")) { string str2 = row["WinLotteryNumber"].ToString(); if (str2.Length == 3) { for (int i = 0; i < str2.Length; i++) { int num4 = _Convert.StrToInt(str2.Substring(i, 1), 0); for (int j = 0; j < 10; j++) { if (j == num4) { numArray[i, j] = 0; } else { numArray[i, j]++; } } } } } foreach (DataRow row2 in table.Select("1=1", "EndTime desc")) { if (this.FilterRepeated(row2["WinLotteryNumber"].ToString()).Length == 2) { break; } num++; } this.lbMiss.Text = this.GetSZPL3Miss(numArray) + "|" + num.ToString(); Shove._Web.Cache.SetCache(key, this.lbMiss.Text, 600); } } }
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); } }