From bac3eb0a04eda6396d26a0184804da48aa9e9fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?= =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= Date: Sun, 5 Feb 2023 13:24:32 +0400 Subject: [PATCH] fix --- ConfectionaryBusinessLogic/OrderLogic.cs | 11 +++++++---- Confectionery/FormPastry.Designer.cs | 6 +++--- Confectionery/FormPastry.resx | 9 --------- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/ConfectionaryBusinessLogic/OrderLogic.cs b/ConfectionaryBusinessLogic/OrderLogic.cs index cb951ab..b0de921 100644 --- a/ConfectionaryBusinessLogic/OrderLogic.cs +++ b/ConfectionaryBusinessLogic/OrderLogic.cs @@ -24,7 +24,8 @@ namespace ConfectioneryBusinessLogic.BusinessLogics CheckModel(model); if (model.Status != OrderStatus.Неизвестен) { - throw new ArgumentException($"Статус заказа должен быть {OrderStatus.Неизвестен}", nameof(model.Status)); + throw new ArgumentException( + $"Статус заказа должен быть {OrderStatus.Неизвестен}", nameof(model)); } model.Status = OrderStatus.Принят; model.DateCreate = DateTime.Now; @@ -86,10 +87,12 @@ namespace ConfectioneryBusinessLogic.BusinessLogics if ((int)vmodel.Status + 1 != (int)orderStatus) { throw new ArgumentException($"Попытка перевести заказ не в следующий статус: " + - $"Текущий статус: {vmodel.Status}" + - $"Планируемый статус: {orderStatus}", nameof(vmodel.Status)); + $"Текущий статус: {vmodel.Status} \n" + + $"Планируемый статус: {orderStatus} \n" + + $"Доступный статус: {(OrderStatus)((int)vmodel.Status + 1)}", + nameof(vmodel)); } - model.Status++; + model.Status = orderStatus; if (_orderStorage.Update(model) == null) { _logger.LogWarning("Update operation failed"); diff --git a/Confectionery/FormPastry.Designer.cs b/Confectionery/FormPastry.Designer.cs index df9c542..ba07aee 100644 --- a/Confectionery/FormPastry.Designer.cs +++ b/Confectionery/FormPastry.Designer.cs @@ -95,7 +95,7 @@ // buttonDel // this.buttonDel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonDel.Location = new System.Drawing.Point(680, 107); + this.buttonDel.Location = new System.Drawing.Point(680, 158); this.buttonDel.Name = "buttonDel"; this.buttonDel.Size = new System.Drawing.Size(90, 33); this.buttonDel.TabIndex = 3; @@ -106,7 +106,7 @@ // buttonUpd // this.buttonUpd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonUpd.Location = new System.Drawing.Point(680, 53); + this.buttonUpd.Location = new System.Drawing.Point(680, 108); this.buttonUpd.Name = "buttonUpd"; this.buttonUpd.Size = new System.Drawing.Size(90, 34); this.buttonUpd.TabIndex = 2; @@ -116,7 +116,7 @@ // // buttonAdd // - this.buttonAdd.Location = new System.Drawing.Point(680, 157); + this.buttonAdd.Location = new System.Drawing.Point(680, 62); this.buttonAdd.Name = "buttonAdd"; this.buttonAdd.Size = new System.Drawing.Size(90, 30); this.buttonAdd.TabIndex = 1; diff --git a/Confectionery/FormPastry.resx b/Confectionery/FormPastry.resx index 05ebf2d..1bfa2bf 100644 --- a/Confectionery/FormPastry.resx +++ b/Confectionery/FormPastry.resx @@ -66,13 +66,4 @@ True - - True - - - True - - - True - \ No newline at end of file