modification de la méthode ajouter et de la méthode supprimer
This commit is contained in:
parent
ebe6f29978
commit
8f366b4003
@ -43,6 +43,7 @@ private final HashMap<Instrument, Integer> lesLignes = new HashMap<>();
|
||||
}else {
|
||||
ajoutOK = true;
|
||||
lesLignes.put(unInstrument,qte);
|
||||
unInstrument.setQteStock(qteDisponible-qte);
|
||||
}
|
||||
return ajoutOK;
|
||||
}
|
||||
@ -53,7 +54,14 @@ private final HashMap<Instrument, Integer> lesLignes = new HashMap<>();
|
||||
*/
|
||||
public boolean supprimer(Instrument unInstrument){
|
||||
//lesLignes.remove(unInstrument);
|
||||
|
||||
boolean suppOK;
|
||||
if (lesLignes.containsValue(unInstrument) == true){
|
||||
suppOK = true;
|
||||
lesLignes.remove(unInstrument);
|
||||
} else {
|
||||
suppOK = false;
|
||||
}
|
||||
return suppOK;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user