/** Manager method. It allows the admin to recieve a moto from a client. */ public void pickUpMoto() { String code, answer; boolean check = false; boolean yesNo; boolean yesNoDesperfecto = true; Client myclient = null; Moto m; Local lend; Consola.escriu("Insert the code"); code = Consola.llegeixString(); code = this.checkCode(code); if (!code.equals("")) { for (int i = 0; i <= this.lstClient.size() && !check; i++) { check = this.lstClient.get(i).compareCode(code); if (check) { myclient = this.lstClient.get(i); } } m = myclient.getMotoFromActiveReserve(); lend = myclient.getLocalEFromActiveReserve(); Consola.escriu("Insert a 'S' if the moto is broken, insert a 'N' otherwise"); answer = Consola.llegeixString(); yesNo = this.checkYesNo(answer); if (!yesNo) { Consola.escriu("Insert a 'S' to admonish a minor flaw, a 'N' otherwise"); answer = Consola.llegeixString(); yesNoDesperfecto = this.checkYesNo(answer); } else { m.changeStatusNonAvailable(); } if (yesNoDesperfecto) { myclient.admonish(); } myclient.printActiveReserve(); Consola.escriu("Insert a 'S' if the moto has been returned with delay or a 'N' otherwise"); answer = Consola.llegeixString(); yesNo = this.checkYesNo(answer); if (yesNo) { myclient.delay(); } Consola.escriu("Write 'S' to confirm or 'N' to cancel"); answer = Consola.llegeixString(); yesNo = this.checkYesNo(answer); if (yesNo) { this.pickUpMakeChange(m, lend); myclient.changeActiveToDone(); } else { myclient.removeAdmonishFromActiveReserve(); myclient.removeDelayFromActiveReserve(); m.changeStatusAvailable(); Consola.escriu("Cancelled"); } } }