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)))); }
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")); }
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); }