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()