Beispiel #1
0
 public String applyAddEdit() {
   if (addOperation) {
     orderService.add(order);
   } else {
     orderService.update(order);
   }
   return goToOrders();
 }
Beispiel #2
0
 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();
 }
Beispiel #3
0
  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";
  }
Beispiel #4
0
 public String searchAll() {
   ordersList = orderService.getAll();
   return "";
 }