From dc140799a2c51a85c9451a718dba709e44d237b9 Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Wed, 10 May 2023 20:48:31 +0400 Subject: [PATCH] Important minor edit. --- .../TransportCompany/FormCreateTrucking.cs | 37 ++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/TransportCompany/TransportCompany/FormCreateTrucking.cs b/TransportCompany/TransportCompany/FormCreateTrucking.cs index 1f5865b..0db5c22 100644 --- a/TransportCompany/TransportCompany/FormCreateTrucking.cs +++ b/TransportCompany/TransportCompany/FormCreateTrucking.cs @@ -67,7 +67,16 @@ namespace TransportCompany if (viewClient != null) { comboBoxClients.DisplayMember = "Email"; - comboBoxClients.ValueMember = "MongoId"; + + if (isMongo) + { + comboBoxClients.ValueMember = "MongoId"; + } + else + { + comboBoxClients.ValueMember = "Id"; + } + comboBoxClients.DataSource = viewClient; comboBoxClients.SelectedItem = null; } @@ -75,16 +84,34 @@ namespace TransportCompany if (viewCargo != null) { comboBoxCargos.DisplayMember = "TypeCargo"; - comboBoxCargos.ValueMember = "MongoId"; - comboBoxCargos.DataSource = viewCargo; + + if (isMongo) + { + comboBoxClients.ValueMember = "MongoId"; + } + else + { + comboBoxClients.ValueMember = "Id"; + } + + comboBoxCargos.DataSource = viewCargo; comboBoxCargos.SelectedItem = null; } if (viewTransport != null) { comboBoxTransports.DisplayMember = "Tranport"; - comboBoxTransports.ValueMember = "MongoId"; - comboBoxTransports.DataSource = viewTransport; + + if (isMongo) + { + comboBoxClients.ValueMember = "MongoId"; + } + else + { + comboBoxClients.ValueMember = "Id"; + } + + comboBoxTransports.DataSource = viewTransport; comboBoxTransports.SelectedItem = null; }