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; }