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

            db.tb_tipohabitacion.Remove(tb_tipohabitacion);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "idTipoHabitacion,NombreTipoHabitacion,idCadenaHotelera,idHotel,capacidadmaxima,camasmaximas,descripcion,fecharegistro,usuarioregistro,fechamodificacion,usuariomodificacion")] tb_tipohabitacion tb_tipohabitacion)
 {
     if (ModelState.IsValid)
     {
         tb_tipohabitacion.fechamodificacion   = DateTime.Today;
         tb_tipohabitacion.usuariomodificacion = 1;
         db.Entry(tb_tipohabitacion).State     = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.idCadenaHotelera = new SelectList(db.tb_cadenahotelera, "idCadenaHotelera", "nombreCadenaHotelera", tb_tipohabitacion.idCadenaHotelera);
     ViewBag.idHotel          = new SelectList(db.tb_hotel, "idHotel", "nombrehotel", tb_tipohabitacion.idHotel);
     return(View(tb_tipohabitacion));
 }
예제 #3
0
        // GET: TipoHabitacion/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tb_tipohabitacion tb_tipohabitacion = db.tb_tipohabitacion.Find(id);

            if (tb_tipohabitacion == null)
            {
                return(HttpNotFound());
            }
            return(View(tb_tipohabitacion));
        }
예제 #4
0
        // GET: TipoHabitacion/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tb_tipohabitacion tb_tipohabitacion = db.tb_tipohabitacion.Find(id);

            if (tb_tipohabitacion == null)
            {
                return(HttpNotFound());
            }
            ViewBag.idCadenaHotelera = new SelectList(db.tb_cadenahotelera, "idCadenaHotelera", "nombreCadenaHotelera", tb_tipohabitacion.idCadenaHotelera);
            ViewBag.idHotel          = new SelectList(db.tb_hotel, "idHotel", "nombrehotel", tb_tipohabitacion.idHotel);
            return(View(tb_tipohabitacion));
        }