public ActionResult DeleteConfirmed(string id) { aeroplane aeroplane = db.aeroplanes.Find(id); db.aeroplanes.Remove(aeroplane); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "planes,company,price")] aeroplane aeroplane) { if (ModelState.IsValid) { db.Entry(aeroplane).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aeroplane)); }
public ActionResult Create([Bind(Include = "planes,company,price")] aeroplane aeroplane) { if (ModelState.IsValid) { db.aeroplanes.Add(aeroplane); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aeroplane)); }
// GET: aeroplanes/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } aeroplane aeroplane = db.aeroplanes.Find(id); if (aeroplane == null) { return(HttpNotFound()); } return(View(aeroplane)); }