public String applyAddEdit() { if (addOperation) { orderService.add(order); } else { orderService.update(order); } return goToOrders(); }
public String delete() { orderService.deleteAll(selectedOrders); FacesMessage message = new FacesMessage( FacesMessage.SEVERITY_INFO, "Operation Done Successfully", "Selected orders were deleted."); FacesContext.getCurrentInstance().addMessage(null, message); 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"; }
public String searchAll() { ordersList = orderService.getAll(); return ""; }