示例#1
0
        public IActionResult Index()
        {
            string sessionID = HttpContext.Request.Cookies["sessionId"];
            string userID    = HttpContext.Request.Cookies["userId"];

            List <Purchase> purchases = PurchaseData.getUserPurchases(userID);

            ViewData["Purchases"] = purchases;

            ViewData["UserId"] = userID;

            ViewData["sessionId"] = sessionID;
            Session sess = new Session()
            {
                SessionId = sessionID,
                UserId    = userID
            };
            int totalItems = CartData.GetTotalItems(sess);

            ViewData["TotalItems"] = totalItems;
            return(View());
        }