public void doSave() throws EJbsObject {
if (logger.isDebugEnabled()) {
logger.debug("Saving data...");
}
try {
SuppliersRemote suppliers = (SuppliersRemote)ClientTools.getRemoteBean(SuppliersRemote.class);
super.doSave();
logger.debug(getSupplier().isDeleted());
if (this.getDlgState() == DlgState.dsInsert) {
System.out.println("Adding new entity");
suppliers.createDataset(this.getSupplier(), ClientGlobals.getUser(), ClientGlobals.getCompany());
} else if (this.getDlgState() == DlgState.dsEdit) {
System.out.println("Saving exisiting entity.");
suppliers.updateDataset(this.getSupplier(), ClientGlobals.getUser());
}
System.out.println("Entity saved.");
} catch (NamingException e) {
e.printStackTrace();