Esempio n. 1
0
        private void loadTournamentButton_Click(object sender, EventArgs e)
        {
            TournamentModel  tm  = (TournamentModel)loadExistingTournamentDropDown.SelectedItem;
            TournamentViewer frm = new TournamentViewer(tm);

            frm.Show();
        }
        private void createTournamentButton_Click(object sender, EventArgs e)
        {
            //Validate data

            if (ValidateForm())
            {
                //Create our tournament model
                TournamentModel tm = new TournamentModel();
                tm.TournamentName = tournamentNameValue.Text;
                tm.EntryFee       = decimal.Parse(entryFeeValue.Text);

                tm.Prizes       = selectedPrizes;
                tm.EnteredTeams = selectedTeams;

                // Wire up matchups
                TournamentLogic.CreateRounds(tm);


                //Create tournament entry, using tournamentName, EntryFee,
                //Create all of the prizes entries
                //Create all of the team entries
                GlobalConfig.Connection.CreateTournament(tm);

                tm.AlertUsersToNewRound();

                TournamentLogic.UpdateTournamentResults(tm);

                TournamentViewer frm = new TournamentViewer(tm);
                frm.Show();
                callingForm.TournamentComplete(tm);
                Close();
            }
        }