Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (C) 2019 Consiglio Nazionale delle Ricerche
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
/*
* Created on Sep 20, 2005
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package it.cnr.contab.config00.bp;
import java.rmi.RemoteException;
import it.cnr.contab.config00.bulk.Parametri_cnrBulk;
import it.cnr.contab.config00.ejb.Parametri_livelliComponentSession;
import it.cnr.contab.config00.pdcfin.bulk.Elemento_voceHome;
import it.cnr.contab.config00.pdcfin.cla.bulk.Parametri_livelliBulk;
import it.cnr.contab.utenze00.bp.CNRUserContext;
import it.cnr.jada.DetailedRuntimeException;
import it.cnr.jada.UserContext;
import it.cnr.jada.action.ActionContext;
import it.cnr.jada.action.BusinessProcessException;
import it.cnr.jada.bulk.OggettoBulk;
import it.cnr.jada.comp.ComponentException;
import it.cnr.jada.persistency.IntrospectionException;
import it.cnr.jada.persistency.PersistencyException;
public class CRUDConfigParametriLivelliBP extends it.cnr.jada.util.action.SimpleCRUDBP {
private boolean isEtrDisabled=false;
private boolean isSpeDisabled=false;
/**
* Primo costruttore della classe CRUDConfigParametriCnrBP.
*/
public CRUDConfigParametriLivelliBP() {
super();
}
/**
* Secondo costruttore della classe CRUDConfigParametriCnrBP.
* @param String function
*/
public CRUDConfigParametriLivelliBP(String function) {
super(function);
}
public OggettoBulk initializeModelForInsert(ActionContext actioncontext, OggettoBulk oggettobulk) throws BusinessProcessException {
((Parametri_livelliBulk)oggettobulk).setEsercizio(CNRUserContext.getEsercizio(actioncontext.getUserContext()));
return super.initializeModelForInsert(actioncontext, oggettobulk);
}
protected void initialize(ActionContext actioncontext) throws BusinessProcessException {
super.initialize(actioncontext);
Parametri_livelliComponentSession sessione = (Parametri_livelliComponentSession) createComponentSession();
try {
Parametri_livelliBulk parLivBulk = sessione.getParametriLivelli(actioncontext.getUserContext(), CNRUserContext.getEsercizio(actioncontext.getUserContext()));
if (parLivBulk != null) {
isEtrDisabled = !this.isParametriLivelliEtrEnabled(actioncontext.getUserContext(), parLivBulk);
isSpeDisabled = !this.isParametriLivelliSpeEnabled(actioncontext.getUserContext(), parLivBulk);
this.setModel(actioncontext, parLivBulk);
this.setStatus(it.cnr.jada.util.action.FormController.EDIT);
}
} catch (DetailedRuntimeException e) {
throw handleException(e);
} catch (ComponentException e) {
throw handleException(e);
} catch (RemoteException e) {
throw handleException(e);
}
}
public boolean isParametriLivelliSpeEnabled(UserContext userContext, Parametri_livelliBulk parLiv) throws it.cnr.jada.action.BusinessProcessException {
try {
Parametri_livelliComponentSession sessione = (Parametri_livelliComponentSession) createComponentSession();
return sessione.isParametriLivelliSpeEnabled(userContext, parLiv);
} catch (BusinessProcessException e) {
throw handleException(e);
} catch (DetailedRuntimeException e) {
throw handleException(e);
} catch (ComponentException e) {
throw handleException(e);
} catch (RemoteException e) {
throw handleException(e);
}
}
public boolean isParametriLivelliEtrEnabled(UserContext userContext, Parametri_livelliBulk parLiv) throws it.cnr.jada.action.BusinessProcessException {
try {
Parametri_livelliComponentSession sessione = (Parametri_livelliComponentSession) createComponentSession();
return sessione.isParametriLivelliEtrEnabled(userContext, parLiv);
} catch (BusinessProcessException e) {
throw handleException(e);
} catch (DetailedRuntimeException e) {
throw handleException(e);
} catch (ComponentException e) {
throw handleException(e);
} catch (RemoteException e) {
throw handleException(e);
}
}
public boolean isSearchButtonHidden() {
return true;
}
public boolean isFreeSearchButtonHidden() {
return true;
}
public boolean isNewButtonHidden() {
return true;
}
public boolean isDeleteButtonEnabled() {
return !isEtrDisabled||!isSpeDisabled;
}
public boolean isSaveButtonEnabled() {
return !isEtrDisabled||!isSpeDisabled;
}
/**
* Genera l'HTML per disegnare nell'interfaccia utente una tabella che presenta nelle righe le funzioni e nelle
* colonne i tipi CDS; inoltre, se il modello passato come parametro e' valorizzato, inizializza le celle
* di questa tabella con i dati presenti nel modello.
*/
public void writeTable(javax.servlet.jsp.JspWriter out, Parametri_livelliBulk parLiv) throws java.io.IOException, PersistencyException , it.cnr.jada.comp.ApplicationException, IntrospectionException
{
out.println("
");
out.print("
");
out.print("
");
out.println("
");
writeTableHeader( out, Elemento_voceHome.GESTIONE_ENTRATE, parLiv);
if (parLiv.getLivelli_entrata() != null && parLiv.getLivelli_entrata().intValue()>0) {
for (int i=1;i<=7;i++) {
writeTableRow( out, Elemento_voceHome.GESTIONE_ENTRATE, i , parLiv );
}
}
out.println("
");
out.print("
");
out.print("
");
out.println("
");
writeTableHeader( out, Elemento_voceHome.GESTIONE_SPESE, parLiv);
if (parLiv.getLivelli_spesa() != null && parLiv.getLivelli_spesa().intValue()>0) {
for (int i=1;i<=7;i++) {
writeTableRow( out, Elemento_voceHome.GESTIONE_SPESE, i , parLiv );
}
}
out.println("