예제 #1
0
        public void Put(int id, [FromBody] Int16 bookedRooms)
        {
            DatabaseHotel dbQ   = new DatabaseHotel();
            Hotel         hotel = dbQ.selectById(id);

            var remainingRooms = hotel.rooms_curr - bookedRooms;

            if (remainingRooms >= 0)
            {
                dbQ.updateHotel(id, (Int16)remainingRooms);
            }
        }
예제 #2
0
        public ActionResult <Hotel> Get(Int64 id)
        {
            DatabaseHotel dbQ = new DatabaseHotel();

            return(dbQ.selectById(id));
        }
예제 #3
0
        public ActionResult <List <Hotel> > Get()
        {
            DatabaseHotel dbQ = new DatabaseHotel();

            return(dbQ.selectAll());
        }