public ActionResult DeleteConfirmed(int id) { ArkivFond arkivFond = db.ArkivFond.Find(id); db.ArkivFond.Remove(arkivFond); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ArkivfondID,ArkivNr,ArkivNavn,ArkivDef,ArkivType,StiftetDay,StiftetMonth,StiftetYear,AfsluttetDay,AfsluttetMonth,AfsluttetYear,Adresse,Postnr,By,Note")] ArkivFond arkivFond) { if (ModelState.IsValid) { db.Entry(arkivFond).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(arkivFond)); }
// GET: ArkivFonds/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ArkivFond arkivFond = db.ArkivFond.Find(id); if (arkivFond == null) { return(HttpNotFound()); } return(View(arkivFond)); }