diff --git a/Hotel/HotelBusinessLogic/BusinessLogics/ReportLogicHeadwaiter.cs b/Hotel/HotelBusinessLogic/BusinessLogics/ReportLogicHeadwaiter.cs index 683ab23..0339189 100644 --- a/Hotel/HotelBusinessLogic/BusinessLogics/ReportLogicHeadwaiter.cs +++ b/Hotel/HotelBusinessLogic/BusinessLogics/ReportLogicHeadwaiter.cs @@ -72,16 +72,13 @@ namespace HotelBusinessLogic.BusinessLogics { var listAll = new List(); - var listСonferences = _roomStorage.GetFilteredList(new RoomSearchModel + var listRooms = _roomStorage.GetFilteredList(new RoomSearchModel { HeadwaiterId = model.HeadwaiterId, - RoomName = model.RoomName, - DateFrom = model.DateFrom, - DateTo = model.DateTo }); - foreach (var room in listСonferences) + foreach (var room in listRooms) { foreach (var m in room.RoomDinners.Values) { @@ -97,6 +94,8 @@ namespace HotelBusinessLogic.BusinessLogics var listConferenceBookings = _conferenceBookingStorage.GetFilteredList(new ConferenceBookingSearchModel { HeadwaiterId = model.HeadwaiterId, + DateFrom = model.DateFrom, + DateTo = model.DateTo }); foreach (var conferenceBooking in listConferenceBookings) @@ -143,6 +142,8 @@ namespace HotelBusinessLogic.BusinessLogics { FileName = model.FileName, Title = "Список обедов", + DateFrom = model.DateFrom!.Value, + DateTo = model.DateTo!.Value, Dinners = GetDinners(model) }); } diff --git a/Hotel/HotelBusinessLogic/OfficePackage/AbstractSaveToPdfHeadwaiter.cs b/Hotel/HotelBusinessLogic/OfficePackage/AbstractSaveToPdfHeadwaiter.cs index 3a9bce6..9d2a10c 100644 --- a/Hotel/HotelBusinessLogic/OfficePackage/AbstractSaveToPdfHeadwaiter.cs +++ b/Hotel/HotelBusinessLogic/OfficePackage/AbstractSaveToPdfHeadwaiter.cs @@ -36,7 +36,7 @@ namespace HotelBusinessLogic.OfficePackage { CreateRow(new PdfRowParameters { - Texts = new List { dinner.DinnerName.ToString(), dinner.RoomName, dinner.RoomPrice.ToString(), dinner.NameHall, dinner.BookingDate?.ToShortDateString() }, + Texts = new List { dinner.DinnerName.ToString(), dinner.RoomName, dinner.RoomPrice.ToString(), dinner.NameHall }, Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Left }); diff --git a/Hotel/HotelDataBaseImplement/Implemets/ConferenceBookingStorage.cs b/Hotel/HotelDataBaseImplement/Implemets/ConferenceBookingStorage.cs index 3921b05..25546d5 100644 --- a/Hotel/HotelDataBaseImplement/Implemets/ConferenceBookingStorage.cs +++ b/Hotel/HotelDataBaseImplement/Implemets/ConferenceBookingStorage.cs @@ -60,8 +60,20 @@ namespace HotelDataBaseImplement.Implemets return new(); } using var context = new HotelDataBase(); - - if (model.HeadwaiterId.HasValue) { + if (model.DateFrom.HasValue) + { + return context.ConferenceBookings + .Include(x => x.Dinners) + .ThenInclude(x => x.Dinner) + .ThenInclude(x => x.RoomDinners) + .ThenInclude(x => x.Room) + .Include(x => x.Conference) + .Include(x => x.Headwaiter) + .Where(x => x.BookingDate >= model.DateFrom && x.BookingDate <= model.DateTo && x.HeadwaiterId == model.HeadwaiterId) + .Select(x => x.GetViewModel) + .ToList(); + } + else if (model.HeadwaiterId.HasValue) { return context.ConferenceBookings .Include(x => x.Dinners) .ThenInclude(x => x.Dinner) diff --git a/Hotel/HotelRestApi/Отчет PDF.pdf b/Hotel/HotelRestApi/Отчет PDF.pdf index c21d2fe..7c9eb2d 100644 Binary files a/Hotel/HotelRestApi/Отчет PDF.pdf and b/Hotel/HotelRestApi/Отчет PDF.pdf differ