예제 #1
0
        public IActionResult ShoppingCart()
        {
            int AccountID = Convert.ToInt32(HttpContext.Session.GetString("AccountID"));

            ShoppingCartViewModel model = new ShoppingCartViewModel()
            {
                AccountID = AccountID,
                items     = shopLogic.GetBagItems(AccountID)
            };
            int subtotal = 0;

            for (int i = 0; i < model.items.Count; i++)
            {
                subtotal += model.items[i].shoe.Price;
            }

            model.SubTotal = subtotal;

            return(View(model));
        }