diff --git a/Hotel/HotelBusinessLogic/BusinessLogics/ReportLogicHeadwaiter.cs b/Hotel/HotelBusinessLogic/BusinessLogics/ReportLogicHeadwaiter.cs index 74c23fc..acd3841 100644 --- a/Hotel/HotelBusinessLogic/BusinessLogics/ReportLogicHeadwaiter.cs +++ b/Hotel/HotelBusinessLogic/BusinessLogics/ReportLogicHeadwaiter.cs @@ -6,6 +6,7 @@ using HotelContracts.SearchModels; using HotelContracts.StoragesContracts; using HotelContracts.ViewModels; using HotelDataBaseImplement.Models; +using DocumentFormat.OpenXml.Wordprocessing; namespace HotelBusinessLogic.BusinessLogics { @@ -116,13 +117,16 @@ namespace HotelBusinessLogic.BusinessLogics foreach (var mp in conferenceBooking.ConferenceBookingLunches.Values) { var conference = conferenced.FirstOrDefault(dp => dp.Id == conferenceBooking.ConferenceId); - listAll.Add(new ReportLunchesViewModel + if (conference != null) { - LunchName = mp.LunchName, - LunchPrice = mp.LunchPrice, - ConferenceName = conference.ConferenceName, - StartDate = conference.StartDate - }); + listAll.Add(new ReportLunchesViewModel + { + LunchName = mp.LunchName, + LunchPrice = mp.LunchPrice, + ConferenceName = conference.ConferenceName, + StartDate = conference.StartDate + }); + } } } diff --git a/Hotel/HotelBusinessLogic/BusinessLogics/ReportLogicOrganiser.cs b/Hotel/HotelBusinessLogic/BusinessLogics/ReportLogicOrganiser.cs index fbc945f..66257e1 100644 --- a/Hotel/HotelBusinessLogic/BusinessLogics/ReportLogicOrganiser.cs +++ b/Hotel/HotelBusinessLogic/BusinessLogics/ReportLogicOrganiser.cs @@ -116,14 +116,17 @@ namespace HotelBusinessLogic.BusinessLogics foreach (var mp in mealPlan.MealPlanMembers.Values) { var room = rooms.FirstOrDefault(r => r.MealPlanId == mealPlan.Id); - listAll.Add(new ReportMembersViewModel + if (room != null) { - MemberSurname = mp.MemberSurname, - MemberName = mp.MemberName, - MemberPatronymic = mp.MemberPatronymic, - RoomName = room.RoomName, - RoomPrice = room.RoomPrice - }); + listAll.Add(new ReportMembersViewModel + { + MemberSurname = mp.MemberSurname, + MemberName = mp.MemberName, + MemberPatronymic = mp.MemberPatronymic, + RoomName = room.RoomName, + RoomPrice = room.RoomPrice + }); + } } } diff --git a/Hotel/HotelHeadwaiterApp/Properties/launchSettings.json b/Hotel/HotelHeadwaiterApp/Properties/launchSettings.json index af88793..11f1c7f 100644 --- a/Hotel/HotelHeadwaiterApp/Properties/launchSettings.json +++ b/Hotel/HotelHeadwaiterApp/Properties/launchSettings.json @@ -12,7 +12,7 @@ "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - "applicationUrl": "https://localhost:7020;http://localhost:5029", + "applicationUrl": "https://localhost:7040;http://localhost:5049", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }