Examples of CustomerInfo


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

   */
  public CustomerInfo updateUser(String customerID, String firstName, String lastName,
      String addr1, String addr2, String addrCity,
      String addrState, String addrZip,String phone)
  {
    CustomerInfo customerInfo = null;
    // TODO: lowp: no lock check is performed to see if cust data has changed since fetch!
    /*
     customerHome = (CustomerHome) Util.getEJBLocalHome("java:comp/env/ejb/Customer",
     com.ibm.websphere.samples.pbwjpa.CustomerHome.class);
    
     Customer customer = customerHome.findByPrimaryKeyUpdate(customerID);
     customer.update(firstName, lastName, addr1, addr2, addrCity, addrState, addrZip, phone);
     customerInfo = new CustomerInfo(customer);
     */
        EntityManager em = entityManagerFactory.createEntityManager();
        em.getTransaction().begin();
    Customer c = em.find(Customer.class, customerID);
    em.lock(c, LockModeType.WRITE);
    em.refresh(c);
    // TODO: lowp: test and set for update performance?
    c.setFirstName(firstName);
    c.setLastName(lastName);
    c.setAddr1(addr1);
    c.setAddr2(addr2);
    c.setAddrCity(addrCity);
    c.setAddrState(addrState);
    c.setAddrZip(addrZip);
    c.setPhone(phone);
   
    customerInfo = new CustomerInfo(c);
    em.getTransaction().commit();
    return customerInfo;
  }
View Full Code Here

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

  {
   

    //EntityManager em = entityManagerFactory.createEntityManager();
   
    CustomerInfo customerInfo = null;
    /*
     customerHome = (CustomerHome) Util.getEJBLocalHome("java:comp/env/ejb/Customer",
     com.ibm.websphere.samples.pbwjpa.CustomerHome.class);
    
     Customer customer = customerHome.findByPrimaryKey(new CustomerKey(customerID));
     customerInfo = new CustomerInfo(customer);
     */
        EntityManager em = entityManagerFactory.createEntityManager();
        System.out.println(" Entity Manager :: "+em);
    Customer c = em.find(Customer.class, customerID);
    customerInfo = new CustomerInfo(c);
    return customerInfo;
   
  }
View Full Code Here

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

    else if (action.equalsIgnoreCase(ACTION_INITCHECKOUT))
    {
      logger.debug("ShoppingController:performTask:initCheckout");
      String url;
      HttpSession session = req.getSession(true);
      CustomerInfo customerInfo = (CustomerInfo) session.getAttribute(Util.ATTR_CUSTOMER);
      if (customerInfo == null)
      {
        req.setAttribute(Util.ATTR_RESULTS, "You must login or register before checking out.");
        session.setAttribute(Util.ATTR_CHECKOUT, new Boolean(true));
        url = LOGIN;
      }
      else
      {
        url = ORDERINFO;
      }
      //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))
    {
      ShoppingCart shoppingCart = null;
      HttpSession session = req.getSession(true);
      long key = (Long) session.getAttribute(Util.ATTR_ORDERKEY);
      req.setAttribute(Util.ATTR_ORDERID, key);
      long orderKey = key;
      logger.debug("completecheckout: order id ="+orderKey );
      CustomerInfo customerInfo = (CustomerInfo) session.getAttribute(Util.ATTR_CUSTOMER);
      // Check the available inventory and backorder if necessary.
      shoppingCart = (ShoppingCart) session.getAttribute(Util.ATTR_CART);
     
      // Make sure ShopingCart reference has not timed out.
      try {
        logger.debug("completecheckout: ShoppingCart timeout? check getItems() method");
        shoppingCart.getItems();
      } catch (RuntimeException e) {
        // ShoppingCart timed out, so create a new one.
        logger.debug("completecheckout: 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;
        }
      }
     
      if (shoppingCart != null) {
        ShoppingCartItem si;
        Collection items = shoppingCart.getItems();
        for (Object o : items) {
          si = (ShoppingCartItem) o;
          shoppingCart.checkInventory(si);
          logger.debug("ShoppingCart.checkInventory() - checking Inventory quantity of item: "
              + si.getID());
        }
      }

     
      try {
        PaymentInfoPublisher pInfoPublisher = (PaymentInfoPublisher) Util
            .getSpringBean("paymentInfoPublisher");

        pInfoPublisher
            .publishMessage("Order placed successfully for Customer : "
                + customerInfo.getCustomerID()
                + " with Order ID : " + orderKey);
      } catch (Exception e) {
        System.out
            .println("Exception during Posting message to RabbitMQ :"
                + e);
View Full Code Here

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

 
  @RequestMapping(method = RequestMethod.GET)
  public String account(HttpServletRequest req) throws ServletException {
    String url;
        HttpSession session = req.getSession(true);
        CustomerInfo customerInfo = (CustomerInfo) session.getAttribute(Util.ATTR_CUSTOMER);
        if (customerInfo == null)
        {
           url = ACTION_LOGIN;
           req.setAttribute(Util.ATTR_UPDATING, "true");
           req.setAttribute(Util.ATTR_RESULTS, "\nYou must login first.");
View Full Code Here

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

               url = ACTION_REGISTER;
            }
            else
            {
               // Create the new user.
               CustomerInfo customerInfo =
                     login.createNewUser(userid, password, firstName,
                                         lastName, addr1, addr2,
                                         addrCity, addrState, addrZip, phone);

               if (customerInfo != null)
View Full Code Here

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

                    session.removeAttribute(Util.ATTR_CHECKOUT);
                    session.removeAttribute(Util.ATTR_ORDERKEY);
                 }

                 // Store customer userid in HttpSession.
                 CustomerInfo customerInfo = login.getCustomerInfo(userid);
                 session.setAttribute(Util.ATTR_CUSTOMER, customerInfo);
                 Util.debug("updating=" + updating + "=");

                 // Was customer trying to edit account information.
                 if (updating.equals("true"))
View Full Code Here

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

      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");
View Full Code Here

Examples of com.openbravo.pos.customers.CustomerInfo

        m_Dirty = new DirtyManager();
        m_timereservation.addPropertyChangeListener("Date", m_Dirty);
        txtCustomer.addPropertyChangeListener("Text", m_Dirty);
        txtCustomer.addPropertyChangeListener("Text", new PropertyChangeListener(){
            public void propertyChange(PropertyChangeEvent evt) {
                customer = new CustomerInfo(null);
                customer.setTaxid(null);
                customer.setSearchkey(null);
                customer.setName(txtCustomer.getText());           
            }
        });
View Full Code Here

Examples of com.openbravo.pos.customers.CustomerInfo

   
    public void writeValueEOF() {
        m_sID = null;
        m_dCreated = null;
        m_timereservation.setDate(null);
        assignCustomer(new CustomerInfo(null));
        m_jtxtChairs.reset();
        m_bReceived = false;
        m_jtxtDescription.reset();
        m_timereservation.setEnabled(false);
        txtCustomer.setEnabled(false);
View Full Code Here

Examples of com.openbravo.pos.customers.CustomerInfo

    public void writeValueInsert() {
        m_sID = null;
        m_dCreated = null;
        m_timereservation.setCheckDates(m_dcurrentday, new Date(m_dcurrentday.getTime() + 3600000L));
        m_timereservation.setDate(m_dcurrentday);
        assignCustomer(new CustomerInfo(null));
        m_jtxtChairs.setValueInteger(2);
        m_bReceived = false;
        m_jtxtDescription.reset();
        m_timereservation.setEnabled(true);
        txtCustomer.setEnabled(true);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.