public IActionResult DeleteConfirmed(string id) { AIRCRAFT aIRCRAFT = _context.AIRCRAFT.Single(m => m.AC_NUMBER == id); _context.AIRCRAFT.Remove(aIRCRAFT); _context.SaveChanges(); return(RedirectToAction("Index")); }
public IActionResult Edit(AIRCRAFT aIRCRAFT) { if (ModelState.IsValid) { _context.Update(aIRCRAFT); _context.SaveChanges(); return(RedirectToAction("Index")); } ViewData["MOD_CODE"] = new SelectList(_context.MODEL, "MOD_CODE", "MOD_CODENavigation", aIRCRAFT.MOD_CODE); return(View(aIRCRAFT)); }
// GET: AIRCRAFT/Edit/5 public IActionResult Edit(string id) { if (id == null) { return(HttpNotFound()); } AIRCRAFT aIRCRAFT = _context.AIRCRAFT.Single(m => m.AC_NUMBER == id); if (aIRCRAFT == null) { return(HttpNotFound()); } ViewData["MOD_CODE"] = new SelectList(_context.MODEL, "MOD_CODE", "MOD_CODENavigation", aIRCRAFT.MOD_CODE); return(View(aIRCRAFT)); }
// GET: AIRCRAFT/Details/5 public IActionResult Details(string id) { if (id == null) { return(HttpNotFound()); } AIRCRAFT aIRCRAFT = _context.AIRCRAFT.Single(m => m.AC_NUMBER == id); if (aIRCRAFT == null) { return(HttpNotFound()); } return(View(aIRCRAFT)); }