private void buttonLoadTournament_Click(object sender, EventArgs e) { var tournament = (TournamentModel)comboBoxLoadExistingTournament.SelectedItem; var tournamentViewerForm = new FormTournametViewer(tournament); tournamentViewerForm.Show(); }
private void buttonCreateTournament_Click(object sender, EventArgs e) { decimal fee = 0; bool feeAceptable = decimal.TryParse(textBoxEntryFee.Text, out fee); if (!feeAceptable) { MessageBox.Show("You need to enter Valid Entry Fee.", "Invalid Fee", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //Create tournament model var tournament = new TournamentModel(); tournament.TournamentName = textBoxTournamentName.Text; tournament.EntryFee = fee; tournament.Prizes = selectedPrizes; tournament.EnteredTeams = selectedTeams; // TODO - Wireup the matchups then we can save this tournament. TournamentLogic.CreateRounds(tournament); // Create tournament Entry // Create all prizes entries // Create all of team entries GlobalConfig.Connections.CreateTournament(tournament); tournament.AlertUsersToNewRounds(); var tournamentViewerForm = new FormTournametViewer(tournament); tournamentViewerForm.Show(); this.Close(); }