示例#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());
  }
示例#2
0
 private Receipt verifyNumberIsAvailable(Receipt receipt) {
   Receipt existing = em.find(Receipt.class, receipt.getCodeReceipt());
   return existing;
 }