/** * Updates a contact in SQL and refreshes the table with the new information. * * @param contact The changed contact * @param selectedRow The contacts row in the table */ public void updateContact(IContact contact, int selectedRow) { commandObject = new CommandObject("update contact", contact); serverConnection.sendCommand(commandObject); contacts.set(selectedRow, contact); contacts.get(selectedRow).incrementVersion(); }
/** * Deletes a contact in SQL and sets new tableData. * * @param contact Contact to be deleted. */ public void deleteContact(int selectedRow) { IContact contact = getContact(selectedRow); commandObject = new CommandObject("delete contact", contact); serverConnection.sendCommand(commandObject); contacts.remove(selectedRow); refreshGUI(); }