public string retrieveUserID(RequestFrontUtilisateur token) { return(String.Format("SELECT * FROM {0} WHERE {1} = '{2}'", NAME_TABLE_TOKEN, NAME_FIELD_TOKEN_TOKEN_CLIENT, token.token)); }
public int RetrieveUserId(RequestFrontUtilisateur request) { stopwatch.Start(); try { string queryRecupIdUtilisateur = nameBdd.retrieveUserID(request); int idAccount = 0; if (this.OpenConnection() == true) { MySqlCommand cmd = new MySqlCommand(queryRecupIdUtilisateur, connection); MySqlDataReader dataReader = cmd.ExecuteReader(); while (dataReader.Read()) { idAccount = nameBdd.retrieveUserIdInt(dataReader); } dataReader.Close(); this.CloseConnection(); stopwatch.Stop(); log.Info("api.UTILISATEUR.RetrieveUserId ... (" + stopwatch.Elapsed.TotalSeconds + " ms)"); return(idAccount); } else { return(idAccount); } } catch (Exception ex) { log.Error(ex); return(0); } }