Ejemplo n.º 1
0
        private void createTournamentButton_Click(object sender, EventArgs e)
        {
            // Validate data
            decimal fee = 0;

            bool feeAccepable = decimal.TryParse(entryFeeValue.Text, out fee);

            if (!feeAccepable)
            {
                MessageBox.Show("You need to enter a valid Entry Fee.",
                                "Invalid Fee",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);

                return;
            }
            // Create our tournament model
            TournamentModel tm = new TournamentModel();

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

            tm.Prizes       = selectedPrizes;
            tm.EnteredTeams = selectTeams;

            // Wire our matchups
            TournamentLogic.CreatRounds(tm);

            // Create Tournament entry
            // Create all of the prizes entries
            // Create all of the team entries
            GlobalConfig.Connection.CreateTournament(tm);
        }