public ActionResult DeleteConfirmed(long id) { Models.Security.SiteMap siteMap = db.SiteMaps.Find(id); db.SiteMaps.Remove(siteMap); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "SiteMapId,Name")] Models.Security.SiteMap siteMap) { if (ModelState.IsValid) { db.Entry(siteMap).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(siteMap)); }
public ActionResult Create([Bind(Include = "SiteMapId,Name")] Models.Security.SiteMap siteMap) { if (ModelState.IsValid) { db.SiteMaps.Add(siteMap); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(siteMap)); }
// GET: SiteMaps/Delete/5 public ActionResult Delete(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Models.Security.SiteMap siteMap = db.SiteMaps.Find(id); if (siteMap == null) { return(HttpNotFound()); } return(View(siteMap)); }