From 403625b82cdac5f451b6294a4b74c53abc7003ab Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Wed, 10 May 2023 20:18:31 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B6=D0=B5=20=D0=BE=D1=89=D1=83=D1=89?= =?UTF-8?q?=D0=B0=D0=B5=D1=82=D1=81=D1=8F=20=D1=84=D0=B8=D0=BD=D0=B8=D1=88?= =?UTF-8?q?=D0=BD=D0=B0=D1=8F=20=D0=BF=D1=80=D1=8F=D0=BC=D0=B0=D1=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TransportCompany/FormCreateTrucking.cs | 6 +++--- .../TransportCompany/FormTransferData.cs | 9 ++++----- .../ViewModels/TruckingViewModel.cs | 12 ++++++------ 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/TransportCompany/TransportCompany/FormCreateTrucking.cs b/TransportCompany/TransportCompany/FormCreateTrucking.cs index f7c3035..1f5865b 100644 --- a/TransportCompany/TransportCompany/FormCreateTrucking.cs +++ b/TransportCompany/TransportCompany/FormCreateTrucking.cs @@ -67,7 +67,7 @@ namespace TransportCompany if (viewClient != null) { comboBoxClients.DisplayMember = "Email"; - comboBoxClients.ValueMember = "Id"; + comboBoxClients.ValueMember = "MongoId"; comboBoxClients.DataSource = viewClient; comboBoxClients.SelectedItem = null; } @@ -75,7 +75,7 @@ namespace TransportCompany if (viewCargo != null) { comboBoxCargos.DisplayMember = "TypeCargo"; - comboBoxCargos.ValueMember = "Id"; + comboBoxCargos.ValueMember = "MongoId"; comboBoxCargos.DataSource = viewCargo; comboBoxCargos.SelectedItem = null; } @@ -83,7 +83,7 @@ namespace TransportCompany if (viewTransport != null) { comboBoxTransports.DisplayMember = "Tranport"; - comboBoxTransports.ValueMember = "Id"; + comboBoxTransports.ValueMember = "MongoId"; comboBoxTransports.DataSource = viewTransport; comboBoxTransports.SelectedItem = null; } diff --git a/TransportCompany/TransportCompany/FormTransferData.cs b/TransportCompany/TransportCompany/FormTransferData.cs index b9e5dad..a9e4b24 100644 --- a/TransportCompany/TransportCompany/FormTransferData.cs +++ b/TransportCompany/TransportCompany/FormTransferData.cs @@ -36,10 +36,9 @@ namespace TransportCompany private void ButtonStartTransfer_Click(object sender, EventArgs e) { - /*using (var soundPlayer = new SoundPlayer(@"c:\Windows\Media\chimes.wav")) - { - soundPlayer.Play(); // can also use soundPlayer.PlaySync() - }*/ + var soundPlayer = new SoundPlayer(@"C:\Users\Programmist73\Desktop\Практика\2-й курс\4-й семестр\СУБД\Лаб. раб. №8\uda_requie.wav"); + + soundPlayer.PlaySync(); // can also use soundPlayer.PlaySync() Program.ConnectPostgres(); @@ -66,7 +65,7 @@ namespace TransportCompany _truckingLogic.TransferData(truckinglist); MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); - + Program.ConnectPostgres(); } } diff --git a/TransportCompany/TransportCompanyContracts/ViewModels/TruckingViewModel.cs b/TransportCompany/TransportCompanyContracts/ViewModels/TruckingViewModel.cs index 9448949..26b58ab 100644 --- a/TransportCompany/TransportCompanyContracts/ViewModels/TruckingViewModel.cs +++ b/TransportCompany/TransportCompanyContracts/ViewModels/TruckingViewModel.cs @@ -30,20 +30,20 @@ namespace TransportCompanyContracts.ViewModels [DisplayName("Почта")] public string ClientEmail { get; set; } = string.Empty; - public int TransportationId { get; set; } + public int CargoId { get; set; } - [DisplayName("Тип перевозки")] - public string TypeTransportation { get; set; } = string.Empty; + [DisplayName("Объект перевозки")] + public string Cargo { get; set; } = string.Empty; public int TransportId { get; set; } [DisplayName("Тип транспорта")] public string TransportName { get; set; } = string.Empty; - public int CargoId { get; set; } + public int TransportationId { get; set; } - [DisplayName("Объект перевозки")] - public string Cargo { get; set; } = string.Empty; + [DisplayName("Тип перевозки")] + public string TypeTransportation { get; set; } = string.Empty; [DisplayName("Цена")] public double Price { get; set; }