Package com.emc.plants.pojo.beans

Examples of com.emc.plants.pojo.beans.OrderInfo


        "Black-eyed Susan", "2 plants", 8.0f, 9.0f, 9, 10);
    Collection<ShoppingCartItem> scItemsColln = new ArrayList<ShoppingCartItem>();
    //System.out.println("Shopping :: "+applicationContext);
    scItemsColln.add(scItem);
   
    OrderInfo orderInfo = shopping.createOrder("p@plants.com", "TESTBILL", "ADDDRRR", "ADDDRRR", "ADDDRRR", "ADDDRRR", "ADDDRRR", "ADDDRRR", "ADDDRRR", "ADDDRRR", "ADDDRRR", "ADDDRRR", "ADDDRRR", "ADDDRRR", "ADDDRRR", "ADDDRRR", "ADDDRRR", "ADDDRRR", "ADDDRRR", "ADDDRRR", 1, scItemsColln);
   
    System.out.println(" Order ID :: "+orderInfo.getID());
    assertNotNull(orderInfo);
  }
View Full Code Here


                  Util.debug(fields[16]);
                  Util.debug(fields[17]);
                  Util.debug(fields[18]);
                  Util.debug(fields[19]);
                  Util.debug(fields[20]);
                  OrderInfo orderinfo = cart.createOrder(customerID, billName, billAddr1, billAddr2, billCity, billState, billZip, billPhone, shipName, shipAddr1, shipAddr2, shipCity, shipState, shipZip, shipPhone, creditCard, ccNum, ccExpireMonth, ccExpireYear, cardHolder, shippingMethod, items);
              }
            }
            //stmt.executeUpdate(" INSERT INTO ORDERITEM(INVENTORYID, NAME, PKGINFO, PRICE, COST, CATEGORY, QUANTITY, SELLDATE, ORDER_ORDERID) VALUES ('A0001', 'Bulb Digger', 'Assembled', 12.0, 5.0, 3, 900, '01054835419625', '1')");
        } catch (Exception e) {
            Util.debug("Unable to populate ORDERITEM table with text data: " + e);
View Full Code Here

 
  @RequestMapping(method=RequestMethod.GET)
  public String performTask(HttpServletRequest req,
      HttpServletResponse resp){
    logger.debug("InitCheckOutShoppingController:performTask");
    OrderInfo orderinfo = null;
    ShoppingCart shoppingCart=null;
    HttpSession session = req.getSession(true);
    CustomerInfo customerInfo = (CustomerInfo) session.getAttribute(Util.ATTR_CUSTOMER);
    String customerID = customerInfo.getCustomerID();
    shoppingCart=(ShoppingCart)session.getAttribute(Util.ATTR_CART);
    // Make sure ShopingCart reference has not timed out.
    try
    {
      logger.debug("orderinfodone: ShoppingCart timeout? check getItems() method");
      shoppingCart.getItems();
    }
    // TODO: what exception gets thrown?
    catch (RuntimeException e)
    {
      // ShoppingCart timed out, so create a new one.
      logger.debug("orderinfodone: ShoppingCart ref must have timed out");
      ShoppingCartContents cartContents = (ShoppingCartContents) session.getAttribute(Util.ATTR_CART_CONTENTS);
      if (cartContents != null)
      {
        shoppingCart = (ShoppingCart)Util.getSpringBean("shopping");
        shoppingCart.setCartContents(cartContents);
      }
      else
      {
        logger.error("NoSuchObject Exception!!!");
        logger.error("Major Problem!!!");
        shoppingCart = null;
      }
    }
    logger.debug("orderinfodone: got cart?");
    if (shoppingCart != null)
    {
      logger.debug("orderinfodone: cart not NULL");
      String billName = req.getParameter("bname");
      String billAddr1 = req.getParameter("baddr1");
      String billAddr2 = req.getParameter("baddr2");
      String billCity = req.getParameter("bcity");
      String billState = req.getParameter("bstate");
      String billZip = req.getParameter("bzip");
      String billPhone = req.getParameter("bphone");
      String shipName = req.getParameter("sname");
      String shipAddr1 = req.getParameter("saddr1");
      String shipAddr2 = req.getParameter("saddr2");
      String shipCity = req.getParameter("scity");
      String shipState = req.getParameter("sstate");
      String shipZip = req.getParameter("szip");
      String shipPhone = req.getParameter("sphone");
      int shippingMethod = Integer.parseInt(req.getParameter("shippingMethod"));
      String creditCard = req.getParameter("ccardname");
      String ccNum = req.getParameter("ccardnum");
      String ccExpireMonth = req.getParameter("ccexpiresmonth");
      String ccExpireYear = req.getParameter("ccexpiresyear");
      String cardHolder = req.getParameter("ccholdername");
      orderinfo = shoppingCart.createOrder(customerID, billName, billAddr1, billAddr2, billCity, billState, billZip, billPhone, shipName, shipAddr1, shipAddr2, shipCity, shipState, shipZip, shipPhone, creditCard, ccNum, ccExpireMonth, ccExpireYear, cardHolder, shippingMethod, shoppingCart.getItems());
      logger.debug("orderinfodone: order created");
    }
    if (orderinfo != null)
    {
      req.setAttribute(Util.ATTR_ORDERINFO, orderinfo);
      req.setAttribute(Util.ATTR_CARTITEMS, shoppingCart.getItems());
      session.setAttribute(Util.ATTR_ORDERKEY, orderinfo.getID());
  //    requestDispatch(getServletConfig().getServletContext(), req, resp, Util.PAGE_CHECKOUTFINAL);
      return Util.CHECKOUTFINAL;
    }
 
    return Util.CHECKOUTFINAL;
View Full Code Here

      em.persist(o);
    }
    em.flush();
    //em.getTransaction().commit();

    OrderInfo orderInfo=new OrderInfo(order);
    /*
     }
     catch (CreateException e)
     {
     Util.debug("ShoppingCartBean(createOrder): Exception - " + e);
View Full Code Here

      }
      requestDispatch(getServletConfig().getServletContext(), req, resp, url);
    }
    else if (action.equals(ACTION_ORDERINFODONE))
    {
      OrderInfo orderinfo = null;
      ShoppingCart shoppingCart = null;
      HttpSession session = req.getSession(true);
      CustomerInfo customerInfo = (CustomerInfo) session.getAttribute(Util.ATTR_CUSTOMER);
      String customerID = customerInfo.getCustomerID();
      shoppingCart = (ShoppingCart) session.getAttribute(Util.ATTR_CART);
      // Make sure ShopingCart reference has not timed out.
      try
      {
        Util.debug("orderinfodone: ShoppingCart timeout? check getItems() method");
        shoppingCart.getItems();
      }
      // TODO: what exception gets thrown?
      catch (RuntimeException e)
      {
        // ShoppingCart timed out, so create a new one.
        Util.debug("orderinfodone: ShoppingCart ref must have timed out");
        ShoppingCartContents cartContents = (ShoppingCartContents) session.getAttribute(Util.ATTR_CART_CONTENTS);
        if (cartContents != null)
        {
          shoppingCart = (ShoppingCart) WebUtil.getSpringBean(this.getServletContext(), "shopping");
          shoppingCart.setCartContents(cartContents);
        }
        else
        {
          Util.debug("NoSuchObject Exception!!!");
          Util.debug("Major Problem!!!");
          shoppingCart = null;
        }
      }
      Util.debug("orderinfodone: got cart?");
      if (shoppingCart != null)
      {
        Util.debug("orderinfodone: cart not NULL");
        String billName = req.getParameter("bname");
        String billAddr1 = req.getParameter("baddr1");
        String billAddr2 = req.getParameter("baddr2");
        String billCity = req.getParameter("bcity");
        String billState = req.getParameter("bstate");
        String billZip = req.getParameter("bzip");
        String billPhone = req.getParameter("bphone");
        String shipName = req.getParameter("sname");
        String shipAddr1 = req.getParameter("saddr1");
        String shipAddr2 = req.getParameter("saddr2");
        String shipCity = req.getParameter("scity");
        String shipState = req.getParameter("sstate");
        String shipZip = req.getParameter("szip");
        String shipPhone = req.getParameter("sphone");
        int shippingMethod = Integer.parseInt(req.getParameter("shippingMethod"));
        String creditCard = req.getParameter("ccardname");
        String ccNum = req.getParameter("ccardnum");
        String ccExpireMonth = req.getParameter("ccexpiresmonth");
        String ccExpireYear = req.getParameter("ccexpiresyear");
        String cardHolder = req.getParameter("ccholdername");
        orderinfo = shoppingCart.createOrder(customerID, billName, billAddr1, billAddr2, billCity, billState, billZip, billPhone, shipName, shipAddr1, shipAddr2, shipCity, shipState, shipZip, shipPhone, creditCard, ccNum, ccExpireMonth, ccExpireYear, cardHolder, shippingMethod, shoppingCart.getItems());
        Util.debug("orderinfodone: order created");
      }
      if (orderinfo != null)
      {
        req.setAttribute(Util.ATTR_ORDERINFO, orderinfo);
        req.setAttribute(Util.ATTR_CARTITEMS, shoppingCart.getItems());
        session.setAttribute(Util.ATTR_ORDERKEY, orderinfo.getID());
        requestDispatch(getServletConfig().getServletContext(), req, resp, Util.PAGE_CHECKOUTFINAL);
      }
    }
    else if (action.equals(ACTION_COMPLETECHECKOUT))
    {
View Full Code Here

      //requestDispatch(getServletConfig().getServletContext(), req, resp, url);
      view=url;
    }
    else if (action.equalsIgnoreCase(ACTION_ORDERINFODONE)) {
      logger.debug("ShoppingController:performTask:orderinfodone");
      OrderInfo orderinfo = null;
      ShoppingCart shoppingCart = null;
      HttpSession session = req.getSession(true);
      CustomerInfo customerInfo = (CustomerInfo) session.getAttribute(Util.ATTR_CUSTOMER);
      String customerID = customerInfo.getCustomerID();
      shoppingCart = (ShoppingCart) session.getAttribute(Util.ATTR_CART);
      // Make sure ShopingCart reference has not timed out.
      try
      {
        logger.debug("orderinfodone: ShoppingCart timeout? check getItems() method");
        shoppingCart.getItems();
      }catch (RuntimeException e)
      {
        // ShoppingCart timed out, so create a new one.
        logger.debug("orderinfodone: ShoppingCart ref must have timed out");
        ShoppingCartContents cartContents = (ShoppingCartContents) session.getAttribute(Util.ATTR_CART_CONTENTS);
        if (cartContents != null)
        {
          shoppingCart = (ShoppingCart)WebUtil.getSpringBean(session.getServletContext(), "shopping");
          shoppingCart.setCartContents(cartContents);
        }
        else
        {
          logger.debug("NoSuchObject Exception!!!");
          logger.debug("Major Problem!!!");
          shoppingCart = null;
        }
      }
      logger.debug("orderinfodone: got cart?");
      if (shoppingCart != null)
      {
        logger.debug("orderinfodone: cart not NULL");
        String billName = req.getParameter("bname");
        String billAddr1 = req.getParameter("baddr1");
        String billAddr2 = req.getParameter("baddr2");
        String billCity = req.getParameter("bcity");
        String billState = req.getParameter("bstate");
        String billZip = req.getParameter("bzip");
        String billPhone = req.getParameter("bphone");
        String shipName = req.getParameter("sname");
        String shipAddr1 = req.getParameter("saddr1");
        String shipAddr2 = req.getParameter("saddr2");
        String shipCity = req.getParameter("scity");
        String shipState = req.getParameter("sstate");
        String shipZip = req.getParameter("szip");
        String shipPhone = req.getParameter("sphone");
        int shippingMethod = Integer.parseInt(req.getParameter("shippingMethod"));
        String creditCard = req.getParameter("ccardname");
        String ccNum = req.getParameter("ccardnum");
        String ccExpireMonth = req.getParameter("ccexpiresmonth");
        String ccExpireYear = req.getParameter("ccexpiresyear");
        String cardHolder = req.getParameter("ccholdername");
        orderinfo = shoppingCart.createOrder(customerID, billName, billAddr1, billAddr2, billCity, billState, billZip, billPhone, shipName, shipAddr1, shipAddr2, shipCity, shipState, shipZip, shipPhone, creditCard, ccNum, ccExpireMonth, ccExpireYear, cardHolder, shippingMethod, shoppingCart.getItems());
        logger.debug("orderinfodone: order created");
      }
      if (orderinfo != null)
      {
        req.setAttribute(Util.ATTR_ORDERINFO, orderinfo);
        req.setAttribute(Util.ATTR_CARTITEMS, shoppingCart.getItems());
        session.setAttribute(Util.ATTR_ORDERKEY, orderinfo.getID());
//        requestDispatch(getServletConfig().getServletContext(), req, resp, Util.PAGE_CHECKOUTFINAL);
        view=CHECKOUTFINAL;
      }
    }
    else if (action.equalsIgnoreCase(ACTION_COMPLETECHECKOUT))
View Full Code Here

TOP

Related Classes of com.emc.plants.pojo.beans.OrderInfo

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.