public static void show(long patientID, long partnerID) { Patient patient = Patient.findById(patientID); SYPartner last = SYPartner.getLastActif(partnerID, patient); List<SYPartner> partners = SYPartner.byPatientAndActif(patient); long nbOlds = SYPartner.nbOlds(patient); render(patient, last, partners, nbOlds); }
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); }
public static void showOlds(long patientID) { Patient patient = Patient.findById(patientID); List<SYPartner> partners = SYPartner.getOlds(patient); render(partners); }