예제 #1
0
 /**
  * Save the new criterion to the database.
  *
  * @return true if the criterion is successfully saved, otherwise false
  */
 public boolean save() {
   if (criterion.getName().isEmpty()) {
     error = "Criterion name must not be empty!";
     return false;
   }
   dao.save(criterion);
   notifyObservers();
   return true;
 }
예제 #2
0
 /**
  * Delete the criterion from the database.
  *
  * @return true if can delete
  */
 public boolean delete() {
   dao.remove(criterion);
   notifyObservers();
   return true;
 }