Exemplo n.º 1
0
        public ActionResult IndexRA(int i, int r)
        {
            try
            {
                var addedItem = db.Toy.Single(t => t.ToysId == i);
                var cart      = ShoppingCart.GC(this.HttpContext);
                //var w = WishlistManager.GW(this.HttpContext);
                //var identity = w.RWID();
                //var toyexist = !w.ToyDontExist(db.Toy.Find(r), identity);
                //if (toyexist)
                //{
                //    cart.ATC(addedItem, i);
                //    RFW(r);
                //}

                cart.ATC(addedItem, i);
                RFW(r);
                var w         = WishlistManager.GW(this.HttpContext);
                var viewModel = new WishlistViewModel
                {
                    WT = w.GWT()
                };
                return(View(viewModel));
            }
            catch
            {
                return(RedirectToAction("Index"));
            }
        }
Exemplo n.º 2
0
        public void AddPartial(int id)
        {
            var addedItem = db.Toy.Single(t => t.ToysId == id);
            var w         = WishlistManager.GW(this.HttpContext);

            w.ATW(addedItem, id);
            //return PartialView("CartSummary");
        }
        private void MW(string Email)
        {
            //associate shopping cart item with logged in user
            var W = WishlistManager.GW(this.HttpContext);

            W.MigrateWishlist(Email);
            Session[WishlistManager.WishlistSessionKey] = Email;
        }
Exemplo n.º 4
0
 public void RFW(int id)
 {
     if (id != null)
     {
         var    w       = WishlistManager.GW(this.HttpContext);
         string toyName = db.Wishlist.Single(t => t.WishlistId == id).Toy.ToysName;
         w.RFW(id);
     }
 }
Exemplo n.º 5
0
        public ActionResult ATW(int id)
        {
            var addedItem = db.Toy.Single(t => t.ToysId == id);
            var w         = WishlistManager.GW(this.HttpContext);

            w.ATW(addedItem, id);

            return(RedirectToAction("index"));
        }
Exemplo n.º 6
0
        public ActionResult Index()
        {
            var w         = WishlistManager.GW(this.HttpContext);
            var viewModel = new WishlistViewModel
            {
                WT = w.GWT()
            };

            return(View(viewModel));
        }
Exemplo n.º 7
0
        public ActionResult IndexR(int r)
        {
            try
            {
                var w = WishlistManager.GW(this.HttpContext);
                //var identity = w.RWID();
                //var toyexist = !w.ToyDontExist(db.Toy.Find(r), identity);
                //if (toyexist)
                //{
                //    RFW(r);
                //}
                RFW(r);

                var viewModel = new WishlistViewModel
                {
                    WT = w.GWT()
                };
                return(View(viewModel));
            }
            catch
            {
                return(RedirectToAction("Index"));
            }
        }