From 12ca78bbe5edb8850d8a94392f078e52dfa40092 Mon Sep 17 00:00:00 2001 From: dasha Date: Tue, 14 Feb 2023 12:31:20 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SushiBar/SushiBar/FormIngredients.cs | 1 - SushiBar/SushiBar/FormListSushi.cs | 1 - SushiBar/SushiBar/FormMain.cs | 22 +++---------------- SushiBar/SushiBar/FormSushi.cs | 1 - .../BusinessLogics/OrderLogic.cs | 2 +- 5 files changed, 4 insertions(+), 23 deletions(-) diff --git a/SushiBar/SushiBar/FormIngredients.cs b/SushiBar/SushiBar/FormIngredients.cs index 73d7cfa..781205f 100644 --- a/SushiBar/SushiBar/FormIngredients.cs +++ b/SushiBar/SushiBar/FormIngredients.cs @@ -1,5 +1,4 @@ using Microsoft.Extensions.Logging; -using SushiBar; using SushiBarContracts.BindingModels; using SushiBarContracts.BusinessLogicsContracts; diff --git a/SushiBar/SushiBar/FormListSushi.cs b/SushiBar/SushiBar/FormListSushi.cs index 333b51c..d20376b 100644 --- a/SushiBar/SushiBar/FormListSushi.cs +++ b/SushiBar/SushiBar/FormListSushi.cs @@ -1,5 +1,4 @@ using Microsoft.Extensions.Logging; -using SushiBar; using SushiBarContracts.BindingModels; using SushiBarContracts.BusinessLogicsContracts; diff --git a/SushiBar/SushiBar/FormMain.cs b/SushiBar/SushiBar/FormMain.cs index 5c13930..6255276 100644 --- a/SushiBar/SushiBar/FormMain.cs +++ b/SushiBar/SushiBar/FormMain.cs @@ -1,5 +1,4 @@ using Microsoft.Extensions.Logging; -using SushiBar; using SushiBarContracts.BindingModels; using SushiBarContracts.BusinessLogicsContracts; using SushiBarDataModels.Enums; @@ -74,12 +73,7 @@ namespace SushiBarView { var operationResult = _orderLogic.TakeOrderInWork(new OrderBindingModel { - Id = id, - SushiId = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["SushiId"].Value), - Status = Enum.Parse(dataGridView.SelectedRows[0].Cells["Status"].Value.ToString()), - Count = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Count"].Value), - Sum = double.Parse(dataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()), - DateCreate = DateTime.Parse(dataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString()), + Id = id }); if (!operationResult) { @@ -104,12 +98,7 @@ namespace SushiBarView { var operationResult = _orderLogic.FinishOrder(new OrderBindingModel { - Id = id, - SushiId = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["SushiId"].Value), - Status = Enum.Parse(dataGridView.SelectedRows[0].Cells["Status"].Value.ToString()), - Count = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Count"].Value), - Sum = double.Parse(dataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()), - DateCreate = DateTime.Parse(dataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString()), + Id = id }); if (!operationResult) { @@ -134,12 +123,7 @@ namespace SushiBarView { var operationResult = _orderLogic.DeliveryOrder(new OrderBindingModel { - Id = id, - SushiId = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["SushiId"].Value), - Status = Enum.Parse(dataGridView.SelectedRows[0].Cells["Status"].Value.ToString()), - Count = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Count"].Value), - Sum = double.Parse(dataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()), - DateCreate = DateTime.Parse(dataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString()), + Id = id }); if (!operationResult) { diff --git a/SushiBar/SushiBar/FormSushi.cs b/SushiBar/SushiBar/FormSushi.cs index 67496b1..515011f 100644 --- a/SushiBar/SushiBar/FormSushi.cs +++ b/SushiBar/SushiBar/FormSushi.cs @@ -1,5 +1,4 @@ using Microsoft.Extensions.Logging; -using SushiBar; using SushiBarContracts.BindingModels; using SushiBarContracts.BusinessLogicsContracts; using SushiBarContracts.SearchModels; diff --git a/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs b/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs index 2d37796..3baee63 100644 --- a/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs +++ b/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs @@ -91,7 +91,7 @@ namespace SushiBarBusinessLogic.BusinessLogics { model.DateImplement = viewModel.DateImplement; } - CheckModel(model); + CheckModel(model, false); if (_orderStorage.Update(model) == null) { model.Status--;