diff --git a/src/métiers/Commande.java b/src/métiers/Commande.java index 1bfeb60..2a2829a 100644 --- a/src/métiers/Commande.java +++ b/src/métiers/Commande.java @@ -43,6 +43,7 @@ private final HashMap lesLignes = new HashMap<>(); }else { ajoutOK = true; lesLignes.put(unInstrument,qte); + unInstrument.setQteStock(qteDisponible-qte); } return ajoutOK; } @@ -53,7 +54,14 @@ private final HashMap 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; } /////////////////////////////////////////////////////////////////////////////////