Esempio n. 1
0
        public IActionResult Item(int id)
        {
            Product  product  = null;
            Category category = null;

            product  = _allProducts.GetObjectProduct(id);
            category = _productCategories.AllCategories.FirstOrDefault(i => i.Id == product.CategoryId);
            var productObject = new ProductViewModel {
                Product = product, CurrentCategory = category.CategoryName
            };

            return(View(productObject));
        }
Esempio n. 2
0
        public IActionResult UpdateProduct(int id, string message)
        {
            var product = productRep.GetObjectProduct(id);

            for (int i = product.Imgs.Count; i < 6; i++)
            {
                product.Imgs.Add(new Photo());
            }

            ViewBag.Category    = categoryRep.GetAllSubcategories();
            ViewBag.Manufacture = manufacturerRep.GetAlIManufacturers().ToList();
            ViewBag.message     = message;
            return(View(product));
        }
Esempio n. 3
0
        public IActionResult Product(int id)
        {
            var product = productRep.GetObjectProduct(id);

            return(View(product));
        }