From f882b814ab563cfb85682037c1e25e0292c709f1 Mon Sep 17 00:00:00 2001 From: "ityurner02@mail.ru" Date: Sat, 28 Oct 2023 09:02:31 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BB=D1=803=20=D1=81=D0=B4=D0=B0=D0=BD=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- COP/ClientsContracts/ViewModels/ClientViewModel.cs | 2 +- COP/ClientsDatabaseImplement/Implements/ClientStorage.cs | 2 +- COP/WinForms/FormClient.Designer.cs | 6 +++--- COP/WinForms/FormClient.cs | 2 +- COP/WinForms/FormMain.cs | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/COP/ClientsContracts/ViewModels/ClientViewModel.cs b/COP/ClientsContracts/ViewModels/ClientViewModel.cs index be11d1a..fab28e8 100644 --- a/COP/ClientsContracts/ViewModels/ClientViewModel.cs +++ b/COP/ClientsContracts/ViewModels/ClientViewModel.cs @@ -14,6 +14,6 @@ namespace ClientsContracts.ViewModels [DisplayName("Статус")] public string Status { get; set; } [DisplayName("Сумма покупок")] - public int? Amount { get; set; } + public string Amount { get; set; } } } diff --git a/COP/ClientsDatabaseImplement/Implements/ClientStorage.cs b/COP/ClientsDatabaseImplement/Implements/ClientStorage.cs index c407a90..dd4b0ac 100644 --- a/COP/ClientsDatabaseImplement/Implements/ClientStorage.cs +++ b/COP/ClientsDatabaseImplement/Implements/ClientStorage.cs @@ -110,7 +110,7 @@ namespace ClientsDatabaseImplement.Implements return new ClientViewModel { Id = client.Id, - Amount = client.Amount, + Amount = client.Amount.ToString(), Name = client.Name, Status = client.Status, Reviews = client.Reviews diff --git a/COP/WinForms/FormClient.Designer.cs b/COP/WinForms/FormClient.Designer.cs index 116fff7..49fc248 100644 --- a/COP/WinForms/FormClient.Designer.cs +++ b/COP/WinForms/FormClient.Designer.cs @@ -38,7 +38,7 @@ namespace WinForms label3 = new Label(); buttonSave = new Button(); buttonCancel = new Button(); - controlInputNullableInt1 = new ControlsLibraryNet60.Input.ControlInputNullableInt(); + controlInputNullableInt1 = new ControlInputNullableInt(); myDropDownList1 = new VisualCompLib.MyDropDownList(); SuspendLayout(); // @@ -141,7 +141,7 @@ namespace WinForms myDropDownList1.Margin = new Padding(3, 4, 3, 4); myDropDownList1.Name = "myDropDownList1"; myDropDownList1.SelectedValue = ""; - myDropDownList1.Size = new Size(198, 39); + myDropDownList1.Size = new Size(201, 39); myDropDownList1.TabIndex = 13; // // FormClient @@ -177,7 +177,7 @@ namespace WinForms private Label label3; private Button buttonSave; private Button buttonCancel; - private ControlsLibraryNet60.Input.ControlInputNullableInt controlInputNullableInt1; + private ControlInputNullableInt controlInputNullableInt1; private VisualCompLib.MyDropDownList myDropDownList1; } } \ No newline at end of file diff --git a/COP/WinForms/FormClient.cs b/COP/WinForms/FormClient.cs index 2db9df3..d369af0 100644 --- a/COP/WinForms/FormClient.cs +++ b/COP/WinForms/FormClient.cs @@ -45,7 +45,7 @@ namespace WinForms myDropDownList1.SelectedValue = view.Status; if (view.Amount != null) { - controlInputNullableInt1.Value = view.Amount; + controlInputNullableInt1.Value = Int32.Parse(view.Amount); } } } diff --git a/COP/WinForms/FormMain.cs b/COP/WinForms/FormMain.cs index 5bb70d3..244899d 100644 --- a/COP/WinForms/FormMain.cs +++ b/COP/WinForms/FormMain.cs @@ -36,7 +36,7 @@ namespace WinForms var list = _clientLogic.Read(null); for (int i = 0; i < list.Count; i++) { - if (list[i].Amount == null) { list[i].Amount = 0; } + if (list[i].Amount == null || list[i].Amount == "") { list[i].Amount = "нет"; } } myTreeView1.LoadTree(list); } @@ -109,7 +109,7 @@ namespace WinForms { foreach (var item in list) { - if (item.Amount != null) + if (item.Amount != null && item.Amount != "") { string clients = string.Concat("ФИО: ", item.Name, " Отзывы: ", item.Reviews); textList.Add(clients); @@ -170,7 +170,7 @@ namespace WinForms var clients = _clientLogic.Read(null); for (int i = 0; i < clients.Count; i++) { - if (clients[i].Amount == null) { clients[i].Amount = 0; } + if (clients[i].Amount == null || clients[i].Amount == "") { clients[i].Amount = "нет"; } } componentDocumentWithTableMultiHeaderPdf1.CreateDoc(new ComponentDocumentWithTableHeaderDataConfig {