@Override
public void doSave() throws EJbsObject {
logger.debug("Saving data...");
try {
OffersRemote offers = (OffersRemote) ClientTools.getRemoteBean(OffersRemote.class);
super.doSave();
if ((this.getDlgState() == DlgState.dsInsert) || (this.getDlgState() == DlgState.dsCopy)) {
offers.createDataset(this.getOffer(), ClientGlobals.getUser(), ClientGlobals.getCompany());
} else if (this.getDlgState() == DlgState.dsEdit) {
logger.debug("Saving existing entity " + this.getOffer().getId() + ".");
offers.updateDataset(this.getOffer(), ClientGlobals.getUser());
}
logger.debug("Entity saved.");
} catch (NamingException e) {
logger.error("Error saving offer.", e);
}