예제 #1
0
        public ActionResult CancelOrder()
        {
            SessionHelper session = new SessionHelper();
            string id = session.SessionID;

            ProductVisitRepo pvr = new ProductVisitRepo();
            pvr.removeProductVisit(id);

            //VisitRepo visitRepo = new VisitRepo();
            //visitRepo.removeVisit(id);

            return RedirectToAction("Index", "Cart");
        }
예제 #2
0
        public ActionResult ViewCart(int productId, int qty)
        {
            if (qty < 1)
            {
                TempData["error"] = "A positive quantity must be used";
                return RedirectToAction("Add", "Cart", new { id = productId });
            }

            ShoppingCartEntities db = new ShoppingCartEntities();

            SessionHelper session = new SessionHelper();
            string id = session.SessionID;

            ProductVisitRepo pvRepo = new ProductVisitRepo();
            pvRepo.addProductVisit(id, productId, qty, DateTime.Now);

            return RedirectToAction("MyCart", "Cart");
        }