Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            HabitacionesXHotel habitacionesXHotel = db.HabitacionesXHotel.Find(id);

            db.HabitacionesXHotel.Remove(habitacionesXHotel);
            db.SaveChanges();
            return(RedirectToAction("/Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "id_relacion,id_hotel,codigo_habitacion,estado_habitacion")] HabitacionesXHotel habitacionesXHotel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(habitacionesXHotel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("/Index"));
     }
     ViewBag.codigo_habitacion = new SelectList(db.Habitaciones, "codigo_habitacion", "tipo_habotacion", habitacionesXHotel.codigo_habitacion);
     ViewBag.id_hotel          = new SelectList(db.Hoteles, "id_hotel", "nombre_hotel", habitacionesXHotel.id_hotel);
     return(View(habitacionesXHotel));
 }
Ejemplo n.º 3
0
        // GET: HabitacionesXHotels/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HabitacionesXHotel habitacionesXHotel = db.HabitacionesXHotel.Find(id);

            if (habitacionesXHotel == null)
            {
                return(HttpNotFound());
            }
            return(View(habitacionesXHotel));
        }
Ejemplo n.º 4
0
        // GET: HabitacionesXHotels/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HabitacionesXHotel habitacionesXHotel = db.HabitacionesXHotel.Find(id);

            if (habitacionesXHotel == null)
            {
                return(HttpNotFound());
            }
            ViewBag.codigo_habitacion = new SelectList(db.Habitaciones, "codigo_habitacion", "tipo_habotacion", habitacionesXHotel.codigo_habitacion);
            ViewBag.id_hotel          = new SelectList(db.Hoteles, "id_hotel", "nombre_hotel", habitacionesXHotel.id_hotel);
            return(View(habitacionesXHotel));
        }