示例#1
0
        public ActionResult DeleteConfirm(int id)
        {
            SessionCartManager sessCartMgr = new SessionCartManager();

            sessCartMgr.DeleteRegistration(id);

            //Does the Delete
            return(RedirectToAction("Index"));
        }
示例#2
0
        public ActionResult Delete(int id)
        {
            SessionCartManager sessCrtMgr = new SessionCartManager();

            SessionCart sessCart = sessCrtMgr.GetSessionCart(id);

            SessionCartViewModel sessCartVM = new SessionCartViewModel(sessCart);

            return(View(sessCartVM));
        }
示例#3
0
        // GET: SessionCart
        public ActionResult Index()
        {
            SessionCartManager cartMgr = new SessionCartManager();

            IQueryable <SessionCart> allItems = cartMgr.GetAllSessionsByUser(User.Identity.Name, null);

            List <SessionCartViewModel> cartVM = new List <SessionCartViewModel>();

            foreach (var item in allItems)
            {
                cartVM.Add(new SessionCartViewModel(item));
            }

            return(View(cartVM));
        }
示例#4
0
        public ActionResult Index(List <SessionViewModel> allSessionsVM)
        {
            //Filter all Products View Model to be selected only
            allSessionsVM = allSessionsVM.Where(p => p.IsSelected == true).ToList();

            //Build ShoppingCart Manager
            SessionCartManager cartMgr = new SessionCartManager();

            //Add Selected Products to the ShoppingCart
            foreach (SessionViewModel sessVM in allSessionsVM)
            {
                cartMgr.AddToCart(User.Identity.Name, sessVM.Id);
            }

            //Redirect to Shopping Cart View
            return(RedirectToAction("Index", "SessionCart"));
        }