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) {