class TiposDietaCRUD extends BaseBusiness {

	public void verificaDataCriacao(Date data) throws ApplicationBusinessException {
		AghParametros aghParametro = iParametroFacade.buscarAghParametro(AghuParametrosEnum.P_DIAS_PERM_DEL_AFA);

		if (aghParametro != null && aghParametro.getVlrNumerico() != null) {
			float diff = CoreUtil.diferencaEntreDatasEmDias(Calendar
					.getInstance().getTime(), data);
			if (diff > aghParametro.getVlrNumerico().floatValue()) {
				throw new ApplicationBusinessException(
						TiposDietaCRUDExceptionCode.AFA_00172);
			}
		} else {
			throw new ApplicationBusinessException(
					TiposDietaCRUDExceptionCode.AFA_00173);
		}
	}

}