private void scoreButton_Click(object sender, EventArgs e) { string errorMessage = ValidateData(); if (errorMessage != string.Empty) { MessageBox.Show($"Input Error: {errorMessage}"); return; } MatchupModel m = (MatchupModel)matchupListbox.SelectedItem; double teamOneScore = 0; double teamTwoScore = 0; for (int i = 0; i < m.Entries.Count; i++) { if (i == 0) { if (m.Entries[i].TeamCompeting != null) { if (double.TryParse(teamOneScoreValue.Text, out teamOneScore)) { m.Entries[i].Score = teamOneScore; } else { MessageBox.Show($"Please enter a valid score for team {i}"); return; } } } else { if (m.Entries[i].TeamCompeting != null) { if (double.TryParse(teamTwoScoreValue.Text, out teamTwoScore)) { m.Entries[i].Score = teamTwoScore; } else { MessageBox.Show($"Please enter a valid score for team {i}"); return; } } } } try { TournamentLogic.UpdateTournamentResults(tournament); } catch (Exception ex) { MessageBox.Show($"The application had the following error: {ex.Message}"); return; } LoadMatchups((int)roundDropdown.SelectedItem); }
private void CreateTournamentbutton_Click(object sender, EventArgs e) { // Validate data decimal fee = 0; bool feeAcceptable = decimal.TryParse(entryFeeValue.Text, out fee); if (!feeAcceptable) { MessageBox.Show("You need to enter a valid Entry Fee!", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; // Stop method`s work } //Create our tournament model TournamentModel tm = new TournamentModel(); tm.TournamentName = tournamentNameValue.Text; tm.EntryFee = 0; tm.Prizes = selectedPrizes; tm.EnteredTeams = selectedTeams; // TODO - Wire our matchups TournamentLogic.CreateRounds(tm); // Create tournament entry. // Create all of the prizes entries // create all of the entries GlobalConfig.Connection.CreateTournament(tm); }
private void createTournamentButton_Click(object sender, EventArgs e) { var tournament = new TournamentModel(); if (!ValidateForm()) { return; } var fee = decimal.Parse(entryFeeValue.Text); tournament.TournamentName = tournamentNameValue.Text; tournament.EntryFee = fee; tournament.EnteredTeams = new List <TeamModel>(selectedTeams); tournament.Prizes = new List <PrizeModel>(prizesList); TournamentLogic.CreateRounds(tournament); GlobalConfig.Connection.CreateTournament(tournament); tournament.AlertUsersToNewRound(); var form = new TournamentViewerForm(tournament); form.Show(); this.Close(); }
private void createTournamentBtn_Click(object sender, EventArgs e) { // Validate data decimal fee = 0; bool feeAcceptable = decimal.TryParse(entryFeeText.Text, out fee); if (!feeAcceptable) { MessageBox.Show("Need to enter valid entry fee", "Invalid Fee", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } // Create tournal model TournamentModel tm = new TournamentModel(); tm.TournamentName = tournamentNameText.Text; tm.EntryFee = fee; tm.Prizes = selectedPrizes; tm.EnteredTeams = selectedTeams; // TODO - Wireup matchups TournamentLogic.CreateRounds(tm); // Create tournament entry // Create all of the prizes entries // Create all of the team entries GlobalConfig.Connections.CreateTournament(tm); }
private void btnCreateTournament_Click(object sender, EventArgs e) { // create tournament model; TournamentModel t = new TournamentModel(); t.TournamentName = this.txbTNValue.Text; if (String.IsNullOrWhiteSpace(t.TournamentName)) { MessageBox.Show("Fill tournament name"); return; } if (!decimal.TryParse(this.txbEntryFee.Text, out decimal entryFeeValue)) { MessageBox.Show("You need to enter a valid Entry fee.", "Invalid Fee", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } t.EntryFee = entryFeeValue; t.Prizes = this.selectedPrizes; t.EnterdTeams = this.selectedTeam; // Wire our matchup. // order our list randomly // check if it is big enough. if not add in byes // 2*2*2*2 // create our first round of matchups // create everyround after that TournamentLogic.CreateRounds(t); // create tournament entry; // create all of the prizes entries // create all of the team entries // GlobalConfig.Connections.CreateTournamenet(t); }
private void createTournamentButton_Click(object sender, EventArgs e) { //createNewButton tournament model if (ValidateTournamentModel()) { TournamentModel tournament = new TournamentModel { TournamentName = tournamentNameText.Text, Prizes = SelectedPrizeList, EnteredTeams = SelectedTeamList, EntryFee = decimal.Parse(entryFeeText.Text) }; //TODO- try to clone the tournament list in CreateRoundOne method TournamentLogic.CreateRoundOne(tournament); TournamentModel model = GlobalConfig.Connection.CreateTrounament(tournament); if (model != null) { MessageBox.Show("Record created in the database", "Success Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Record wasnt created in the database", "Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show(outputString, "Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void createTournamentButton_Click(object sender, EventArgs e) { if (_selectedPrizes.Count == 0 || _selectedTeams.Count == 0) { return; } decimal fee = decimal.Parse(entryFeeTextBox.Text); TournamentModel tournament = new TournamentModel { TournamentName = tournamentNameTextBox.Text, EntryFee = fee, EnteredTeams = _selectedTeams, Prizes = _selectedPrizes }; TournamentLogic.CreateRounds(tournament); GlobalConfig.Connection.CreateTournament(tournament); TournamentViewerForm viewerForm = new TournamentViewerForm(tournament); viewerForm.Show(); this.Close(); }
private void createTournamentButton_Click(object sender, EventArgs e) { decimal fee = 0; bool feeAcceptable = decimal.TryParse(entryFeeValue.Text, out fee); if (!feeAcceptable) { MessageBox.Show("Error, You have to enter valid Entry Fee", "Invalid Fee", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //create tournament model TournamentModel tournamentModel = new TournamentModel(); tournamentModel.TournamentName = tournamentNameValue.Text; tournamentModel.EntryFee = fee; tournamentModel.Prizes = selectedPrizes; tournamentModel.EnteredTeams = selectedTeams; //TODO-Wire our matchups //Order our list randomly of teams //Check if it is big enough - if not, add in byes //2*2*2*2=2^4 //Create our first round of matchups //Create every round after that -8 matchups -4matchups -2matchups -1matchup TournamentLogic.CreateRounds(tournamentModel); GlobalConfig.Connections.CreateTournament(tournamentModel); //Create tournament entry }
private void createTournamentButton_Click(object sender, EventArgs e) { TournamentModel tournament = new TournamentModel(); decimal entryFeeInput = 0; bool feeIsDecimal = decimal.TryParse(entryFeeValue.Text, out entryFeeInput); if (tournamentNameValue.Text != "" && entryFeeValue.Text != "" && feeIsDecimal) { tournament.Name = tournamentNameValue.Text; tournament.EntryFee = entryFeeInput; tournament.EnteredTeams = selectedTeams; tournament.Prizes = selectedPrizes; TournamentLogic.CreateRounds(tournament); GlobalConfig.Connection.CreateTournament(tournament); //TO-DO: Implement calling form at a later date if needed //callingForm.TeamComplete(team); //this.Close(); tournamentNameValue.Text = ""; entryFeeValue.Text = ""; } else { MessageBox.Show("This form has invalid information. Please check it and try again."); } }
private void createTournamentButton_Click(object sender, EventArgs e) { //Validate data decimal fee = 0; bool feeAcceptable = decimal.TryParse(entryFeeValue.Text, out fee); if (!feeAcceptable) { MessageBox.Show("Enter valid team entry", "Invalid Fee", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } // Create Tournament Entry TournamentModel tm = new TournamentModel(); tm.TournamentName = tournamentNameValue.Text; tm.EntryFee = fee; tm.Prizes = selectedPrizes; tm.EnteredTeams = selectedTeams; // Wire our matchups TournamentLogic.CreateRounds(tm); // order our team list randomly // Take in the list, check if it is big enough. If not, add in byes(2^n teams) //Create first round of matchups //Create every round after that //Create Prizes all of prizes entries // Create all of the team entries GlobalConfig.Connection.CreateTournament(tm); }
private void createTournamentButton_Click(object sender, EventArgs e) { // validate data decimal entryFee = 0; bool feeAcceptable = decimal.TryParse(entryFeeValue.Text, out entryFee); // create the tournament model TournamentModel tournamentModel = new TournamentModel(); // create tournament entry tournamentModel.TournamentName = tournamentNameValue.Text; if (!feeAcceptable) { MessageBox.Show("You need to enter a floating point number for the entry fee.", "", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } tournamentModel.EntryFee = entryFee; tournamentModel.Prizes = _selectedPrizes; tournamentModel.EnteredTeams = _selectedTeams; // Create matchups between two teams, tournament rounds, and establish winner TournamentLogic.CreateRounds(tournamentModel); // Save the tournament's name and entry fee in a database/text file // Save all the prizes ids in a database/text file // Save all the teams ids participating in the tournament in a database/text file GlobalConfig.Connection.CreateTournament(tournamentModel); }
private void createTournamentButton_Click(object sender, EventArgs e) { decimal fee = 0; bool feeAcceptable = decimal.TryParse(entryFeeValue.Text, out fee); if (!feeAcceptable) { MessageBox.Show("You need to enetr a valid fee", "Invalid fee", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //Create Our TournamentModel TournamentModel tm = new TournamentModel(); tm.TournamentName = tournamentNameValue.Text; tm.EntryFee = fee; tm.Prizes = selectedPrizes; tm.EnteredTeams = selectedTeams; TournamentLogic.CreateRounds(tm); GlobalConfig.Connection.CreateTournament(tm); //Create our tournament Entry //Creat all of the prizes entries //Creat all of the team entries }
private void createTournamentButton_Click(object sender, EventArgs e) { //Validate entry fields decimal entry = 0; bool feeAcceptable = decimal.TryParse(entryFeeValue.Text, out entry); if (!feeAcceptable) { MessageBox.Show("Fee is invalid. Try again", "Invalid Fee", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } TournamentModel tour = new TournamentModel(); tour.TournamentName = tournamentNameValue.Text; tour.EntryFee = entry; tour.Prizes = selectedPrizes; tour.EnteredTeams = selectedTeams; GlobalConfig.Connection.CreateTournament(tour); //Todo - create matchups TournamentLogic.CreateRounds(tour); tournamentNameValue.Text = ""; entryFeeValue.Text = ""; WireUpLists(); }
private void createTournamentButton_Click(object sender, EventArgs e) { //Create matchups if (ValidateForm()) { TournamentModel tournament = new TournamentModel( tournamentNameValue.Text, entryFeeValue.Text, selectedTeams, selectedPrizes); //Wire up Matchups TournamentLogic.CreateRounds(tournament); GlobalConfig.Connection.CreateTournament(tournament); callingForm.TournamentComplete(tournament); this.Close(); } else { MessageBox.Show("This form has invalid information. Please check and try again.", "Invalid Information", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void createTournamentButton_Click(object sender, EventArgs e) { //ensure fee is valid decimal. decimal fee = 0; bool feeValid = decimal.TryParse(entryFeeValue.Text, out fee); if (!feeValid) { MessageBox.Show("Please enter a valid Entry Fee", "Invalid Fee", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } // Create a tournament model. TournamentModel tm = new TournamentModel(); tm.TournamentName = tournamentNameValue.Text; tm.Entryfee = fee; tm.Prizes = selectedPrizes; tm.EnteredTeams = selectedTeams; // Create the matchups. TournamentLogic.CreateRounds(tm); // Create the tournament entry. // Create the prize entries. // Create the team entries. (in this specific order so they work with the database) GlobalConfig.Connection.CreateTournament(tm); TournamentViewerForm frm = new TournamentViewerForm(tm); frm.Show(); this.Close(); }
private void CreateNewTournamentButton_Click(object sender, EventArgs e) { if (ValidateForm(selectedTeams, selectedPrizes, newTournamentNameTextBox.Text, entryFeeTextBox.Text)) { TournamentModel newTournamentModel = new TournamentModel(selectedTeams, selectedPrizes, newTournamentNameTextBox.Text, entryFeeTextBox.Text); newTournamentModel = GlobalConfig.Connection.CreateTournament(newTournamentModel); newTournamentModel.Rounds = TournamentLogic.CreateRounds(newTournamentModel); MessageBox.Show("New tournament created!"); newTournamentNameTextBox.Text = "Name of the tournament"; entryFeeTextBox.Text = "0"; selectableTeams = GlobalConfig.Connection.GetAllTeams(); selectedTeams = new List <TeamModel>(); selectablePrizes = GlobalConfig.Connection.GetAllPrizes(); selectedPrizes = new List <PrizeModel>(); ConnectFormToList(); } else { MessageBox.Show("Error: Details provided are not valid! Please check information and try again."); } }
private void ScoreButton_Click(object sender, EventArgs e) { string errorMsg = ValidateScores(); if (errorMsg.Length > 0) { MessageBox.Show(errorMsg, "Error: Invalid Score"); return; } MatchupModel m = (MatchupModel)matchupListBox.SelectedItem; if (m.Entries[0].TeamCompeting != null) { m.Entries[0].Score = double.Parse(scoreOneValue.Text); } if (m.Entries.Count > 1 && m.Entries[1].TeamCompeting != null) { m.Entries[1].Score = double.Parse(scoreTwoValue.Text); } try { TournamentLogic.UpdateTournamentResults(tm, m); } catch (Exception ex) { MessageBox.Show($"Error: { ex.Message }"); return; } LoadMatchups(TournamentLogic.GetCurrentRound(tm)); roundDropDown.SelectedItem = TournamentLogic.GetCurrentRound(tm); }
private void createTournamentButton_Click(object sender, EventArgs e) { decimal fee = 0; bool feeAcceptable = decimal.TryParse(entryFeeValue.Text, out fee); if (!feeAcceptable) { MessageBox.Show("Please enter a valid entry fee.", "Invalid fee.", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } TournamentModel tm = new TournamentModel(); tm.TournamentName = tournamentNameValue.Text; tm.EntryFee = fee; tm.Prizes = selectedPrizes; tm.Teams = selectedTeams; TournamentLogic.CreateRounds(tm); GlobalConfig.Connection.CreateTournament(tm); }
private void createTournamentButton_Click(object sender, EventArgs e) { // Validate data bool feeAcceptable = decimal.TryParse(entryFeeValue.Text, out decimal fee); if (!feeAcceptable) { 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 { TournamentName = tournamentNameValue.Text, EntryFee = fee, Prizes = selectedPrizes, EnteredTeams = selectedTeams }; // TODO - Wire our matchups TournamentLogic.CreateRounds(tm); // Create Tournament entry // Create all of the prizes entries // Create all of the team entries GlobalConfig.Connection.CreateTournament(tm); }
/// <summary> /// Button for creating tournament models /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void createTournamentButton_Click(object sender, EventArgs e) { decimal entryFee; bool feeAcceptable = decimal.TryParse(entryFeeValue.Text, out entryFee); if (!feeAcceptable) { MessageBox.Show("Please enter a valid Fee.", "Invalid Fee", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } // Creates tournamentModel TournamentModel tournamentModel = new TournamentModel { TournamentName = tournamentNameValue.Text, EntryFee = entryFee, Prizes = selectedPrizes, EnteredTeams = selectedTeams }; // TODO - Wireup TournamentLogic.CreateRounds(tournamentModel); GlobalConfig.Connection.CreateTournament(tournamentModel); }
private void createTorunamentButton_Click(object sender, EventArgs e) { //Validate data decimal fee = 0; bool feeValid = decimal.TryParse(entryFeeValue.Text, out fee); if (!feeValid || fee > 9999999999.99m) { 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 = selectedTeams; // TODO: Wire up our matchups TournamentLogic.CreateRounds(tm); //Create Tournament Entry //Create all of the prize entries and associate with tournament //Create all of the team entries and associate with tournament GlobalConfig.Connection.CreateTournament(tm); }
private void createTournamentButton_Click(object sender, EventArgs e) { decimal fee = 0; bool feeAcceptable = decimal.TryParse(entryFeeValue.Text, out fee); if (!feeAcceptable) { MessageBox.Show("You need to enter entry fee!", "Invalid fee", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } TournamentModel tm = new TournamentModel(); tm.TournamentName = tournamentNameValue.Text; tm.EntryFee = fee; tm.Prizes = selectedPrizes; tm.EnteredTeams = selectedTeams; TournamentLogic.CreateRounds(tm); GlobalConfig.Connection.CreateTournament(tm); tm.AlertUsersToNewRound(); TournamentViewerForm frm = new TournamentViewerForm(tm); frm.Show(); this.Close(); }
private void CreateTournamentButton_Click(object sender, EventArgs e) { // Validate the entry fee data bool feeAcceptable = decimal.TryParse(entryFeeValue.Text, out decimal fee); if (!feeAcceptable) { 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 { TournamentName = tournamentNameValue.Text, EntryFee = fee, Prizes = selectedPrizes, EnteredTeams = selectedTeams, }; // Wires our Matchups // 1. order our list randomly of teams // 2. Check if it is big enough, - if not, add in byes - 2*2*2*2 // 3. Create our first round of matchups // 4. Create every round after that - e.g. - 8 matchups - 4 matchups - 2 matchups - 1 matchup TournamentLogic.CreateRounds(tm); // Create Tournament entry // Create all of the prizes entries // Create all of the team entries GlobalConfig.Connection.CreateTournament(tm); }
private void CreateTournamentButton_Click(object sender, EventArgs e) { // Validate Data bool feeAcceptable = decimal.TryParse(entryFeeValue.Text, out decimal fee); if (!feeAcceptable) { MessageBox.Show("You need to enter a valid entry fee", "Invalid fee", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } // Create tournament model TournamentModel myTournament = new TournamentModel(); myTournament.TournamentName = tournamentNameValue.Text; myTournament.EntryFee = fee; myTournament.Prizes = selectedPrizes; myTournament.EnteredTeams = selectedTeams; TournamentLogic.CreateRounds(myTournament); // Create Tournaments entry // Create all of the prizes entries relations // Create all of the team entries relations GlobalConfig.Connection.CreateTournament(myTournament); // Alret users by sending them mail and informing of new round start myTournament.AlertUsersToNewRound(); TournamentViewer tvf = new TournamentViewer(myTournament); tvf.Show(); this.Close(); }
private void createTournamentButton_Click(object sender, EventArgs e) { //Validate data 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; } //Create our tournament model TournamentModel tm = new TournamentModel(); tm.TournamentName = tournamentNameValue.Text; tm.EntryFee = fee; tm.Prizes = selectedPrizes; tm.EnteredTeams = selectedTeams; //Create our matchups TournamentLogic.CreateRounds(tm); //Create tournament entry //Create all of the prizes entries //Create all of the team entries GlobalConfig.Connection.CreateTournament(tm); TournamentViewerForm frm = new TournamentViewerForm(tm); frm.Show(); this.Close(); }
private void btnCreateTournament_Click(object sender, EventArgs e) { // Validate data decimal fee = 0; bool feeAcceptable = decimal.TryParse(txtEntryFee.Text, out fee); if (!feeAcceptable) { MessageBox.Show("You need to enter a valid Entry Fee.", "Invalid Fee", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } // Create tournamnet model Tournament tm = new Tournament(); tm.TounamentName = txtTournamentName.Text; tm.EntryFee = fee; tm.Prizes = selectedPrizes; tm.EnteredTeams = selectedTeams; // TODO - Wire our matchups // Order our list randomly of teams // Check is list is big enough - if not, add in byes - 2^n // Create first round of matchups // Create every round after that TournamentLogic.CreateRounds(tm); // Create tournaments entry // Create all of the prizes entries // Create all of the team entries GlobalConfig.Connection.CreateTournament(tm); }
/// <summary> /// Actually creates the tournament. /// </summary> /// <param name="sender">The object that initiated the event.</param> /// <param name="e">The arguments of the event.</param> private void CreateTournamentBtn_Click(object sender, EventArgs e) { // Validate data. decimal fee = 0; bool feeAccepted = decimal.TryParse(this.EntryFreeValue.Text, out fee); if (!feeAccepted) { MessageBox.Show("You need to enter a valid entry fee.", "Invalid Fee", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } // Create tournament model. TournamentModel model = new TournamentModel(); model.TournamentName = this.TournamentNameValue.Text; model.EntryFee = fee; model.Prizes = this.SelectedPrizes; model.EnteredTeams = this.SelectedTeams; // Wire up matchups. TournamentLogic.CreateRounds(model); // Create tournament entries. GlobalConfig.Connection.CreateTournament(model); TournamentViewForm fvfrm = new TournamentViewForm(model); fvfrm.Show(); this.Close(); }
private void CreateTournamentButton_Click(object sender, EventArgs e) { if (ValidateTournamentInfo()) { TournamentModel tm = new TournamentModel { TournamentName = tournamentNameValue.Text, EntryFee = decimal.Parse(entryFeeValue.Text), EnteredTeams = tournamentPlayersListBox.Items.Cast <TeamModel>().ToList(), Prizes = prizesListBox.Items.Cast <PrizeModel>().ToList() }; TournamentLogic.CreateRounds(tm); GlobalConfig.Connections.CreateTournament(tm); // add tm to the database TournamentLogic.AlertUsersToNewRound(tm); // alert users of first round matchups // Show the tournament that was just created TournamentViewerForm viewerForm = new TournamentViewerForm(tm); viewerForm.Show(); this.Close(); } else { MessageBox.Show("You have invalid tournament information. Please check and try again.", "Error: Invalid Tournament", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CreateTournamentButton_Click(object sender, RoutedEventArgs e) { // Validate data decimal fee = 0; bool feeAcceptable = decimal.TryParse(entryFeeValue.Text, out fee); if (!feeAcceptable) { MessageBox.Show("You need to enter a valid Entry Fee", "Invali fee", MessageBoxButton.OK, MessageBoxImage.Error); return; } // Create tournament model var tm = new TournamentModel(); tm.TournamentName = tournamentNameValue.Text; tm.EntryFee = fee; tm.Prizes = selectedPrizes; tm.EnteredTeams = selectedTeams; // Wire up matchups TournamentLogic.CreateRounds(tm); // Create tournament entry // Create all of the prize entries // Create all of the team entries GlobalConfig.Connection.CreateTournament(tm); }
private void btnCreateTournament_Click(object sender, System.EventArgs e) { // Validate Data bool feeValid = decimal.TryParse(textBoxEntryFee.Text, out decimal fee); if (!feeValid) { MessageBox.Show("Please enter a valid entry fee.", "Invalid Fee", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (textBoxTournamentName.Text.Length < 1) { MessageBox.Show("Please enter a valid tournament name.", "Invalid Name", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (selectedTeams.Count < 1) { MessageBox.Show("At least 1 team must be entered.", "Invalid Teams", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } // Create tournament model TournamentModel tm = new TournamentModel(); tm.TournamentName = textBoxTournamentName.Text; tm.EntryFee = fee; tm.Prizes = selectedPrizes; tm.EnteredTeams = selectedTeams; //Wireup / Create Matchups TournamentLogic.CreateRounds(tm); // Create Tournament Entry // Create all of the prizes entries // Create all of the team entries GlobalConfig.Connection.CreateTournament(tm); tm.AlertUsersToNewRound(); TournamentViewerForm frm = new TournamentViewerForm(tm); frm.Show(); this.Close(); }