Beispiel #1
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);
  }
Beispiel #2
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);
  }