@Override
public void doSave() throws EJbsObject {
logger.debug("Saving data...");
try {
QtyUnitsRemote qtyUnits = (QtyUnitsRemote)ClientTools.getRemoteBean(QtyUnitsRemote.class);
super.doSave();
if (this.getDlgState() == DlgState.dsInsert) {
logger.debug("Adding new entity");
qtyUnits.createDataset(this.getQtyUnit(), ClientGlobals.getUser(), ClientGlobals.getCompany());
} else if (this.getDlgState() == DlgState.dsEdit) {
logger.debug("Saving exisiting entity.");
qtyUnits.updateDataset(this.getQtyUnit(),ClientGlobals.getUser());
}
logger.debug("Entity saved.");
} catch (NamingException e) {
logger.error("Error saving entity",e);