Package com.ateam.webstore.model

Examples of com.ateam.webstore.model.WishList


*/
public class WishListDAO extends GenericDAOImpl<WishList, Serializable> {

  public WishList getByCustomer(Serializable customer) {
   
    WishList WishList = null;
   
    try {
      Query query = getPersistenceManager().newQuery(getPersistentClass(), "customer == :customer");
      query.setUnique(true);
      WishList = (WishList) query.execute(customer);
View Full Code Here


  }

 
  public WishList getWishList() {
    Visitor v = (Visitor) req.getSession().getAttribute(SESSION_ATTRIBUTE_VISITOR);
    WishList wl = service.getByCustomerId(v.getCustomer().getId());
    return wl;
  }
View Full Code Here

   */
  public WishListView getWishListView() {

    WishListView wlv = new WishListView(getMainView());
   
    WishList wl = getWishList();
   
    if (req.getParameter(Parameters.REMOVE.getId()) != null) {
      String removeId = req.getParameter(Parameters.REMOVE.getId());
      l.info("removing wish list item "+removeId+" for session: "+req.getSession().getId());
      ProductsInWishListService piwls = new ProductsInWishListService();
      ProductsInWishList piwl = piwls.getById(new Long(removeId));
      piwls.remove(piwl);
    }

    wlv.setWishList(wl);
   
    wlv.addContentView(new ContentView(JSP_WISHLIST, wl.getName()));
   
    return wlv;
   
  }
View Full Code Here

      CustomerHandler ch = new CustomerHandler(req);
      add.setResultView(ch.getLoginView("Please first login"));
      return add;
    }
   
    WishList wl = getWishList();
    if (wl == null) {
      wl = new WishList(v.getCustomer());
      wl.setName("My Wish List");
      wl = service.store(wl);
    }
   
    l.fine("adding prodId :"+prodId);

    ProductsInWishList prodInList = new ProductsInWishList(1, wl,new ProductService().getById(new Long(prodId)));
    wl.addProduct(prodInList);
    service.store(wl);

    add.setResultView(getWishListView());
   
    return add;
View Full Code Here

  }


  public FormSubmission moveSelectedToCart() {

    WishList wl = getWishList();
    CartHandler ch = new CartHandler(req);
    ProductsInWishListService pinwl = new ProductsInWishListService();
    FormSubmission fs = new FormSubmission();
   
    int i = 0;
   
    for (ProductsInWishList p : wl.getProducts()) {
      String prodId = p.getProduct().getId()+"";
      if (req.getParameter(prodId) != null) {
        l.fine("moving prodId :"+prodId+" to cart");
        ch.addProduct(prodId);
        pinwl.remove(p);
View Full Code Here

TOP

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

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.