コード例 #1
0
    /// <summary>
    /// Updates the player stats table using the class definition. No need for SQL here.
    /// </summary>
    /// <param name='playerID'>
    /// The ID of the player to update
    /// </param>
    /// <param name='playerName'>
    /// Player name.
    /// </param>
    /// <param name='totalKills'>
    /// Total kills.
    /// </param>
    /// <param name='points'>
    /// Points.
    /// </param>
    private void UpdatePlayerStats_Simple(int playerID, string playerName, int totalKills, int points)
    {
        // Set up a player stats class, setting all values including the playerID
        PlayerStats playerStats = new PlayerStats {
            PlayerID = playerID, PlayerName = playerName, TotalKills = totalKills, Points = points
        };

        // the database manager will update all the fields except the primary key which it uses to look up the data
        dbManager.UpdateTable(playerStats);
    }
コード例 #2
0
 public void UpdateData(object obj)
 {
     dbManager.UpdateTable(obj);
 }