From 437995a7efb033cd8c7d3aa3e270ee2bf478cb8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=97=D0=B0=D1=85=D0=B0=D1=80=D0=BE=D0=B2?= Date: Wed, 29 Mar 2023 12:32:22 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MotorPlantContracts/BindingModels/OrderBindingModel.cs | 2 ++ MotorPlant/MotorPlantListImplement/Models/Order.cs | 2 ++ MotorPlant/MotorPlantView/FormCreateOrder.cs | 1 + MotorPlant/MotorPlantView/FormMain.cs | 3 +++ 4 files changed, 8 insertions(+) diff --git a/MotorPlant/MotorPlantContracts/BindingModels/OrderBindingModel.cs b/MotorPlant/MotorPlantContracts/BindingModels/OrderBindingModel.cs index b0e59fc..f2625e4 100644 --- a/MotorPlant/MotorPlantContracts/BindingModels/OrderBindingModel.cs +++ b/MotorPlant/MotorPlantContracts/BindingModels/OrderBindingModel.cs @@ -10,6 +10,8 @@ namespace MotorPlantContracts.BindingModels { public class OrderBindingModel : IOrderModel { + public string ProductName { get; set; } + public int Id { get; set; } public int ProductId { get; set; } diff --git a/MotorPlant/MotorPlantListImplement/Models/Order.cs b/MotorPlant/MotorPlantListImplement/Models/Order.cs index c057a75..07d3bbe 100644 --- a/MotorPlant/MotorPlantListImplement/Models/Order.cs +++ b/MotorPlant/MotorPlantListImplement/Models/Order.cs @@ -38,6 +38,7 @@ namespace MotorPlantListImplement.Models { Id = model.Id, ProductId = model.ProductId, + ProductName = model.ProductName, Count = model.Count, Sum = model.Sum, Status = model.Status, @@ -53,6 +54,7 @@ namespace MotorPlantListImplement.Models return; } ProductId = model.ProductId; + ProductName = model.ProductName; Count = model.Count; Sum = model.Sum; Status = model.Status; diff --git a/MotorPlant/MotorPlantView/FormCreateOrder.cs b/MotorPlant/MotorPlantView/FormCreateOrder.cs index 19a853d..14feabd 100644 --- a/MotorPlant/MotorPlantView/FormCreateOrder.cs +++ b/MotorPlant/MotorPlantView/FormCreateOrder.cs @@ -113,6 +113,7 @@ namespace MotorPlantView var operationResult = _logicO.CreateOrder(new OrderBindingModel { ProductId = Convert.ToInt32(comboBoxProduct.SelectedValue), + ProductName = comboBoxProduct.Text, Count = Convert.ToInt32(textBoxCount.Text), Sum = Convert.ToDouble(textBoxSum.Text) }); diff --git a/MotorPlant/MotorPlantView/FormMain.cs b/MotorPlant/MotorPlantView/FormMain.cs index d248fcb..a3f6f22 100644 --- a/MotorPlant/MotorPlantView/FormMain.cs +++ b/MotorPlant/MotorPlantView/FormMain.cs @@ -99,6 +99,7 @@ namespace MotorPlantView { Id = id, ProductId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["ProductId"].Value), + ProductName = DataGridView.SelectedRows[0].Cells["ProductName"].Value.ToString(), 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()), @@ -133,6 +134,7 @@ namespace MotorPlantView { Id = id, ProductId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["ProductId"].Value), + ProductName = DataGridView.SelectedRows[0].Cells["ProductName"].Value.ToString(), 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()), @@ -167,6 +169,7 @@ namespace MotorPlantView { Id = id, ProductId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["ProductId"].Value), + ProductName = DataGridView.SelectedRows[0].Cells["ProductName"].Value.ToString(), 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()),