diff --git a/COP/ClientsContracts/ViewModels/ClientViewModel.cs b/COP/ClientsContracts/ViewModels/ClientViewModel.cs index 1b80cbf..a954b84 100644 --- a/COP/ClientsContracts/ViewModels/ClientViewModel.cs +++ b/COP/ClientsContracts/ViewModels/ClientViewModel.cs @@ -15,7 +15,7 @@ namespace ClientsContracts.ViewModels public int StatusId { get; set; } = 0; [DisplayName("Статус")] public string StatusName { get; set; } = string.Empty; - public float ViewAmount { get; set; } = 0; + public string ViewAmount { get; set; } = string.Empty; public string DocAmount { get; set; } = string.Empty; } } \ No newline at end of file diff --git a/COP/WinForms/FormMain.cs b/COP/WinForms/FormMain.cs index 1caab1f..266d407 100644 --- a/COP/WinForms/FormMain.cs +++ b/COP/WinForms/FormMain.cs @@ -26,7 +26,7 @@ namespace WinForms { InitializeComponent(); _logic = logic; - myTreeView.setHierarchy(new List<(string, bool)> { ("StatusName", false), ("ViewAmount", false), ("Id", true), ("Name", true) }); + } private void статусыToolStripMenuItem_Click(object sender, EventArgs e) @@ -41,11 +41,12 @@ namespace WinForms private void FormMain_Load(object sender, EventArgs e) { LoadData(); + myTreeView.setHierarchy(new List<(string, bool)> { ("StatusName", false), ("ViewAmount", false), ("Id", true), ("Name", true) }); } private void LoadData() { - //myTreeView.clear(); + myTreeView.clear(); var clients = _logic.ReadList(null); if (clients != null) { @@ -53,11 +54,11 @@ namespace WinForms { if (!client.Amount.HasValue) { - client.ViewAmount = 0; + client.ViewAmount = "нет покупок"; } else { - client.ViewAmount = client.Amount.Value; + client.ViewAmount = client.Amount.Value.ToString(); } } myTreeView.addItems(clients); @@ -158,7 +159,7 @@ namespace WinForms { if (!client.Amount.HasValue) { - client.DocAmount = "нет"; + client.DocAmount = "нет покупок"; } else { @@ -181,9 +182,9 @@ namespace WinForms ColumnsRowsWidth = new List<(int Column, int Row)> { (10, 10), - (10, 10), - (10, 10), - (10, 10) + (20, 20), + (20, 20), + (15, 15) }, ColumnUnion = new List<(int StartIndex, int Count)>(), FilePath = path diff --git a/COP/WinForms/WinForms.csproj b/COP/WinForms/WinForms.csproj index a44a277..8710ca1 100644 --- a/COP/WinForms/WinForms.csproj +++ b/COP/WinForms/WinForms.csproj @@ -9,7 +9,7 @@ - +