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