// GET: ShoesForSale/Edit/5 (DONE) public ActionResult Edit(int id) { ShoesForSale shoesForSale = context.ZapatosParaVenda.Find(id); if (shoesForSale == null) { return(HttpNotFound()); } return(View(shoesForSale)); }
public ActionResult Create(ShoesForSale shoesForSale) { if (ModelState.IsValid) { context.ZapatosParaVenda.Add(shoesForSale); context.SaveChanges(); return(RedirectToAction("Index")); } return(View(shoesForSale)); }
public ActionResult Edit(int id, ShoesForSale shoesForSale) { try { var ShoesForSaleInDb = context.ZapatosParaVenda.Where(s => s.Id == shoesForSale.Id).SingleOrDefault(); ShoesForSaleInDb.BrandofShoeForSale = shoesForSale.BrandofShoeForSale; ShoesForSaleInDb.NameOfShoe = shoesForSale.NameOfShoe; ShoesForSaleInDb.CondiciondeZapatos = shoesForSale.CondiciondeZapatos; ShoesForSaleInDb.GetShoeSizeForSale = shoesForSale.GetShoeSizeForSale; ShoesForSaleInDb.ShoePrice = shoesForSale.ShoePrice; context.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
// GET: ShoesForSale/Create (DONE) public ActionResult Create() { ShoesForSale shoesForSale = new ShoesForSale(); return(View(shoesForSale)); }
// GET: ShoesForSale/Details/5 (Done) public ActionResult Details(int id) { ShoesForSale shoesForSale = context.ZapatosParaVenda.Where(z => z.Id == id).Single(); return(View(shoesForSale)); }