if (this.getDlgState() == DlgState.dsInsert) {
System.out.println("Adding new entity");
contacts.createDataset(this.getContact(), ClientGlobals.getUser(), ClientGlobals.getCompany());
} else if (this.getDlgState() == DlgState.dsEdit) {
System.out.println("Saving exisiting entity.");
contacts.updateDataset(this.getContact(), ClientGlobals.getUser());
}
System.out.println("Entity saved.");
} catch (NamingException e) {
e.printStackTrace();