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();