it.cnr.contab.missioni00.actions.CRUDMissioneDiariaAction Maven / Gradle / Ivy
/*
* 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 .
*/
package it.cnr.contab.missioni00.actions;
import it.cnr.contab.missioni00.tabrif.bulk.*;
import it.cnr.contab.missioni00.bp.*;
import it.cnr.contab.compensi00.docs.bulk.CompensoBulk;
import it.cnr.jada.action.*;
/**
* Insert the type's description here.
* Creation date: (01/08/2002 10.30.11)
* @author: Roberto Fantino
*/
public class CRUDMissioneDiariaAction extends it.cnr.jada.util.action.CRUDAction {
/**
* CRUDMissioneDiariaAction constructor comment.
*/
public CRUDMissioneDiariaAction() {
super();
}
/**
* Gestisce un comando di cancellazione.
*/
public Forward doElimina(ActionContext context) throws java.rmi.RemoteException {
try {
fillModel(context);
CRUDMissioneDiariaBP bp = (CRUDMissioneDiariaBP)getBusinessProcess(context);
if (!bp.isEditing()) {
bp.setMessage("Non è possibile cancellare in questo momento");
} else {
bp.delete(context);
Missione_diariaBulk aDiaria = (Missione_diariaBulk)bp.getModel();
if (aDiaria.getDt_inizio_validita().compareTo(CompensoBulk.getDataOdierna())>0){
bp.reset(context);
bp.setMessage("Cancellazione effettuata");
}else{
bp.edit(context, aDiaria);
bp.setMessage("Annullamento effettuato");
}
}
return context.findDefaultForward();
} catch(Throwable e) {
return handleException(context,e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy