public String applyAddEdit() { if (addOperation) { orderService.add(order); } else { orderService.update(order); } return goToOrders(); }
public String addOrder() { paymentInfo.setCreditCardNum(5145); paymentInfo.setCvs(234); paymentInfo.setExpirationDate(new Date()); paymentInfo.setPrintedName("Abdallah Mustafa"); PaymentInfoService paymentInfoService = new PaymentInfoServiceImpl(); paymentInfo = paymentInfoService.add(paymentInfo); order.setPaymentId(paymentInfo); order.setDate(new Date()); order.setQuantity(55); order.setTotalPrice(200); orderService.add(order); return "index?faces-redirect=true"; }