Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DataPlugins/DataPluginImporter.cs =================================================================== diff -u -r6880 -r6918 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DataPlugins/DataPluginImporter.cs (.../DataPluginImporter.cs) (revision 6880) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DataPlugins/DataPluginImporter.cs (.../DataPluginImporter.cs) (revision 6918) @@ -70,7 +70,6 @@ { private readonly IFeatureRepository repository = new FeatureRepository(); private bool isAllDataImported; - private bool isDikeRingAndLocationDataImported; private List attributes; private DamProjectType damProjectType; @@ -243,7 +242,6 @@ public void ImportDataForDike(ProgressDelegate progress) { isAllDataImported = false; - isDikeRingAndLocationDataImported = false; ImportAllData(progress); } @@ -291,7 +289,6 @@ /// public IEnumerable GetLocationIdList() { - ImportDikeRingAndLocationData(); Dike dike = GetDike(); return dike.Locations.Select(location => location.Name); } @@ -636,7 +633,6 @@ InitializeDike(); isAllDataImported = false; - isDikeRingAndLocationDataImported = false; } /// @@ -884,31 +880,6 @@ } /// - /// Import only Dikering and location id's - /// - private void ImportDikeRingAndLocationData() - { - if (isDikeRingAndLocationDataImported || isAllDataImported) - { - return; - } - - var csvImporter = new CsvImporter(); - foreach (DataSource dataSource in DataSources) - { - ImportDikeRingAndLocationData(dataSource, ref csvImporter); - } - - var combineImportedData = new CombineImportedData - { - Dike = Dike, - LocationRecords = csvImporter.LocationRecords - }; - combineImportedData.AddCsvDataToDikes(); - isDikeRingAndLocationDataImported = true; - } - - /// /// Gets the data location. /// /// The data source. @@ -932,33 +903,6 @@ } /// - /// Imports the dike ring and location data. - /// - /// The data source. - /// - /// - private void ImportDikeRingAndLocationData(DataSource dataSource, ref CsvImporter csvImporter) - { - string dataLocation = GetDataLocation(dataSource); - - switch (dataSource.DataSourceType) - { - case DataSourceType.CsvFiles: - // New importer - ImportCsvFiles(dataLocation, ImportMode.DikeRingAndLocationData, null, ref csvImporter); - break; - case DataSourceType.DataShapeFiles: - List locationRecords = csvImporter.LocationRecords; - ImportShapeFile(dataLocation, ref locationRecords); - csvImporter.LocationRecords = locationRecords; - break; - case DataSourceType.BackgroundShapeFiles: - default: - throw new ArgumentOutOfRangeException(); - } - } - - /// /// Imports the data. /// /// The data source. @@ -1042,12 +986,7 @@ private void ImportData(ImportMode importMode, ProgressDelegate progress) { ThrowIfNoDataDefinitions(); - if (!isDikeRingAndLocationDataImported) - { - // If locations and dikeringIds were not read yet then we start with a new waterboard - // Else continue with waterboard that was created when importing the locations - InitializeDike(); - } + InitializeDike(); Dike.Description = LocalizationManager.GetTranslatedText(Dike, "DikeDescription"); var csvImporter = new CsvImporter();