public static void delete(long partnerID) { SYPartner p = SYPartner.findById(partnerID); p.delete(); if (flash.get("error") == null) { flash.put("success", "deleted"); } flash.keep(); SYPartners.show(p.patient.id, -1); }
public static void save(SYPartner partner, long patientID) { if (partner.creationDate == null) { partner.creationDate = new GregorianCalendar(); Patient patient = Patient.findById(patientID); partner.patient = patient; partner.actif = true; } partner.save(); if (flash.get("error") == null) { flash.put("success", "saved"); } flash.keep(); SYPartners.show(partner.patient.id, partner.id); }