public ActionResult DeleteConfirmed(int id) { NorthWestOffices northWestOffices = db.northwestoffices.Find(id); db.northwestoffices.Remove(northWestOffices); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "OfficeID,Description,Location")] NorthWestOffices northWestOffices) { if (ModelState.IsValid) { db.Entry(northWestOffices).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(northWestOffices)); }
public ActionResult Create([Bind(Include = "OfficeID,Description,Location")] NorthWestOffices northWestOffices) { if (ModelState.IsValid) { db.northwestoffices.Add(northWestOffices); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(northWestOffices)); }
// GET: NorthWestOffices/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } NorthWestOffices northWestOffices = db.northwestoffices.Find(id); if (northWestOffices == null) { return(HttpNotFound()); } return(View(northWestOffices)); }