public void CreateTournament() { TournamentModel tournament = new TournamentModel (TournamentName, IsLeague, HomeAndAway, VictoryPoints, DrawPoints, OfficialScore, EntryFee); SqlDataHandler.CreateTournament(tournament); foreach (TeamModel team in TournamentTeams) { tournament.ParticipatingTeams.Add(team); } RoundLogic.CreateDummyTeams(tournament); if (tournament.IsLeague) { foreach (TeamModel team in tournament.ParticipatingTeams) { SqlDataHandler.CreateLeagueParticipant(tournament, team); } } foreach (PrizeModel prize in TournamentPrizes) { tournament.TournamentPrizes.Add(prize); SqlDataHandler.CreatePrize(tournament, prize); } RoundLogic.CreateRounds(tournament); var conductor = Parent as IConductor; conductor.ActivateItem(new HomeViewModel()); // TODO - activate tournamentView instead of homeView }