private void searchByPeriod() { clear(); foreach (DataRow row in gameDataTable.Rows) { if ((UInt16)row[0] < SearchFrom.Value || (UInt16)row[0] > SearchTo.Value) { continue; } var addRow = statSearchTable.NewRow(); addRow["회차"] = row["회차"]; addRow["당첨 번호"] = row["당첨 번호"]; Byte[] winNum = ToWinNum(addRow["당첨 번호"].ToString(), parseWithBonus); var stat = new lottoStat(winNum); String buffer = ""; for (int i = 0; i < 5; i++) { buffer += stat.LDigit[i].ToString() + " - "; } buffer += stat.LDigit[5].ToString(); addRow["끝수"] = buffer; Byte[] lCount = new byte[10]; foreach (var lDigit in stat.LDigit) { lCount[lDigit]++; } buffer = ""; for (int j = 0; j < 10; j++) { if (lCount[j] > 1) { buffer += "( "; foreach (var num in stat.winNum) { if (num % 10 == j) { buffer += num.ToString() + ", "; } } buffer = buffer.Remove(buffer.Length - 2); buffer += " ) "; } } addRow["같은 끝수"] = buffer; statSearchTable.Rows.Add(addRow); stats.Add(new lottoStat(winNum)); } setByStats(); collect(); }
private void searchLast() { clear(); for (int i = 0; i < LastPeriod.Value && i < gameDataTable.Rows.Count; i++) { var row = gameDataTable.Rows[i]; var addRow = statSearchTable.NewRow(); addRow["회차"] = row["회차"]; addRow["당첨 번호"] = row["당첨 번호"]; Byte[] winNum = ToWinNum(addRow["당첨 번호"].ToString(), parseWithBonus); var stat = new lottoStat(winNum); String buffer = ""; for (int j = 0; j < 5; j++) { buffer += stat.LDigit[j].ToString() + " - "; } buffer += stat.LDigit[5].ToString(); addRow["끝수"] = buffer; Byte[] lCount = new byte[10]; foreach (var lDigit in stat.LDigit) { lCount[lDigit]++; } buffer = ""; for (int j = 0; j < 10; j++) { if (lCount[j] > 1) { buffer += "( "; foreach (var num in stat.winNum) { if (num % 10 == j) { buffer += num.ToString() + ", "; } } buffer = buffer.Remove(buffer.Length - 2); buffer += " ) "; } } addRow["같은 끝수"] = buffer; statSearchTable.Rows.Add(addRow); stats.Add(new lottoStat(winNum)); } setByStats(); collect(); }