예제 #1
0
 public ActionResult DeleteConfirmed(long id)
 {
     Models.Security.SiteMap siteMap = db.SiteMaps.Find(id);
     db.SiteMaps.Remove(siteMap);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
예제 #2
0
 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));
 }
예제 #3
0
        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));
        }
예제 #4
0
 // 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));
 }