public static void ChangePassword(string newPassword, int UserID) { MD5 md5hash = MD5.Create(); string passwordHashed = PasswordProcedures.ToMD5Hash(newPassword); using (CallDB db = new CallDB()) { new UsersQuery(db).ChangePassword(passwordHashed, UserID); db.conexao.Close(); } }
public static void RegisterUser(RegisterModel model) { using (CallDB db = new CallDB()) { model.Register_PasswordHash = PasswordProcedures.ToMD5Hash(model.Password); model.ID = new UsersQuery(db).RegisterUser(model); if (model.ID == 0) { throw new Exception(); } } }