public ActionResult DeleteConfirmed(int id) { RestauranteValoracion restauranteValoracion = db.RestauranteValoracion.Find(id); db.RestauranteValoracion.Remove(restauranteValoracion); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,ID_USUARIO,ID_RESTAURANTE,VALOR")] RestauranteValoracion restauranteValoracion) { if (ModelState.IsValid) { db.Entry(restauranteValoracion).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ID_RESTAURANTE = new SelectList(db.Restaurante, "ID", "NOMBRE", restauranteValoracion.ID_RESTAURANTE); ViewBag.ID_USUARIO = new SelectList(db.Usuario, "ID", "NOMBRE", restauranteValoracion.ID_USUARIO); return(View(restauranteValoracion)); }
// GET: RestauranteValoracions/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RestauranteValoracion restauranteValoracion = db.RestauranteValoracion.Find(id); if (restauranteValoracion == null) { return(HttpNotFound()); } return(View(restauranteValoracion)); }
// GET: RestauranteValoracions/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RestauranteValoracion restauranteValoracion = db.RestauranteValoracion.Find(id); if (restauranteValoracion == null) { return(HttpNotFound()); } ViewBag.ID_RESTAURANTE = new SelectList(db.Restaurante, "ID", "NOMBRE", restauranteValoracion.ID_RESTAURANTE); ViewBag.ID_USUARIO = new SelectList(db.Usuario, "ID", "NOMBRE", restauranteValoracion.ID_USUARIO); return(View(restauranteValoracion)); }