private void createTournamentButton_Click(object sender, EventArgs e)
        {
            decimal fee         = 0;
            bool    validateFee = decimal.TryParse(entryFeeValue.Text, out fee);

            if (!validateFee)
            {
                MessageBox.Show("Enter valid fee", "invalid fee", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            TournamentModel tm = new TournamentModel();

            tm.TournamentName = tournamentNameValue.Text;
            tm.EntryFee       = fee;

            tm.Prizes     = selectedPrizes;
            tm.teamModels = selectedTeams;

            TournamentLogic.CreateRounds(tm);

            GlobalConfig.Connection.CreateTournament(tm);

            tm.AlertUsersToNewRound();

            TournamentViewerForm form = new TournamentViewerForm(tm);

            form.Show();
            this.Close();
        }
Ejemplo n.º 2
0
        private void loadTournamentButton_Click(object sender, EventArgs e)
        {
            TournamentModel      tm   = (TournamentModel)selectExistingTournamentComboFix.SelectedItem;
            TournamentViewerForm form = new TournamentViewerForm(tm);

            form.Show();
        }