public TerrainObjectWasImportedFromCrab( CrabTerrainObjectId terrainObjectId, CrabIdentifierTerrainObject identifierTerrainObject, CrabTerrainObjectNatureCode terrainObjectNatureCode, CrabCoordinate xCoordinate, CrabCoordinate yCoordinate, CrabBuildingNature buildingNature, CrabLifetime crabLifetime, CrabTimestamp timestamp, CrabOperator @operator, CrabModification?modification, CrabOrganisation?organisation) { TerrainObjectId = terrainObjectId; IdentifierTerrainObject = identifierTerrainObject; TerrainObjectNatureCode = terrainObjectNatureCode; XCoordinate = xCoordinate; YCoordinate = yCoordinate; BuildingNature = buildingNature; Begin = crabLifetime.BeginDateTime; End = crabLifetime.EndDateTime; Timestamp = timestamp; Operator = @operator; Modification = modification; Organisation = organisation; }
public ImportTerrainObjectFromCrab( VbrCaPaKey caPaKey, CrabTerrainObjectId terrainObjectId, CrabIdentifierTerrainObject identifierTerrainObject, CrabTerrainObjectNatureCode terrainObjectNatureCode, CrabCoordinate xCoordinate, CrabCoordinate yCoordinate, CrabBuildingNature buildingNature, CrabLifetime lifetime, CrabTimestamp timestamp, CrabOperator @operator, CrabModification?modification, CrabOrganisation?organisation) { CaPaKey = caPaKey; TerrainObjectId = terrainObjectId; IdentifierTerrainObject = identifierTerrainObject; TerrainObjectNatureCode = terrainObjectNatureCode; XCoordinate = xCoordinate; YCoordinate = yCoordinate; BuildingNature = buildingNature; Lifetime = lifetime; Timestamp = timestamp; Operator = @operator; Modification = modification; Organisation = organisation; }
public void ImportTerrainObjectFromCrab( CrabTerrainObjectId terrainObjectId, CrabIdentifierTerrainObject identifierTerrainObject, CrabTerrainObjectNatureCode terrainObjectNatureCode, CrabCoordinate xCoordinate, CrabCoordinate yCoordinate, CrabBuildingNature buildingNature, CrabLifetime lifetime, CrabTimestamp timestamp, CrabOperator @operator, CrabModification?modification, CrabOrganisation?organisation) { if (modification == CrabModification.Delete) { ApplyChange(new ParcelWasRemoved(_parcelId)); } else { if (lifetime.EndDateTime.HasValue && !IsRetired) { if (modification == CrabModification.Correction) { ApplyChange(new ParcelWasCorrectedToRetired(_parcelId)); } else { ApplyChange(new ParcelWasRetired(_parcelId)); } } else if (!lifetime.EndDateTime.HasValue && !IsRealized) { if (modification == CrabModification.Correction) { ApplyChange(new ParcelWasCorrectedToRealized(_parcelId)); } else { ApplyChange(new ParcelWasRealized(_parcelId)); } } } ApplyChange(new TerrainObjectWasImportedFromCrab( terrainObjectId, identifierTerrainObject, terrainObjectNatureCode, xCoordinate, yCoordinate, buildingNature, lifetime, timestamp, @operator, modification, organisation)); }
public TerrainObjectHouseNumberWasImportedFromCrab( CrabTerrainObjectHouseNumberId terrainObjectHouseNumberId, CrabTerrainObjectId terrainObjectId, CrabHouseNumberId houseNumberId, CrabLifetime lifetime, CrabTimestamp timestamp, CrabOperator @operator, CrabModification?modification, CrabOrganisation?organisation) { TerrainObjectHouseNumberId = terrainObjectHouseNumberId; TerrainObjectId = terrainObjectId; HouseNumberId = houseNumberId; BeginDateTime = lifetime.BeginDateTime; EndDateTime = lifetime.EndDateTime; Timestamp = timestamp; Operator = @operator; Modification = modification; Organisation = organisation; }
public ImportTerrainObjectHouseNumberFromCrab( VbrCaPaKey caPaKey, CrabTerrainObjectHouseNumberId terrainObjectHouseNumberId, CrabTerrainObjectId terrainObjectId, CrabHouseNumberId houseNumberId, CrabLifetime lifetime, CrabTimestamp timestamp, CrabOperator @operator, CrabModification?modification, CrabOrganisation?organisation) { CaPaKey = caPaKey; TerrainObjectHouseNumberId = terrainObjectHouseNumberId; TerrainObjectId = terrainObjectId; HouseNumberId = houseNumberId; Lifetime = lifetime; Timestamp = timestamp; Operator = @operator; Modification = modification; Organisation = organisation; }
public void ImportTerrainObjectHouseNumberFromCrab( CrabTerrainObjectHouseNumberId terrainObjectHouseNumberId, CrabTerrainObjectId terrainObjectId, CrabHouseNumberId houseNumberId, CrabLifetime lifetime, CrabTimestamp timestamp, CrabOperator @operator, CrabModification?modification, CrabOrganisation?organisation) { GuardRemoved(modification); var legacyEvent = new TerrainObjectHouseNumberWasImportedFromCrab( terrainObjectHouseNumberId, terrainObjectId, houseNumberId, lifetime, timestamp, @operator, modification, organisation); var addressId = AddressId.CreateFor(houseNumberId); if (_addressCollection.Contains(addressId) && (modification == CrabModification.Delete || lifetime.EndDateTime.HasValue)) { if (_activeHouseNumberIdsByTerreinObjectHouseNr.Values.Count(x => x == houseNumberId) == 1) { foreach (var addressIdToRemove in _addressCollection.AddressIdsEligableToRemoveFor(houseNumberId)) { ApplyChange(new ParcelAddressWasDetached(_parcelId, addressIdToRemove)); } ApplyChange(new ParcelAddressWasDetached(_parcelId, addressId)); } } else { if (_activeHouseNumberIdsByTerreinObjectHouseNr.ContainsKey(terrainObjectHouseNumberId) && _activeHouseNumberIdsByTerreinObjectHouseNr[terrainObjectHouseNumberId] != houseNumberId) { var currentCrabHouseNumberId = _activeHouseNumberIdsByTerreinObjectHouseNr[terrainObjectHouseNumberId]; if (_activeHouseNumberIdsByTerreinObjectHouseNr.Values.Count(x => x == currentCrabHouseNumberId) == 1) { foreach (var addressIdToRemove in _addressCollection.AddressIdsEligableToRemoveFor( currentCrabHouseNumberId)) { ApplyChange(new ParcelAddressWasDetached(_parcelId, addressIdToRemove)); } ApplyChange(new ParcelAddressWasDetached(_parcelId, AddressId.CreateFor(currentCrabHouseNumberId))); } } if (!_addressCollection.Contains(addressId) && modification != CrabModification.Delete && !lifetime.EndDateTime.HasValue) { ApplyChange(new ParcelAddressWasAttached(_parcelId, addressId)); foreach (var addressIdToAdd in _addressCollection.AddressIdsEligableToAddFor(houseNumberId)) { ApplyChange(new ParcelAddressWasAttached(_parcelId, addressIdToAdd)); } } } ApplyChange(legacyEvent); }