Ejemplo n.º 1
0
        public ActionResult AddProduct(AddProductModel model, HttpPostedFileBase[] Image)
        {
            string path     = Server.MapPath(ConfigurationManager.AppSettings["imagesPath"]);
            string miniPath = Server.MapPath(ConfigurationManager.AppSettings["MiniImages"]);

            if (postRepository.AddProduct(model.Title, model.Description, Image, model.Quantity, model.IsIn, model.categoryId, model.Price, path, miniPath))
            {
                return(RedirectToAction("Products", "Admin"));
            }
            else
            {
                return(View(model));
            }
        }