From 071e0a01fc0b89772d647f512f3798b340cd85ae Mon Sep 17 00:00:00 2001 From: Salikh Date: Wed, 3 Apr 2024 14:12:16 +0400 Subject: [PATCH] commit --- .../BusinessLogic/ShopLogic.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/MotorPlant/MotorPlantBusinessLogic/BusinessLogic/ShopLogic.cs b/MotorPlant/MotorPlantBusinessLogic/BusinessLogic/ShopLogic.cs index a85fe49..479e5c3 100644 --- a/MotorPlant/MotorPlantBusinessLogic/BusinessLogic/ShopLogic.cs +++ b/MotorPlant/MotorPlantBusinessLogic/BusinessLogic/ShopLogic.cs @@ -119,12 +119,12 @@ namespace MotorPlantBusinessLogic.BusinessLogic throw new InvalidOperationException("Магазин с таким названием уже есть"); } } - public bool MakeSupply(ShopSearchModel model, IEngineModel dress, int count) + public bool MakeSupply(ShopSearchModel model, IEngineModel engine, int count) { if (model == null) throw new ArgumentNullException(nameof(model)); - if (dress == null) - throw new ArgumentNullException(nameof(dress)); + if (engine == null) + throw new ArgumentNullException(nameof(engine)); if (count <= 0) throw new ArgumentNullException("Количество должно быть положительным числом"); @@ -132,15 +132,15 @@ namespace MotorPlantBusinessLogic.BusinessLogic _logger.LogInformation("Make Supply. Id: {Id}. ShopName: {Name}", model.Id, model.Name); if (curModel == null) throw new ArgumentNullException(nameof(curModel)); - if (curModel.ShopEngines.TryGetValue(dress.Id, out var pair)) + if (curModel.ShopEngines.TryGetValue(engine.Id, out var pair)) { - curModel.ShopEngines[dress.Id] = (pair.Item1, pair.Item2 + count); - _logger.LogInformation("Make Supply. Add Dress. DressName: {Name}. Count: {Count}", pair.Item1, count + pair.Item2); + curModel.ShopEngines[engine.Id] = (pair.Item1, pair.Item2 + count); + _logger.LogInformation("Make Supply. Add Engine. EngineName: {Name}. Count: {Count}", pair.Item1, count + pair.Item2); } else { - curModel.ShopEngines.Add(dress.Id, (dress, count)); - _logger.LogInformation("Make Supply. Add new Dress. DressName: {Name}. Count: {Count}", pair.Item1, count); + curModel.ShopEngines.Add(engine.Id, (engine, count)); + _logger.LogInformation("Make Supply. Add new Engine. EngineName: {Name}. Count: {Count}", pair.Item1, count); } return Update(new()