public ActionResult ShoppingBasketItems()
        {
            int?        ClientId    = HttpContext.Session.GetInt32("ClientId");
            ClientLogic ClientLogic = new ClientLogic();

            ViewData["List"] = ClientLogic.GetAllProductsForUser(Convert.ToInt32(ClientId));
            //products.Add(new Product{ProductName="pp"});



            return(View(ClientLogic.GetAllProductsForUser(Convert.ToInt32(ClientId))));
        }
예제 #2
0
        public ActionResult ProductenKopen()
        {
            int?                ClientId = HttpContext.Session.GetInt32("ClientId");
            ClientLogic         Clientlo = new ClientLogic();
            ShoppingBasketLogic basket   = new ShoppingBasketLogic();

            foreach (Product i in Clientlo.GetAllProductsForUser(Convert.ToInt32(ClientId)))
            {
                Clientlo.SetOrder(Convert.ToInt32(ClientId), i.ProductId);
            }

            return(RedirectToAction("HomeClient", "Home"));
        }
예제 #3
0
        public void GetAllProductsForUser_GetProductsFromShoppingBasket_ProductsFromShoppingBasketGetted()
        {
            int ProductsCount;
            int expectProductsCount;
            int clientid = 3039; // Name of Client: sam

            ClientLogic clientlogic = new ClientLogic();

            ProductsCount = clientlogic.GetAllProductsForUser(clientid).Count;

            expectProductsCount = clientlogic.GetProdctsCountOfUserInShoppingBasket(clientid);


            Assert.Equal(expectProductsCount, ProductsCount);
        }