Пример #1
0
 public String applyAddEdit() {
   if (addOperation) {
     orderService.add(order);
   } else {
     orderService.update(order);
   }
   return goToOrders();
 }
Пример #2
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";
  }