private void FinalScoreBtn_Click(object sender, RoutedEventArgs e) { var validatedTeam1Score = tournamentController.validateScore(firstTeamScoreTxtBox.Text); var validatedTeam2Score = tournamentController.validateScore(secondTeamScoreTxtBox.Text); bool invalidTeamScore = false; //Validates score before saving if (validatedTeam1Score == 0 && validatedTeam2Score == 0 || validatedTeam1Score == validatedTeam2Score) { scoreRecordedLbl.Content = "Scores are not valid"; return; } if (validatedTeam1Score == -1) { teamOneInvalidScoreLbl.Content = "Score is not valid"; invalidTeamScore = true; } else { teamOneInvalidScoreLbl.Content = ""; } if (validatedTeam2Score == -1) { teamTwoInvalidScoreLbl.Content = "Score is not valid"; invalidTeamScore = true; } else { teamTwoInvalidScoreLbl.Content = ""; } if (invalidTeamScore) { return; } var matchup = tournament.Rounds[roundDropDown.SelectedIndex].Matchups[matchupsListBox.SelectedIndex]; var scoreValid = tournamentController.ScoreMatchup(matchup, validatedTeam1Score, validatedTeam2Score); if (!scoreValid) { return; } //Error Message? source.saveTournamentEntry(matchup); source.saveMatchupScore(matchup); source.savePersonStats(matchup); source.saveTeamScore(matchup); populateMatchupDetails(matchup); populateMatchupListBox(roundDropDown.SelectedIndex); scoreRecordedLbl.Content = "Score recorded successfully"; }