private void auswertungsButton_Click(object sender, EventArgs e) { ergebnisse.Text = ""; int [] ziehungZahlen = new int[6]; int ziehungSuperzahl = (int)this.superzahl.Value; for (int i = 0; i < tableLayoutPanel1.ColumnCount; i++) { ziehungZahlen[i] = (int)((NumericUpDown)tableLayoutPanel1.GetControlFromPosition(i, 0)).Value; } Lottoschein lotto = new Lottoschein(losnummer.Text); for (int i = 0; i < tippsPanel.RowCount; i++) { if (((CheckBox)tippsPanel.GetControlFromPosition(0, i)).Checked == true) { int[] foo = new int[6]; for (int j = 1; j < tippsPanel.ColumnCount; j++) { foo[j - 1] = Convert.ToInt32(((NumericUpDown)tippsPanel.GetControlFromPosition(j, i)).Value); } lotto.Add(i + 1, foo); } } Ziehung z = new Ziehung(ziehungZahlen, ziehungSuperzahl, aktuelleZiehung.Value); GewinnklassenRechner ziehungsAuswertung = new GewinnklassenRechner(lotto, ziehungZahlen, ziehungSuperzahl); // GewinnklassenRechner ziehungsAuswertung = new GewinnklassenRechner(_database.LeseLottoscheinAusDb(), ziehungZahlen, ziehungSuperzahl); foreach (string s in ziehungsAuswertung.GetErgebnisse()) { ergebnisse.AppendText(s + "\n"); } // _database.SchreibeZiehungInDb(z); }
private void abschickenbutton_Click(object sender, EventArgs e) { int lz = 1; try { lz = Convert.ToInt32(laufzeit.SelectedItem); } catch (Exception) { } Lottoschein lotto = new Lottoschein( losnummer.Text, Abgabedatum.Value, Samstag.Checked, Mittwoch.Checked, spiel77.Checked, super6.Checked, lz ); for (int i = 0; i < tippsPanel.RowCount; i++) { if (((CheckBox)tippsPanel.GetControlFromPosition(0, i)).Checked == true) { int [] foo = new int[6]; for (int j = 1; j < tippsPanel.ColumnCount; j++) { foo[j - 1] = Convert.ToInt32(((NumericUpDown)tippsPanel.GetControlFromPosition(j, i)).Value); } lotto.Add(i, foo); } } _database.SchreibeLottoscheinInDb(lotto); }
public DBDummy() { _lottoDummy.Add(1, new int[] { 12, 15, 39, 49, 27, 30 }); }