public ActionResult DeleteConfirmed(int id) { Organisers organisers = db.Organisers.Find(id); db.Organisers.Remove(organisers); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "OrganiserId,HireDateTime,FirstName,LastName,Email,ContactNumber")] Organisers organisers) { if (ModelState.IsValid) { db.Entry(organisers).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(organisers)); }
public ActionResult Create([Bind(Include = "OrganiserId,HireDateTime,FirstName,LastName,Email,ContactNumber")] Organisers organisers) { if (ModelState.IsValid) { db.Organisers.Add(organisers); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(organisers)); }
// GET: Organisers/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Organisers organisers = db.Organisers.Find(id); if (organisers == null) { return(HttpNotFound()); } return(View(organisers)); }