private void button3_Click(object sender, EventArgs e) { players.Clear(); PlayerLoader pl = new PlayerLoader(players); pl.ShowDialog(); pl.Dispose(); int n; BallDataInterface bdi; bdi = shuffler = new BallData_Random75(players.Count); for (n = 0; n < num_to_draw; n++) { int[] order; lists[n] = new List <Player>(); order = bdi.CallBalls(players.Count); for (int p = 0; p < players.Count; p++) { lists[n].Add(players[order[p] - 1]); } } label3.Text = players.Count.ToString(); }
private void button1_Click(object sender, EventArgs e) { Random r = new Random(); int n; BallDataInterface bdi; //for( n = 0; n < 5550; n++ ) for (n = 0; n < 5325; n++) { players.Add(new Player(r.Next(1000000000))); } bdi = shuffler = new BallData_Random75(players.Count); for (n = 0; n < num_to_draw; n++) { int[] order; lists[n] = new List <Player>(); order = bdi.CallBalls(players.Count); for (int p = 0; p < players.Count; p++) { lists[n].Add(players[order[p] - 1]); } } label3.Text = players.Count.ToString(); }
private void button7_Click(object sender, EventArgs e) { DataTable tmp = new DataTable(); String sql_script = INI.Default["Player Select"]["SQL Statement"].Value; String[] sql_commands = sql_script.Split(new char[] { ';' }); int n_command = 0; string card_column = INI.Default["Player Select"]["Card column name"].Value; string name_column = INI.Default["Player Select"]["Name column name"].Value; players.Clear(); for (n_command = 0; n_command < (sql_commands.Length - 1); n_command++) { StaticDsnConnection.dsn.ExecuteNonQuery(sql_commands[n_command]); } if (DsnSQLUtil.FillDataTable(StaticDsnConnection.dsn, tmp, sql_commands[n_command], true) != null) { // uhmm... } else { tmp = null; } if (tmp == null) { MessageBox.Show(StaticDsnConnection.dsn.Error, "SQL Error or No Data"); return; } foreach (DataRow row in tmp.Rows) { players.Add(new Player(0, row[card_column].ToString(), row[name_column].ToString())); } int n; player_shuffler = shuffler = new BallData_Random75(players.Count); for (n = 0; n < num_to_draw; n++) { int[] order; lists[n] = new List <Player>(); order = player_shuffler.CallBalls(players.Count); for (int p = 0; p < players.Count; p++) { lists[n].Add(players[order[p] - 1]); } } label3.Text = players.Count.ToString(); }