コード例 #1
0
 public void LoadForm(int tournamentId)
 {
     _tournament = _db.GetTournament(tournamentId);
     _players    = _db.GetTournamentPlayers(tournamentId);
     _tables     = _db.GetTournamentTables(tournamentId);
     _form.GeneratePlayersButtons(_players.Count);
 }
コード例 #2
0
        public void DeleteTournament(int tournamentId)
        {
            DeleteHands(_db.Hands.ToList().FindAll(x => x.HandTournamentId == tournamentId));
            DeleteTables(_db.Tables.ToList().FindAll(x => x.TableTournamentId == tournamentId));
            DeletePlayers(_db.Players.ToList().FindAll(x => x.PlayerTournamentId == tournamentId));
            DBTournament tournament = _db.Tournaments.ToList().Find(x => x.TournamentId == tournamentId);

            if (tournament.IsTeams)
            {
                DeleteTeams(_db.Teams.ToList().FindAll(x => x.TeamTournamentId == tournamentId));
            }
            _db.Tournaments.Remove(tournament);
            _db.SaveChanges();
        }
コード例 #3
0
 public void LoadTournament(int tournamentId)
 {
     _tournament = _db.GetTournament(tournamentId);
     _tables     = _db.GetTournamentTables(tournamentId);
     if (_tournament.IsTeams)
     {
         _players = _db.GetTournamentPlayers(_tournament.TournamentId);
         _teams   = _db.GetTournamentTeams(_tournament.TournamentId);
         _form.ShowButtonTeams();
         if (IsWrongPlayersTeams())
         {
             ButtonPlayersClicked();
             return;
         }
     }
     GenerateRoundsAndTablesButtons();
 }
コード例 #4
0
        public void LoadForm(int tournamentId)
        {
            _tournament = _db.GetTournament(tournamentId);
            _players    = _db.GetTournamentPlayers(tournamentId);
            if (_tournament.IsTeams)
            {
                _teams = _db.GetTournamentTeams(tournamentId);
            }
            _countries = _db.GetCountries();

            List <DGVPlayer> dgvPlayers = new List <DGVPlayer>(_players.Count);

            foreach (DBPlayer player in _players)
            {
                dgvPlayers.Add(new DGVPlayer(player, getPlayerTeamName(player.PlayerTeamId),
                                             CountryFlags.GetFlagImage(player.PlayerCountryName)));
            }

            _form.FillDGV(dgvPlayers, _tournament.IsTeams);
            CheckWrongPlayersTeams();
        }
コード例 #5
0
 public void AddTournament(DBTournament tournament)
 {
     _db.Tournaments.Add(tournament);
     _db.SaveChanges();
 }
コード例 #6
0
 public void LoadForm(int tournamentId)
 {
     _tournament = _db.GetTournament(tournamentId);
     _teams      = _db.GetTournamentTeams(tournamentId);
     _form.FillDGV(_teams);
 }
コード例 #7
0
 private void SaveTournament()
 {
     _tournament = new DBTournament(DateTime.Now, _players.Count, _numRounds, _isTeamsChecked, _tournamentName);
     _db.AddTournament(_tournament);
 }