Esempio n. 1
0
  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);
  }
Esempio n. 2
0
  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);
  }
Esempio n. 3
0
  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);
  }
Esempio n. 4
0
 public static void showOlds(long patientID) {
   Patient patient = Patient.findById(patientID);
   List<SYPartner> partners = SYPartner.getOlds(patient);
   render(partners);
 }