예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            RestauranteValoracion restauranteValoracion = db.RestauranteValoracion.Find(id);

            db.RestauranteValoracion.Remove(restauranteValoracion);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 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));
 }
예제 #3
0
        // 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));
        }
예제 #4
0
        // 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));
        }