From ee4962b0d579340c3809de2fcadb6749f408c17f Mon Sep 17 00:00:00 2001 From: abazov73 <92822431+abazov73@users.noreply.github.com> Date: Mon, 15 May 2023 10:43:46 +0400 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=82=D0=BE=D1=80=D0=B0=D1=8F=20=D1=83?= =?UTF-8?q?=D1=81=D0=BB=D0=BE=D0=B6=D0=BD=D1=91=D0=BD=D0=BD=D0=B0=D1=8F=20?= =?UTF-8?q?=D0=BB=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82=D0=BE=D1=80=D0=BD?= =?UTF-8?q?=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0.=20=D0=A4?= =?UTF-8?q?=D0=B8=D0=BA=D1=81=20=D0=BF=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20+=20=D1=84=D0=B8=D0=BA=D1=81=20=D0=B2?= =?UTF-8?q?=D1=8B=D0=B2=D0=BE=D0=B4=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=B2=20=D1=84=D0=BE=D1=80=D0=BC=D0=B5=20=D1=81=D0=BF?= =?UTF-8?q?=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + Confectionery/Confectionery/FormSell.cs | 2 +- .../ConfectioneryFileImplements/Implements/ShopStorage.cs | 5 ++--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index ca1c7a3..e41ed9d 100644 --- a/.gitignore +++ b/.gitignore @@ -398,3 +398,4 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +/Confectionery/ImplementationExtensions diff --git a/Confectionery/Confectionery/FormSell.cs b/Confectionery/Confectionery/FormSell.cs index 9380f58..db1c49d 100644 --- a/Confectionery/Confectionery/FormSell.cs +++ b/Confectionery/Confectionery/FormSell.cs @@ -52,7 +52,7 @@ namespace Confectionery bool operationResult = _logicS.Sell(Convert.ToInt32(comboBoxPastry.SelectedValue), count); if (!operationResult) { - throw new Exception("Ошибка при создании поставки. Дополнительная информация в логах."); + throw new Exception("Ошибка при создании списания. Дополнительная информация в логах."); } MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); DialogResult = DialogResult.OK; diff --git a/Confectionery/ConfectioneryFileImplements/Implements/ShopStorage.cs b/Confectionery/ConfectioneryFileImplements/Implements/ShopStorage.cs index 214c74f..d37aa1b 100644 --- a/Confectionery/ConfectioneryFileImplements/Implements/ShopStorage.cs +++ b/Confectionery/ConfectioneryFileImplements/Implements/ShopStorage.cs @@ -115,15 +115,14 @@ namespace ConfectioneryFileImplement.Implements } else { - int dif = count - freeShopSpace; count -= freeShopSpace; if (shop.Pastries.TryGetValue(pastryId, out var pastryCount)) { - shop.Pastries[pastryId] = pastryCount + count; + shop.Pastries[pastryId] = pastryCount + freeShopSpace; } else { - shop.Pastries.Add(pastryId, count); + shop.Pastries.Add(pastryId, freeShopSpace); } shop.setShopPastriesNull(); }