Exemplo n.º 1
0
 /// <summary>
 /// changes a game code status to used by certain user
 /// this does not check if the code was previously used, and does not give the user the game
 /// </summary>
 /// <param name="code">16 char string of game code</param>
 /// <param name="user">id of user</param>
 /// <returns>true if rows were updated, meaning a game code was changed and the code worked, else false</returns>
 public static bool UseGameCode(string code, int user)
 {
     return(DalHelper.UpdateWhere("GameCodes",
                                  "Used", true,
                                  "Redeemed By", user,
                                  "Code", code) > 0);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Updates the review status for a game
 /// </summary>
 /// <param name="newReviewStatus">the new status id</param>
 /// <param name="id">id of game</param>
 public static void UpdateReviewStatus(int newReviewStatus, int id)
 {
     DalHelper.UpdateWhere("Games", "Review Status", newReviewStatus, "ID", id);
 }
Exemplo n.º 3
0
 /// <summary>
 /// updates the background of the game
 /// </summary>
 /// <param name="filename">filename of image</param>
 /// <param name="id">id of game</param>
 public static void UpdateBackground(string filename, int id)
 {
     DalHelper.UpdateWhere("Games", "Background", filename, "ID", id);
 }
Exemplo n.º 4
0
 /// <summary>
 /// updates the logo of the game
 /// </summary>
 /// <param name="filename">filename of image</param>
 /// <param name="id">id of game</param>
 public static void UpdateLogo(string filename, int id)
 {
     DalHelper.UpdateWhere("Games", "Logo", filename, "ID", id);
 }
Exemplo n.º 5
0
 /// <summary>
 /// updates the description of a user in the database
 /// </summary>
 /// <param name="desc">new description</param>
 /// <param name="user">user id</param>
 public static void UpdateDescription(string desc, int user)
 {
     DalHelper.UpdateWhere("Users", "Description", desc, "ID", user);
 }
Exemplo n.º 6
0
        /// <summary>
        /// updates the password in the database
        /// </summary>
        /// <param name="password">new plaintext password</param>
        /// <param name="user">id of user</param>
        /// <returns>true if it changed anything</returns>
        public static bool UpdatePassword(string password, int user)
        {
            string hash = BCrypt.Net.BCrypt.EnhancedHashPassword(password);

            return(DalHelper.UpdateWhere("Users", "HashPass", hash, "ID", user) > 0);
        }
Exemplo n.º 7
0
 /// <summary>
 /// updates the balance of the user
 /// </summary>
 /// <param name="newBalance">new balance of user</param>
 /// <param name="user">user id</param>
 public static void UpdateBalance(double newBalance, int user)
 {
     DalHelper.UpdateWhere("Users", "Balance", newBalance, "ID", user);
 }
Exemplo n.º 8
0
 /// <summary>
 /// updates the profile picture of a user in the database
 /// </summary>
 /// <param name="filename">name of the file</param>
 /// <param name="user">user id</param>
 public static void UpdateProfilePicture(string filename, int user)
 {
     DalHelper.UpdateWhere("Users", "Profile Picture", filename, "ID", user);
 }
Exemplo n.º 9
0
 /// <summary>
 /// updates the background of a user in the database
 /// </summary>
 /// <param name="filename">name of the file</param>
 /// <param name="user">user id</param>
 public static void UpdateBackground(string filename, int user)
 {
     DalHelper.UpdateWhere("Users", "Background", filename, "ID", user);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Fulfills developer invitation
 /// </summary>
 /// <param name="userId">id of user</param>
 /// <param name="developer">id of developer</param>
 public static void FulfillRequest(int userId, int developer)
 {
     DalHelper.UpdateWhere("DeveloperInvitations", "Fulfilled", true, "To", userId, "From", developer);
 }
Exemplo n.º 11
0
 public static void setAsCurrent(int gameId, int updateId)
 {
     DalHelper.UpdateWhere("GameUpdates", "Current", false, "Game", gameId);
     DalHelper.UpdateWhere("GameUpdates", "Current", true, "Game", gameId, "ID", updateId);
 }