Esempio n. 1
0
        public async Task <JsonResult> GetHotelLogs(int?hotelId, DateTime dateTime, int?count)
        {
            Hotel hotel;

            if (hotelId.HasValue)
            {
                hotel = await YummyOnlineManager.GetHotelById(hotelId.Value);
            }
            else
            {
                hotel = await YummyOnlineManager.GetFirstHotel();
            }

            HotelManager manager = new HotelManager(hotel.ConnectionString);

            return(Json(new {
                Hotel = new {
                    Id = hotel.Id,
                    Name = hotel.Name
                },
                Logs = await manager.GetLogs(dateTime, count)
            }));
        }