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