public ActionResult DeleteConfirmed(int id) { TopStuff topStuff = db.TopStuffs.Find(id); db.TopStuffs.Remove(topStuff); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "TopsID,Name,Photo,Type,Color,Season,Occasion")] TopStuff topStuff) { if (ModelState.IsValid) { db.Entry(topStuff).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(topStuff)); }
public ActionResult Create([Bind(Include = "TopsID,Name,Photo,Type,Color,Season,Occasion")] TopStuff topStuff) { if (ModelState.IsValid) { db.TopStuffs.Add(topStuff); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(topStuff)); }
// GET: TopStuffs/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TopStuff topStuff = db.TopStuffs.Find(id); if (topStuff == null) { return(HttpNotFound()); } return(View(topStuff)); }