public ActionResult DeleteConfirmed(int id) { DoInFlight doInFlight = db.DoInFlights.Find(id); db.DoInFlights.Remove(doInFlight); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "DoInFlightID,Name")] DoInFlight doInFlight) { if (ModelState.IsValid) { db.Entry(doInFlight).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(doInFlight)); }
public ActionResult Create([Bind(Include = "DoInFlightID,Name")] DoInFlight doInFlight) { if (ModelState.IsValid) { db.DoInFlights.Add(doInFlight); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(doInFlight)); }
// GET: DoInFlights/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DoInFlight doInFlight = db.DoInFlights.Find(id); if (doInFlight == null) { return(HttpNotFound()); } return(View(doInFlight)); }