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); } }
public ActionResult <Hotel> Get(Int64 id) { DatabaseHotel dbQ = new DatabaseHotel(); return(dbQ.selectById(id)); }
public ActionResult <List <Hotel> > Get() { DatabaseHotel dbQ = new DatabaseHotel(); return(dbQ.selectAll()); }