Exemplo n.º 1
0
  public void delete(Receipt receipt) {
    Receipt oldReceipt;
    if ((oldReceipt = verifyNumberIsAvailable(receipt)) != null) {
      em.remove(oldReceipt);
      receiptSearch.currentPage();
    }

    messages
        .info(new DefaultBundleKey("receipt_deleted"))
        .defaults("You have been successfully deleted the receipt {0}!")
        .params(receipt.getCodeReceipt());
  }
Exemplo n.º 2
0
 private Receipt verifyNumberIsAvailable(Receipt receipt) {
   Receipt existing = em.find(Receipt.class, receipt.getCodeReceipt());
   return existing;
 }