Package com.ateam.webstore.model

Examples of com.ateam.webstore.model.Orders


    l.finer("->");
    OrderShippingForm osf;
   
    try {
      osf = getOrderShippingRequest();
      Orders order = (Orders) req.getSession().getAttribute(SESSION_ATTRIBUTE_ORDER);
     
      order.setShippingCode(osf.getShippingCode());
      order.setAddress(osf.getAddress());

      //FormSubmission fs = new FormSubmission();
      osf.setSuccess(true);
      osf.setResultView(getOrderPaymentView());
View Full Code Here


   */
  public FormSubmission processOrderConfirmationRequest() {
   
    FormSubmission submission = new FormSubmission();
       
    Orders order = (Orders) req.getSession().getAttribute(SESSION_ATTRIBUTE_ORDER);
    Collection<ItemsOrdered> items = (Collection<ItemsOrdered>) req.getSession().getAttribute(SESSION_ATTRIBUTE_ORDERED_ITEMS);
   
    try {
      order = service.store(order);
      l.info("order "+order.getId()+" created");
      ItemsOrderedService is = new ItemsOrderedService();
      for (ItemsOrdered item : items) {
        item.setOrders(order);
        is.store(item);
        l.info("item "+item.getProduct().getId()+" added to order");
View Full Code Here

   * @return
   */
  public FormSubmission processOrderPaymentRequest() {
    OrderPaymentForm opf = getOrderPaymentRequest();

    Orders order = (Orders) req.getSession().getAttribute(SESSION_ATTRIBUTE_ORDER);
   
    order.setCreditCard(opf.getCard());
   
    SalesTaxService sts = new SalesTaxService();
    SalesTax st = sts.getById(opf.getCard().getBillingAddress().getState());
    Double tax = 10.00;
    if (st != null) {
      tax = st.getPercent()/100 * order.getItemSubTotal();
    }
    order.setSalesTax(tax);
   
    opf.setSuccess(true);
    opf.setResultView(getOrderPreView());
     
    return opf;
View Full Code Here

  public FormSubmission processOrderUpdateRequest() {
    FormSubmission fs = new FormSubmission();
   
    l.info("order update");
   
    Orders o = getOrder();
   
    String action = req.getParameter(Parameters.ORDER_CONFIRM.getId());
   
    if (action.equals("Update Order")) {
     
      if (req.getParameter(Parameters.TRACKING_NUMBER.getId()) != null) {
        o.setTrackingNumber(req.getParameter(Parameters.TRACKING_NUMBER.getId()));
        o.setTimeShipped(new Date(new java.util.Date().getTime()));
        fs.setResultMessage("Order Updated");
      }
      else {
        fs.setResultMessage("Invalid Tracking Number");
        fs.setResultView(getOrderDetailsView(null, true));
        return fs;
      }
     
    }
    else if (action.equals("Cancel Order")) {
      o.setReturnInd(true);
      fs.setResultMessage("Order Cannceled");
    }
   
    fs.setResultView(getOrderDetailsView(null, true));
    service.store(o);
View Full Code Here

      return view;
    }
   
    l.info("start checkout for session: "+req.getSession().getId());
   
    Orders order = new Orders(cart.getProducts().size(), 0.0, 0.0, 0.0, v.getCustomer(), null, null, null);
   
    Collection<ItemsOrdered> items = new ArrayList<ItemsOrdered>();
    for (ProductsInCart prod : cart.getProducts()) {
      ItemsOrdered item = new ItemsOrdered(prod.getProduct().getSalesPrice(), prod.getQuantity(), false, null, prod.getProduct());
      items.add(item);
      order.addItemPrice(prod.getProduct().getSalesPrice());
    }
   
   
   
    //Add order to session
View Full Code Here

TOP

Related Classes of com.ateam.webstore.model.Orders

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.