public String save() { boolean isNew = (pharmacie.getId() == null || pharmacie.getId() == 0); pharmacieManager.save(pharmacie); String key = (isNew) ? "pharmacie.added" : "pharmacie.updated"; addMessage(key); if (isNew) { return "list"; } else { return "edit"; } }
public String delete() { pharmacieManager.remove(pharmacie.getId()); addMessage("pharmacie.deleted"); return "list"; }