コード例 #1
0
 @Override
 public int updatePersonMeasure(int id, Measure measure) {
   Person person = Person.getPersonById(id);
   // Set person and healthProfile for measure
   measure.setPerson(person);
   measure.setHealthProfile(person.getHealthProfile());
   Measure.updateMeasure(measure);
   return measure.getMid();
 }
コード例 #2
0
 @Override
 public boolean deletePerson(int id) {
   Person p = Person.getPersonById(id);
   if (p != null) {
     Person.removePerson(p);
     return true;
   } else {
     return false;
   }
 }
コード例 #3
0
 @Override
 public Measure savePersonMeasure(int id, Measure measure) {
   Person person = Person.getPersonById(id);
   // Set person and healthProfile for measure
   measure.setPerson(person);
   measure.setHealthProfile(person.getHealthProfile());
   // If no created date, set the current date as measure created date
   if (measure.getCreated() == null) {
     measure.setCreated(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
   }
   return Measure.saveMeasure(measure);
 }
コード例 #4
0
 @Override
 public Person readPerson(int id) {
   return Person.getPersonById(id);
 }