public RedirectToRouteResult RemoveFromCart(ShoppingCart cart, int ClothId, string returnUrl) { ICloth cloth = _uow.Clothes.Get(ClothId); if (cloth != null) { cart.RemoveItem((Cloth)cloth); } return(RedirectToAction("Index", new { returnUrl })); }
public ActionResult RemoveFromCart(ShoppingCart cart, int ClothId, string returnUrl, bool IsPartial = false) { ICloth cloth = _uow.Clothes.Get(ClothId); if (cloth != null) { cart.RemoveItem((Cloth)cloth); } if (IsPartial) { return(RedirectToAction("Index", "Home"));//new EmptyResult(); } return(RedirectToAction("Index", new { returnUrl })); }
public ActionResult AddToCart(ShoppingCart cart, int ClothId, string returnUrl, bool IsPartial = true) { ICloth cloth = _uow.Clothes.Get(ClothId); if (cloth != null) { cart.AddItem((Cloth)cloth, 1); } if (IsPartial) { return(RedirectToAction("Summary")); } else { return(RedirectToAction("Index", new { returnUrl })); } }
public Decorator(Person person, ICloth cloth) { this.person = person; this.cloth = cloth; }