public ActionResult DeleteConfirmed(int id) { destinos destinos = db.destinos.Find(id); db.destinos.Remove(destinos); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,nombre,direccion,id_comuna,telefono,mail")] destinos destinos) { if (ModelState.IsValid) { db.Entry(destinos).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.id_comuna = new SelectList(db.comunas, "id", "comuna", destinos.id_comuna); return(View(destinos)); }
public ActionResult Create([Bind(Include = "id,nombre,direccion,id_comuna,telefono,mail")] destinos destinos) { if (ModelState.IsValid) { db.destinos.Add(destinos); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.region = new SelectList(db.regiones, "id", "region"); ViewBag.id_comuna = new SelectList(db.comunas, "id", "comuna", destinos.id_comuna); return(View(destinos)); }
// GET: Destinos/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } destinos destinos = db.destinos.Find(id); if (destinos == null) { return(HttpNotFound()); } return(View(destinos)); }
// GET: Destinos/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } destinos destinos = db.destinos.Find(id); if (destinos == null) { return(HttpNotFound()); } ViewBag.id_comuna = new SelectList(db.comunas, "id", "comuna", destinos.id_comuna); return(View(destinos)); }