private void LoadButton_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) { //Create tournament model TournamentModel tm = new TournamentModel(); decimal fee = 0; bool feeAcceptable = decimal.TryParse(entryFeeValue.Text, out fee); if (!feeAcceptable) { MessageBox.Show("You need to enter a valid Entry Fee", "Invalid Fee", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } tm.TournamentName = tournamentNameValue.Text; tm.EntryFee = fee; tm.Prizes = selectedPrizes; tm.EnteredTeamsList = selectedTeams; //TODO Wire up matchups TournamentLogic.CreateRounds(tm); //Create Tournament Entry //Create all of the prizes entries //create all of the team entries GlobalConfig.Connection.CreateTournament(tm); TournamentViewer frm = new TournamentViewer(tm); frm.Show(); this.Close(); }