From 2b4db4f5f42e67b0498c820d8f75c4f218a3adf8 Mon Sep 17 00:00:00 2001 From: vladimir_zinovev Date: Sun, 5 May 2024 23:58:51 +0400 Subject: [PATCH] done --- .../FurnitureAssembly/FormCreateOrder.cs | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/FurnitureAssembly/FurnitureAssembly/FormCreateOrder.cs b/FurnitureAssembly/FurnitureAssembly/FormCreateOrder.cs index 45e10b8..c680e78 100644 --- a/FurnitureAssembly/FurnitureAssembly/FormCreateOrder.cs +++ b/FurnitureAssembly/FurnitureAssembly/FormCreateOrder.cs @@ -31,6 +31,7 @@ namespace FurnitureAssemblyView _logicM = logicM; _logicO = logicO; _logicC = logicC; + } private void FormCreateOrder_Load(object sender, EventArgs e) @@ -41,9 +42,9 @@ namespace FurnitureAssemblyView var list = _logicM.ReadList(null); if (list != null) { - comboBoxFurniture.DisplayMember = "Furniture"; + comboBoxFurniture.DisplayMember = "FurnitureName"; comboBoxFurniture.ValueMember = "Id"; - comboBoxFurniture.DataSource = list.Select(c => c.FurnitureName).ToList(); + comboBoxFurniture.DataSource = list; comboBoxFurniture.SelectedItem = null; } @@ -70,6 +71,24 @@ namespace FurnitureAssemblyView _logger.LogError(ex, "Ошибка загрузки списка клиентов"); MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } + try + { + var list = _logicC.ReadList(null); + + if (list != null) + { + clientBox.DisplayMember = "ClientFIO"; + clientBox.ValueMember = "Id"; + clientBox.DataSource = list; + clientBox.SelectedItem = null; + } + + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки клиентов для заказа"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } } private void CalcSum()