Search in sources :

Example 1 with SvBasket

use of com.teachMeSkills.an15.VorobyovSergey.hwSix.Task3.models.SvBasket in project AN15 by IharDubkou.

the class SvCatalogServiceImpl method addProductInBasket.

@Override
public void addProductInBasket(SvUser user, SvProduct product) {
    System.out.println("\nКорзина покупателя");
    SvBasket basket = user.getUserBasket();
    basket.addToBasket(product);
    user.setUserBasket(basket);
    System.out.println("В корзине теперь");
    for (SvProduct p : user.getUserBasket().getProductList()) {
        System.out.println(p);
    }
}
Also used : SvBasket(com.teachMeSkills.an15.VorobyovSergey.hwSix.Task3.models.SvBasket) SvProduct(com.teachMeSkills.an15.VorobyovSergey.hwSix.Task3.models.SvProduct)

Aggregations

SvBasket (com.teachMeSkills.an15.VorobyovSergey.hwSix.Task3.models.SvBasket)1 SvProduct (com.teachMeSkills.an15.VorobyovSergey.hwSix.Task3.models.SvProduct)1