From cb88b9bcc4abe0e739c6774416bc38a84eab6d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=20=D0=91=D0=BE=D0=BD=D0=B4=D0=B0?= =?UTF-8?q?=D1=80=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Mon, 13 Feb 2023 23:38:14 +0400 Subject: [PATCH] =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=B5?= =?UTF-8?q?=D1=82!!!!!!!!!!!!!=D0=94=D0=B0=D0=B0=D0=B0=D0=B0=D0=B0=D0=B0?= =?UTF-8?q?=D0=B0=D0=B0=D0=B0=D0=B0=D0=B0=D0=B0=D0=B0=D0=B0=D0=B0=D0=B0?= =?UTF-8?q?=D0=B0=D0=B0=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ComputersShop/ComputersShopView/FormMain.cs | 28 +++++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/ComputersShop/ComputersShopView/FormMain.cs b/ComputersShop/ComputersShopView/FormMain.cs index 348a1e4..c660b1a 100644 --- a/ComputersShop/ComputersShopView/FormMain.cs +++ b/ComputersShop/ComputersShopView/FormMain.cs @@ -1,5 +1,6 @@ using ComputersShopContracts.BindingModels; using ComputersShopContracts.BusinessLogicContracts; +using ComputersShopDataModels.Enums; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; @@ -82,7 +83,14 @@ namespace ComputersShopView try { var operationResult = _orderLogic.TakeOrderInWork(new OrderBindingModel - { Id = id }); + { + Id = id, + ComputerId = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["ComputerId"].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()) + }); if (!operationResult) { throw new Exception("Ошибка при сохранении. Дополнительная информация в логах."); @@ -105,8 +113,13 @@ namespace ComputersShopView try { var operationResult = _orderLogic.FinishOrder(new OrderBindingModel - { - Id = id + { + Id = id, + ComputerId = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["ComputerId"].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()) }); if (!operationResult) { @@ -130,8 +143,13 @@ namespace ComputersShopView try { var operationResult = _orderLogic.DeliveryOrder(new OrderBindingModel - { - Id = id + { + Id = id, + ComputerId = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["ComputerId"].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()) }); if (!operationResult) {