Terminado soporte aniadir gestion nueva
This commit is contained in:
@@ -11,23 +11,28 @@ private ArrayList<Mes> meses;
|
||||
this.meses = new ArrayList<Mes>();
|
||||
}
|
||||
|
||||
public void aniadirGestion(String nombre, int anio, Month mes) {
|
||||
public Gestion aniadirGestion(String nombre, int anio, Month mes) {
|
||||
Gestion ret;
|
||||
try {
|
||||
for(Mes mesSelect:this.meses) {
|
||||
if(mesSelect.getMes().equals(mes) && mesSelect.getAnio() == anio){
|
||||
mesSelect.getGestiones().add(new Gestion(nombre));
|
||||
return;
|
||||
ret = new Gestion(nombre);
|
||||
mesSelect.getGestiones().add(ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}catch (NullPointerException e) {
|
||||
ArrayList<Gestion> gestiones=new ArrayList<Gestion>();
|
||||
gestiones.add(new Gestion(nombre));
|
||||
ret = new Gestion(nombre);
|
||||
gestiones.add(ret);
|
||||
this.meses.add(new Mes(gestiones,anio,mes));
|
||||
return;
|
||||
return ret;
|
||||
}
|
||||
ArrayList<Gestion> gestiones=new ArrayList<Gestion>();
|
||||
gestiones.add(new Gestion(nombre));
|
||||
ret = new Gestion(nombre);
|
||||
gestiones.add(ret);
|
||||
this.meses.add(new Mes(gestiones,anio,mes));
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void aniadirTransaccion(Transaccion transaccion, String nombre) {
|
||||
|
||||
Reference in New Issue
Block a user