From e5b9fbbcb52f233359665d15da3b06524e9524c9 Mon Sep 17 00:00:00 2001 From: F1rsTTeaM Date: Thu, 18 Apr 2024 20:43:19 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D0=BE=D0=B2=20?= =?UTF-8?q?=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=B8=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CollectionGenericObjects/StorageCollection.cs | 2 +- .../ProjectAirplaneWithRadar/FormAirplaneCollection.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/StorageCollection.cs b/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/StorageCollection.cs index 3f43bec..d7f70fd 100644 --- a/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/StorageCollection.cs +++ b/AirplaneWithRadar/ProjectAirplaneWithRadar/CollectionGenericObjects/StorageCollection.cs @@ -191,7 +191,7 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects { try { - if (collection.Insert(airplane) < 0) + if (collection.Insert(airplane) == -1) { throw new Exception("Объект не удалось добавить в коллекцию: " + record[3]); } diff --git a/AirplaneWithRadar/ProjectAirplaneWithRadar/FormAirplaneCollection.cs b/AirplaneWithRadar/ProjectAirplaneWithRadar/FormAirplaneCollection.cs index a4d6e91..fdf1a16 100644 --- a/AirplaneWithRadar/ProjectAirplaneWithRadar/FormAirplaneCollection.cs +++ b/AirplaneWithRadar/ProjectAirplaneWithRadar/FormAirplaneCollection.cs @@ -274,6 +274,7 @@ namespace ProjectAirplaneWithRadar { _storageCollection.LoadData(openFileDialog.FileName); MessageBox.Show("Загрузка прошла успешно", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information); + RefreshListBoxItems(); } catch(Exception ex) {