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 }));
        }
示例#2
0
        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 }));
        }
示例#3
0
        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 }));
            }
        }
示例#4
0
 public Decorator(Person person, ICloth cloth)
 {
     this.person = person;
     this.cloth  = cloth;
 }