Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            hotel_rooms hotel_rooms = db.hotel_rooms.Find(id);

            db.hotel_rooms.Remove(hotel_rooms);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "hotel_id,room_number,room_type_id,room_rate,occupied")] hotel_rooms hotel_rooms)
 {
     if (ModelState.IsValid)
     {
         db.Entry(hotel_rooms).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.hotel_id     = new SelectList(db.hotels, "hotel_id", "hotel_name", hotel_rooms.hotel_id);
     ViewBag.room_type_id = new SelectList(db.room_types, "room_type_id", "room_types_string", hotel_rooms.room_type_id);
     return(View(hotel_rooms));
 }
Пример #3
0
        // GET: HotelRoomAdmin/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            hotel_rooms hotel_rooms = db.hotel_rooms.Find(id);

            if (hotel_rooms == null)
            {
                return(HttpNotFound());
            }
            return(View(hotel_rooms));
        }
Пример #4
0
        // GET: HotelRoomAdmin/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            hotel_rooms hotel_rooms = db.hotel_rooms.Find(id);

            if (hotel_rooms == null)
            {
                return(HttpNotFound());
            }
            ViewBag.hotel_id     = new SelectList(db.hotels, "hotel_id", "hotel_name", hotel_rooms.hotel_id);
            ViewBag.room_type_id = new SelectList(db.room_types, "room_type_id", "room_types_string", hotel_rooms.room_type_id);
            return(View(hotel_rooms));
        }