예제 #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));
        }
예제 #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));
        }
예제 #3
0
        public IActionResult Product(int id)
        {
            var product = productRep.GetObjectProduct(id);

            return(View(product));
        }