public void agregarDia( GregorianCalendar fecha, GregorianCalendar entrada, GregorianCalendar salida) throws Exception { this.getDias(); Dia aux = this.buscarDia(fecha.get(Calendar.DAY_OF_MONTH)); if (aux == null) { aux = new Dia(fecha, entrada, salida); this.dias.add(aux); Empresa.getPersistencia().update(this); } else { throw new Exception( "Ya existe el Día " + fecha.get(Calendar.DAY_OF_MONTH) + " en el mes " + this.mes); } }
public Mes(int mes) { this(); this.mes = mes; Empresa.getPersistencia().insert(this); }