Example #1
0
        private void draw_Click(object sender, RoutedEventArgs e) {
            try
            {
                int rounds = int.Parse(roundsNum.Text);

                BLLotto lotto = new BLLotto();

                if (comboBox.SelectedItem == "SuomiLotto") {
                    for (int roundsLimit = 0; roundsLimit < rounds; roundsLimit++) {
                        listBox.Items.Add(lotto.SuomiLotto());
                    }
                } else if(comboBox.SelectedItem == "VikingLotto") {
                    for (int roundsLimit = 0; roundsLimit < rounds; roundsLimit++)
                    {
                        listBox.Items.Add(lotto.VikingLotto());
                    }
                } else if (comboBox.SelectedItem == "Eurojackpot") {
                    for (int roundsLimit = 0; roundsLimit < rounds; roundsLimit++)
                    {
                        listBox.Items.Add(lotto.Eurojackpot());
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #2
0
        private void draw_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                int rounds = int.Parse(roundsNum.Text);

                BLLotto lotto = new BLLotto();

                if (comboBox.SelectedItem == "SuomiLotto")
                {
                    for (int roundsLimit = 0; roundsLimit < rounds; roundsLimit++)
                    {
                        listBox.Items.Add(lotto.SuomiLotto());
                    }
                }
                else if (comboBox.SelectedItem == "VikingLotto")
                {
                    for (int roundsLimit = 0; roundsLimit < rounds; roundsLimit++)
                    {
                        listBox.Items.Add(lotto.VikingLotto());
                    }
                }
                else if (comboBox.SelectedItem == "Eurojackpot")
                {
                    for (int roundsLimit = 0; roundsLimit < rounds; roundsLimit++)
                    {
                        listBox.Items.Add(lotto.Eurojackpot());
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }