@Override
public void doSave() throws EJbsObject {
logger.debug("Saving data...");
try {
EmployeeNewsEntriesRemote newsEntries = (EmployeeNewsEntriesRemote)ClientTools.getRemoteBean(EmployeeNewsEntriesRemote.class);
super.doSave();
if (this.getDlgState() == DlgState.dsInsert) {
logger.debug("Adding new entity " + this.getEmployeeNewsEntry().getId() + ".");
newsEntries.createDataset(this.getEmployeeNewsEntry(), ClientGlobals.getUser(), ClientGlobals.getCompany());
} else if (this.getDlgState() == DlgState.dsEdit) {
logger.debug("Saving existing entity " + this.getEmployeeNewsEntry().getId() + ".");
newsEntries.updateDataset(this.getEmployeeNewsEntry(), ClientGlobals.getUser());
}
logger.debug("Entity saved.");
} catch (NamingException e) {
logger.error("Error saving news-entry.",e);
JbsOptionPane.showErrorDialog(this, JbsL10N.getString("Generic.saveErrorMessage"));