public ActionResult DeleteConfirmed(int id) { AspNetDurationType aspNetDurationType = db.AspNetDurationTypes.Find(id); db.AspNetDurationTypes.Remove(aspNetDurationType); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,TypeName")] AspNetDurationType aspNetDurationType) { if (ModelState.IsValid) { db.Entry(aspNetDurationType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aspNetDurationType)); }
public ActionResult Create([Bind(Include = "Id,TypeName")] AspNetDurationType aspNetDurationType) { if (ModelState.IsValid) { db.AspNetDurationTypes.Add(aspNetDurationType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aspNetDurationType)); }
// GET: AspNetDurationType/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AspNetDurationType aspNetDurationType = db.AspNetDurationTypes.Find(id); if (aspNetDurationType == null) { return(HttpNotFound()); } return(View(aspNetDurationType)); }
public ActionResult DeleteCnfm(int id) { AspNetDurationType aspNetDurationType = db.AspNetDurationTypes.Find(id); try { db.AspNetDurationTypes.Remove(aspNetDurationType); db.SaveChanges(); return(RedirectToAction("Index")); } catch { ViewBag.Error = "It can't be deleted"; return(View("Details", aspNetDurationType)); } }