Exemple #1
0
        private void CreateTournamentButton_Click(object sender, System.EventArgs e)
        {
            bool feeAcceptable = decimal.TryParse(EntryFeeValue.Text, out var fee);

            if (!feeAcceptable)
            {
                MessageBox.Show("Please enter rightly sum of fee", "Wrong fee entered", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            TournamentModel tournament = new TournamentModel();

            tournament.TournamentName = TournamentNameValue.Text;
            tournament.EnrtyFee       = fee;
            tournament.Prizes         = prizes;
            tournament.EnteredTeams   = selectedTeams;

            TournamentLogic.CreateRounds(tournament);

            GlobalConfig.Connections.CreateTournament(tournament);
            tournament.AlertUsersToNewRound();
            TournamentViewForm tform = new TournamentViewForm(tournament);

            tform.Show();
            this.Close();
        }
        private void LoadTournamentButton_Click(object sender, System.EventArgs e)
        {
            TournamentModel    tournament = (TournamentModel)LoadDropDownValue.SelectedItem;
            TournamentViewForm tform      = new TournamentViewForm(tournament);

            tform.Show();
        }