Esempio n. 1
0
 public ActionResult Edit(int id, Hotel hotel)
 {
     try
     {
         // TODO: Add update logic here
         if (ModelState.IsValid)
         {
             hotelService.AlterarHotel(hotel);
             TempData["resultado"]  = "Editado";
             TempData["id"]         = hotel.HotelId;
             TempData["nome"]       = hotel.Nome;
             TempData["controller"] = "Hotel";
             return(RedirectToAction("Index"));
         }
         else
         {
             return(View(hotel));
         }
     }
     catch
     {
         TempData["resultado"] = "Erro";
         return(View(hotel));
     }
 }
Esempio n. 2
0
        public ActionResult Alterar(Hotel hotel)
        {
            if (ModelState.IsValid)
            {
                hotelService.AlterarHotel(hotel);

                return(RedirectToAction("Index"));
            }
            return(View(hotel));
        }