示例#1
0
        private void UpdateGames()
        {
            // Get all the games from the MySQL database
            _mySqlDatabase.OpenConnection();
            Console.WriteLine("Retrieving games...");
            var games = new List <Game>();

            if (_useGlobal)
            {
                games = _mySqlDatabase.GetAllGames();
            }
            else
            {
                games = _mySqlDatabase.GetCenterGames(_centerId.Value);
            }
            _mySqlDatabase.CloseConnection();

            // Save all the games to the SQLite database
            _sqliteDatabase.OpenConnection();
            Console.WriteLine("Saving games...");
            _sqliteDatabase.AddGames(games);
            _sqliteDatabase.CloseConnection();
        }