public ActionResult DeleteConfirmed(int id) { Sesh sesh = db.Seshes.Find(id); db.Seshes.Remove(sesh); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "SeshID,Date,Time,Venue")] Sesh sesh) { if (ModelState.IsValid) { db.Entry(sesh).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sesh)); }
public ActionResult Create([Bind(Include = "SeshID,Date,Time,Venue")] Sesh sesh) { if (ModelState.IsValid) { db.Seshes.Add(sesh); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sesh)); }
// GET: Seshes/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Sesh sesh = db.Seshes.Find(id); if (sesh == null) { return(HttpNotFound()); } return(View(sesh)); }