Commit inicial
This commit is contained in:
parent
f52ff6ecd5
commit
d50346156e
@ -79,7 +79,6 @@ public class AppConcesionario {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void actualizarCoche() {
|
private void actualizarCoche() {
|
||||||
System.out.println("#########################################");
|
|
||||||
System.out.println("ACTUALIZAR COCHE");
|
System.out.println("ACTUALIZAR COCHE");
|
||||||
System.out.println("#########################################");
|
System.out.println("#########################################");
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,8 @@ public class CocheDaoArray implements ICocheDAO {
|
|||||||
Coche cocheActualizado = null;
|
Coche cocheActualizado = null;
|
||||||
|
|
||||||
for (int i = 0; i < listaCoches.size(); i++) {
|
for (int i = 0; i < listaCoches.size(); i++) {
|
||||||
if (listaCoches.get(i).getIdentificador() == coche.getIdentificador()) {
|
Coche cocheLista= listaCoches.get(i);
|
||||||
|
if (cocheLista.getIdentificador() == coche.getIdentificador()) {
|
||||||
listaCoches.set(i, coche);
|
listaCoches.set(i, coche);
|
||||||
cocheActualizado = coche;
|
cocheActualizado = coche;
|
||||||
break;
|
break;
|
||||||
@ -52,7 +53,6 @@ public class CocheDaoArray implements ICocheDAO {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Coche crearCoche(Coche coche) {
|
public Coche crearCoche(Coche coche) {
|
||||||
// Opcional: comprobar que no exista el ID
|
|
||||||
listaCoches.add(coche);
|
listaCoches.add(coche);
|
||||||
return coche;
|
return coche;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user