From b2f32aa6e4460b2deb4a7fd96ee9973250d5d50b Mon Sep 17 00:00:00 2001 From: the Date: Sun, 26 Mar 2023 20:53:27 +0400 Subject: [PATCH] Fixes --- .../BusinessLogics/ShopLogic.cs | 10 +++++----- .../BusinessLogicsContracts/IShopLogic.cs | 2 +- ComputersShop/FormShopSupply.Designer.cs | 20 +++++++++---------- ComputersShop/FormShopSupply.cs | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ComputerShopBusinessLogic/BusinessLogics/ShopLogic.cs b/ComputerShopBusinessLogic/BusinessLogics/ShopLogic.cs index 4607311..3b418ab 100644 --- a/ComputerShopBusinessLogic/BusinessLogics/ShopLogic.cs +++ b/ComputerShopBusinessLogic/BusinessLogics/ShopLogic.cs @@ -56,7 +56,7 @@ namespace ComputerShopBusinessLogic.BusinessLogics return list; } - public bool SupplyDocuments(ShopSearchModel model, IComputerModel computer, int count) + public bool SupplyComputers(ShopSearchModel model, IComputerModel computer, int count) { if (model == null) { @@ -81,15 +81,15 @@ namespace ComputerShopBusinessLogic.BusinessLogics } _logger.LogInformation("Shop element found. ID: {0}, Name: {1}", shopElement.Id, shopElement.Name); - if (shopElement.ShopComputers.TryGetValue(computer.Id, out var sameDocument)) + if (shopElement.ShopComputers.TryGetValue(computer.Id, out var sameComputer)) { - shopElement.ShopComputers[computer.Id] = (computer, sameDocument.Item2 + count); - _logger.LogInformation("Same document found by supply. Added {0} of {1} in {2} shop", count, computer.ComputerName, shopElement.Name); + shopElement.ShopComputers[computer.Id] = (computer, sameComputer.Item2 + count); + _logger.LogInformation("Same computer found by supply. Added {0} of {1} in {2} shop", count, computer.ComputerName, shopElement.Name); } else { shopElement.ShopComputers[computer.Id] = (computer, count); - _logger.LogInformation("New document added by supply. Added {0} of {1} in {2} shop", count, computer.ComputerName, shopElement.Name); + _logger.LogInformation("New computer added by supply. Added {0} of {1} in {2} shop", count, computer.ComputerName, shopElement.Name); } _shopStorage.Update(new() diff --git a/ComputerShopContracts/BusinessLogicsContracts/IShopLogic.cs b/ComputerShopContracts/BusinessLogicsContracts/IShopLogic.cs index 099dd52..3fa9ce9 100644 --- a/ComputerShopContracts/BusinessLogicsContracts/IShopLogic.cs +++ b/ComputerShopContracts/BusinessLogicsContracts/IShopLogic.cs @@ -17,6 +17,6 @@ namespace ComputerShopContracts.BusinessLogicsContracts bool Create(ShopBindingModel model); bool Update(ShopBindingModel model); bool Delete(ShopBindingModel model); - bool SupplyDocuments(ShopSearchModel model, IComputerModel computer, int count); + bool SupplyComputers(ShopSearchModel model, IComputerModel computer, int count); } } diff --git a/ComputersShop/FormShopSupply.Designer.cs b/ComputersShop/FormShopSupply.Designer.cs index 9e0b39f..5f6a5b7 100644 --- a/ComputersShop/FormShopSupply.Designer.cs +++ b/ComputersShop/FormShopSupply.Designer.cs @@ -33,7 +33,7 @@ this.textBoxCount = new System.Windows.Forms.TextBox(); this.comboBoxComputer = new System.Windows.Forms.ComboBox(); this.comboBoxShop = new System.Windows.Forms.ComboBox(); - this.labelDocumentCount = new System.Windows.Forms.Label(); + this.labelComputerCount = new System.Windows.Forms.Label(); this.labelComputer = new System.Windows.Forms.Label(); this.labelShop = new System.Windows.Forms.Label(); this.SuspendLayout(); @@ -86,14 +86,14 @@ this.comboBoxShop.Size = new System.Drawing.Size(220, 23); this.comboBoxShop.TabIndex = 13; // - // labelDocumentCount + // labelComputerCount // - this.labelDocumentCount.AutoSize = true; - this.labelDocumentCount.Location = new System.Drawing.Point(15, 89); - this.labelDocumentCount.Name = "labelDocumentCount"; - this.labelDocumentCount.Size = new System.Drawing.Size(75, 15); - this.labelDocumentCount.TabIndex = 12; - this.labelDocumentCount.Text = "Количество:"; + this.labelComputerCount.AutoSize = true; + this.labelComputerCount.Location = new System.Drawing.Point(15, 89); + this.labelComputerCount.Name = "labelComputerCount"; + this.labelComputerCount.Size = new System.Drawing.Size(75, 15); + this.labelComputerCount.TabIndex = 12; + this.labelComputerCount.Text = "Количество:"; // // labelComputer // @@ -124,7 +124,7 @@ this.Controls.Add(this.textBoxCount); this.Controls.Add(this.comboBoxComputer); this.Controls.Add(this.comboBoxShop); - this.Controls.Add(this.labelDocumentCount); + this.Controls.Add(this.labelComputerCount); this.Controls.Add(this.labelComputer); this.Controls.Add(this.labelShop); this.Name = "FormShopSupply"; @@ -142,7 +142,7 @@ private TextBox textBoxCount; private ComboBox comboBoxComputer; private ComboBox comboBoxShop; - private Label labelDocumentCount; + private Label labelComputerCount; private Label labelComputer; private Label labelShop; } diff --git a/ComputersShop/FormShopSupply.cs b/ComputersShop/FormShopSupply.cs index cd91c05..7676deb 100644 --- a/ComputersShop/FormShopSupply.cs +++ b/ComputersShop/FormShopSupply.cs @@ -88,7 +88,7 @@ namespace ComputersShop _logger.LogInformation("Создание поставки"); try { - var operationResult = _logicS.SupplyDocuments( + var operationResult = _logicS.SupplyComputers( new ShopSearchModel { Id = Convert.ToInt32(comboBoxShop.SelectedValue),