Exemple #1
0
 public bool InsertGameInfo(GameInfoDB gameInfoDB)
 {
     try
     {
         using (var connection = new SQLiteConnection(System.IO.Path.Combine(_folderPathString, NAME_DB_STRING)))
         {
             connection.Insert(gameInfoDB);
             return(true);
         }
     }
     catch (SQLiteException ex)
     {
         Log.Info("SQLiteEx", ex.Message);
         return(false);
     }
 }
Exemple #2
0
        public bool updateTable(GameInfoDB gameInfoDB)
        {
            try
            {
                using (var connection = new SQLiteConnection(System.IO.Path.Combine(_folderPathString, NAME_DB_STRING)))
                {
                    connection.Query <GameInfoDB>("UPDATE GameInfoDB set OpponentDeviceMac=?, OpponentDeviceName=?, amountOfOpponentWin=?, amountOfYourWin=?, lastDateTimeGame=? Where Id=?",
                                                  gameInfoDB.OpponentDeviceMac, gameInfoDB.OpponentDeviceName, gameInfoDB.amountOfOpponentWin, gameInfoDB.amountOfYourWin, gameInfoDB.lastDateTimeGame, gameInfoDB.Id);

                    return(true);
                }
            }
            catch (SQLiteException ex)
            {
                Log.Info("SQLiteEx", ex.Message);
                return(false);
            }
        }