public void AssignGamerTag(int userID, string newTag) { DatabaseQuery query = new DatabaseQuery(); string hashID = query.GetHashedUserID(userID); GamerInfo newGamer = new GamerInfo(hashID, newTag, 0, 0); GamerInfo verifyGamer = query.GetGamerInfoByHashedID(hashID); if (verifyGamer != null) { //update entry query.UpdateQuery("gamer_info", "gamerTag", newGamer.GamerTag, "hashedUserID", hashID); } query.InsertGamerInfo(newGamer); //im guessing they cant have a gamertag some one else has. }
/// <summary> /// Gets gamer info associated with user's email /// </summary> /// /// <param name="email"> /// User's email /// </param> /// <returns> /// Gamer info /// </returns> public GamerInfo GetGamerInfoByEmail(string email) { DatabaseQuery databaseQuery = new DatabaseQuery(); User user = databaseQuery.GetUserInfo(email); if (user != null) { string hashedUserID = databaseQuery.GetHashedUserID(user.SystemID); GamerInfo gamer = databaseQuery.GetGamerInfoByHashedID(hashedUserID); return(gamer); } else { throw new ArgumentException(); } }