Очень дурацкая ошибка :<
This commit is contained in:
parent
1fe81f6fd4
commit
0e9c79b9a1
@ -72,16 +72,13 @@ namespace HotelBusinessLogic.BusinessLogics
|
|||||||
{
|
{
|
||||||
var listAll = new List<ReportDinnersViewModel>();
|
var listAll = new List<ReportDinnersViewModel>();
|
||||||
|
|
||||||
var listСonferences = _roomStorage.GetFilteredList(new RoomSearchModel
|
var listRooms = _roomStorage.GetFilteredList(new RoomSearchModel
|
||||||
{
|
{
|
||||||
HeadwaiterId = model.HeadwaiterId,
|
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)
|
foreach (var m in room.RoomDinners.Values)
|
||||||
{
|
{
|
||||||
@ -97,6 +94,8 @@ namespace HotelBusinessLogic.BusinessLogics
|
|||||||
var listConferenceBookings = _conferenceBookingStorage.GetFilteredList(new ConferenceBookingSearchModel
|
var listConferenceBookings = _conferenceBookingStorage.GetFilteredList(new ConferenceBookingSearchModel
|
||||||
{
|
{
|
||||||
HeadwaiterId = model.HeadwaiterId,
|
HeadwaiterId = model.HeadwaiterId,
|
||||||
|
DateFrom = model.DateFrom,
|
||||||
|
DateTo = model.DateTo
|
||||||
});
|
});
|
||||||
|
|
||||||
foreach (var conferenceBooking in listConferenceBookings)
|
foreach (var conferenceBooking in listConferenceBookings)
|
||||||
@ -143,6 +142,8 @@ namespace HotelBusinessLogic.BusinessLogics
|
|||||||
{
|
{
|
||||||
FileName = model.FileName,
|
FileName = model.FileName,
|
||||||
Title = "Список обедов",
|
Title = "Список обедов",
|
||||||
|
DateFrom = model.DateFrom!.Value,
|
||||||
|
DateTo = model.DateTo!.Value,
|
||||||
Dinners = GetDinners(model)
|
Dinners = GetDinners(model)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ namespace HotelBusinessLogic.OfficePackage
|
|||||||
{
|
{
|
||||||
CreateRow(new PdfRowParameters
|
CreateRow(new PdfRowParameters
|
||||||
{
|
{
|
||||||
Texts = new List<string> { dinner.DinnerName.ToString(), dinner.RoomName, dinner.RoomPrice.ToString(), dinner.NameHall, dinner.BookingDate?.ToShortDateString() },
|
Texts = new List<string> { dinner.DinnerName.ToString(), dinner.RoomName, dinner.RoomPrice.ToString(), dinner.NameHall },
|
||||||
Style = "Normal",
|
Style = "Normal",
|
||||||
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||||||
});
|
});
|
||||||
|
@ -60,8 +60,20 @@ namespace HotelDataBaseImplement.Implemets
|
|||||||
return new();
|
return new();
|
||||||
}
|
}
|
||||||
using var context = new HotelDataBase();
|
using var context = new HotelDataBase();
|
||||||
|
if (model.DateFrom.HasValue)
|
||||||
if (model.HeadwaiterId.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
|
return context.ConferenceBookings
|
||||||
.Include(x => x.Dinners)
|
.Include(x => x.Dinners)
|
||||||
.ThenInclude(x => x.Dinner)
|
.ThenInclude(x => x.Dinner)
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user