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