Пример #1
0
        public ActionResult AddShoeSubmit(Shoe shoe, HttpPostedFileBase file)
        {
            if (file != null && file.ContentLength > 0)
            {
                shoe.Image = file.FileName;
                string appPath = Request.PhysicalApplicationPath;
                file.SaveAs(appPath + @"\Content\Images\Shoes\" + file.FileName);
            }

            shoeFac.Add(shoe);
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public IActionResult AddShoe(Shoe newShoe)
 {
     shoeFactory.Add(newShoe);
     return(RedirectToAction("Index"));
 }