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