Beispiel #1
0
        public IActionResult GetProduct(int id)
        {
            Product product = new Product();

            product.Categorylist = productlogic.GetAllCategoryNames();
            return(View(productlogic.GetProduct(id)));
        }
Beispiel #2
0
        public IActionResult CreateOrder()
        {
            //List<Product> products = new List<Product>;
            //foreach(var product in productViewmodel.products)
            //{

            //}

            var a = new Account
            {
                id = 18
            };
            List <int>     k        = HttpContext.Session.Get <List <int> >("Cart");
            List <Product> products = new List <Product>();

            if (k == null)
            {
                return(View());
            }

            foreach (int productId in k)
            {
                var product = productLogic.GetProduct(productId);

                products.Add(product);
            }
            orderLogic.Creat(products, a);

            return(View());
        }
Beispiel #3
0
        public IActionResult Items()
        {
            Productviewmodel productViewModel = new Productviewmodel();

            productViewModel.products = new List <Product>();
            List <int> k = HttpContext.Session.Get <List <int> >("Cart");

            if (k == null)
            {
                return(View(productViewModel));
            }


            foreach (int productId in k)
            {
                var product = productLogic.GetProduct(productId);

                productViewModel.products.Add(product);
            }
            return(View(productViewModel));
        }