Exemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "RestauranteFavoritoId,Email,RestauranteId")] RestauranteFavorito restauranteFavorito)
 {
     if (ModelState.IsValid)
     {
         db.Entry(restauranteFavorito).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RestauranteId = new SelectList(db.Restaurantes, "RestauranteId", "Email", restauranteFavorito.RestauranteId);
     return(View(restauranteFavorito));
 }
Exemplo n.º 2
0
        public ActionResult Edit([Bind(Include = "PlatoId,Nombre,Disponible,Restaurante")] Plato plato)
        {
            if (ModelState.IsValid)
            {
                plato.Restaurante     = (from obj in db.Restaurantes where obj.Email == User.Identity.Name select obj).SingleOrDefault();
                db.Entry(plato).State = EntityState.Modified;
                db.SaveChanges();

                EnviarNotificacionPlato(plato, plato.Disponible);

                return(RedirectToAction("Index"));
            }
            return(View(plato));
        }
Exemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "Email,RestauranteId,RazonSocial,RUC,Direccion,Latitud,Longitud,AforoCompleto,Estado,MesaDisponible")] Restaurante restaurante)
 {
     if (ModelState.IsValid)
     {
         db.Entry(restaurante).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(restaurante));
 }