Example #1
0
        public TournamentSummaryViewModel(TournamentModel selectedTournament)
        {
            finishedTournament                  = selectedTournament;
            finishedTournament.Rounds           = SqlDataHandler.GetRoundsByTournament(finishedTournament.Id);
            finishedTournament.TournamentPrizes = SqlDataHandler.GetDataByTournament <PrizeModel>(selectedTournament.Id, "dbo.SP_GetPrizesByTournament");



            _tournamentName = finishedTournament.TournamentName;
            _trophyTitle    = $"{DateTime.Now.Year} Winner";



            WireUpTournamentOrder();



            WireUpTournamentAwards();



            WireUpHighestScoringGame();



            _participatingTeams = SqlDataHandler.GetTeamsByTournament(finishedTournament);
            _selectedTeam       = _participatingTeams[0];
            _teamMembers        = _selectedTeam.TeamMembers;
        }
        public HomeViewModel()
        {
            _existingTournaments = new BindableCollection <TournamentModel>(SqlDataHandler.GetAllData <TournamentModel>("dbo.SP_GetAllTournaments"));

            foreach (TournamentModel tournament in _existingTournaments)
            {
                tournament.Rounds = SqlDataHandler.GetRoundsByTournament(tournament.Id);
            }
        }
        public CupViewModel(TournamentModel selectedTournament)
        {
            CurrentTournament = selectedTournament;

            _tournamentName = CurrentTournament.TournamentName;
            _roundList      = new BindableCollection <RoundModel>(SqlDataHandler.GetRoundsByTournament(CurrentTournament.Id));

            EnterAutomaticResults();

            _selectedRound = _roundList[0];
            _gameList      = new BindableCollection <GameModel>(_selectedRound.Games);
            DisplayRound();
        }
        //          CONSTRUCTOR
        public LeagueViewModel(TournamentModel selectedTournament)
        {
            CurrentTournament = selectedTournament;

            _tournamentName = CurrentTournament.TournamentName;
            _roundList      = new BindableCollection <RoundModel>(SqlDataHandler.GetRoundsByTournament(CurrentTournament.Id));

            EnterAutomaticResults();

            _selectedRound      = _roundList[0];
            _gameList           = new BindableCollection <GameModel>(SelectedRound.Games);
            _leagueParticipants = new BindableCollection <LeagueParticipantModel>(SqlDataHandler.GetLeagueParticipantsForDisplay(CurrentTournament.Id));

            ScoreDifferenceAndPositionNumber();
        }