コード例 #1
0
ファイル: LogController.cs プロジェクト: zyhbill/YummyOnline
        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)
            }));
        }