From 737cba33492a260a7376ea350086ccc01336eba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D1=8F=D1=87=D0=B5=D1=81=D0=BB=D0=B0=D0=B2=20=D0=98?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Wed, 1 May 2024 00:27:05 +0400 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogics/ConferenceBookingLogic.cs | 9 ++------- .../HotelBusinessLogic/BusinessLogics/ConferenceLogic.cs | 9 ++------- Hotel/HotelBusinessLogic/BusinessLogics/LunchLogic.cs | 8 ++------ Hotel/HotelBusinessLogic/BusinessLogics/MealPlanLogic.cs | 9 ++------- Hotel/HotelBusinessLogic/BusinessLogics/MemberLogic.cs | 8 ++------ Hotel/HotelDataBaseImplement/Models/ConferenceBooking.cs | 2 +- 6 files changed, 11 insertions(+), 34 deletions(-) diff --git a/Hotel/HotelBusinessLogic/BusinessLogics/ConferenceBookingLogic.cs b/Hotel/HotelBusinessLogic/BusinessLogics/ConferenceBookingLogic.cs index de9c52c..2204ae1 100644 --- a/Hotel/HotelBusinessLogic/BusinessLogics/ConferenceBookingLogic.cs +++ b/Hotel/HotelBusinessLogic/BusinessLogics/ConferenceBookingLogic.cs @@ -61,11 +61,8 @@ namespace HotelBusinessLogic.BusinessLogics public bool Create(ConferenceBookingBindingModel model) { CheckModel(model); - model.ConferenceBookingLunches = new(); - var result = _conferenceBookingStorage.Insert(model); - - if (result == null) + if (_conferenceBookingStorage.Insert(model) == null) { _logger.LogWarning("Insert operation failed"); return false; @@ -93,9 +90,7 @@ namespace HotelBusinessLogic.BusinessLogics _logger.LogInformation("Delete. Id:{Id}", model.Id); - var result = _conferenceBookingStorage.Delete(model); - - if (result == null) + if (_conferenceBookingStorage.Delete(model) == null) { _logger.LogWarning("Delete operation failed"); return false; diff --git a/Hotel/HotelBusinessLogic/BusinessLogics/ConferenceLogic.cs b/Hotel/HotelBusinessLogic/BusinessLogics/ConferenceLogic.cs index 523d57d..d8e4d42 100644 --- a/Hotel/HotelBusinessLogic/BusinessLogics/ConferenceLogic.cs +++ b/Hotel/HotelBusinessLogic/BusinessLogics/ConferenceLogic.cs @@ -61,11 +61,8 @@ namespace HotelBusinessLogic.BusinessLogics public bool Create(ConferenceBindingModel model) { CheckModel(model); - model.ConferenceMembers = new(); - var result = _conferenceStorage.Insert(model); - - if (result == null) + if (_conferenceStorage.Insert(model) == null) { _logger.LogWarning("Insert operation failed"); return false; @@ -93,9 +90,7 @@ namespace HotelBusinessLogic.BusinessLogics _logger.LogInformation("Delete. Id:{Id}", model.Id); - var result = _conferenceStorage.Delete(model); - - if (result == null) + if (_conferenceStorage.Delete(model) == null) { _logger.LogWarning("Delete operation failed"); return false; diff --git a/Hotel/HotelBusinessLogic/BusinessLogics/LunchLogic.cs b/Hotel/HotelBusinessLogic/BusinessLogics/LunchLogic.cs index 0cb41dc..ce5efa8 100644 --- a/Hotel/HotelBusinessLogic/BusinessLogics/LunchLogic.cs +++ b/Hotel/HotelBusinessLogic/BusinessLogics/LunchLogic.cs @@ -61,9 +61,7 @@ namespace HotelBusinessLogic.BusinessLogics { CheckModel(model); - var result = _lunchStorage.Insert(model); - - if (result == null) + if (_lunchStorage.Insert(model) == null) { _logger.LogWarning("Insert operation failed"); return false; @@ -91,9 +89,7 @@ namespace HotelBusinessLogic.BusinessLogics _logger.LogInformation("Delete. Id:{Id}", model.Id); - var result = _lunchStorage.Delete(model); - - if (result == null) + if (_lunchStorage.Delete(model) == null) { _logger.LogWarning("Delete operation failed"); return false; diff --git a/Hotel/HotelBusinessLogic/BusinessLogics/MealPlanLogic.cs b/Hotel/HotelBusinessLogic/BusinessLogics/MealPlanLogic.cs index 7fb8f5a..8d7148c 100644 --- a/Hotel/HotelBusinessLogic/BusinessLogics/MealPlanLogic.cs +++ b/Hotel/HotelBusinessLogic/BusinessLogics/MealPlanLogic.cs @@ -61,11 +61,8 @@ namespace HotelBusinessLogic.BusinessLogics public bool Create(MealPlanBindingModel model) { CheckModel(model); - model.MealPlanMembers = new(); - var result = _mealPlanStorage.Insert(model); - - if (result == null) + if (_mealPlanStorage.Insert(model) == null) { _logger.LogWarning("Insert operation failed"); return false; @@ -93,9 +90,7 @@ namespace HotelBusinessLogic.BusinessLogics _logger.LogInformation("Delete. Id:{Id}", model.Id); - var result = _mealPlanStorage.Delete(model); - - if (result == null) + if (_mealPlanStorage.Delete(model) == null) { _logger.LogWarning("Delete operation failed"); return false; diff --git a/Hotel/HotelBusinessLogic/BusinessLogics/MemberLogic.cs b/Hotel/HotelBusinessLogic/BusinessLogics/MemberLogic.cs index 713a4e4..ec12c35 100644 --- a/Hotel/HotelBusinessLogic/BusinessLogics/MemberLogic.cs +++ b/Hotel/HotelBusinessLogic/BusinessLogics/MemberLogic.cs @@ -63,9 +63,7 @@ namespace HotelBusinessLogic.BusinessLogics { CheckModel(model); - var result = _memberStorage.Insert(model); - - if (result == null) + if (_memberStorage.Insert(model) == null) { _logger.LogWarning("Insert operation failed"); return false; @@ -93,9 +91,7 @@ namespace HotelBusinessLogic.BusinessLogics _logger.LogInformation("Delete. Id:{Id}", model.Id); - var result = _memberStorage.Delete(model); - - if (result == null) + if (_memberStorage.Delete(model) == null) { _logger.LogWarning("Delete operation failed"); return false; diff --git a/Hotel/HotelDataBaseImplement/Models/ConferenceBooking.cs b/Hotel/HotelDataBaseImplement/Models/ConferenceBooking.cs index 84c03be..e6b9549 100644 --- a/Hotel/HotelDataBaseImplement/Models/ConferenceBooking.cs +++ b/Hotel/HotelDataBaseImplement/Models/ConferenceBooking.cs @@ -38,9 +38,9 @@ namespace HotelDataBaseImplement.Models return new ConferenceBooking() { Id = model.Id, - ConferenceId = model.ConferenceId, HeadwaiterId = model.HeadwaiterId, NameHall = model.NameHall, + BookingDate = model.BookingDate, Lunches = model.ConferenceBookingLunches.Select(x => new ConferenceBookingLunch { Lunch = context.Lunches.First(y => y.Id == x.Key),