Rock.Model.GroupService.AddNewGroupAddress C# (CSharp) Method

AddNewGroupAddress() public static method

Adds the new group address.
public static AddNewGroupAddress ( RockContext rockContext, Group group, string locationTypeGuid, string street1, string street2, string city, string state, string postalCode, string country, bool moveExistingToPrevious = false ) : void
rockContext Rock.Data.RockContext The rock context.
group Group The group.
locationTypeGuid string The location type unique identifier.
street1 string The street1.
street2 string The street2.
city string The city.
state string The state.
postalCode string The postal code.
country string The country.
moveExistingToPrevious bool if set to true [move existing to previous].
return void
        public static void AddNewGroupAddress( RockContext rockContext, Group group, string locationTypeGuid,
            string street1, string street2, string city, string state, string postalCode, string country, bool moveExistingToPrevious = false )
        {
            if ( !String.IsNullOrWhiteSpace( street1 ) ||
                 !String.IsNullOrWhiteSpace( street2 ) ||
                 !String.IsNullOrWhiteSpace( city ) ||
                 !String.IsNullOrWhiteSpace( postalCode ) ||
                 !string.IsNullOrWhiteSpace( country ) )
            {
                var location = new LocationService( rockContext ).Get( street1, street2, city, state, postalCode, country );
                AddNewGroupAddress( rockContext, group, locationTypeGuid, location, moveExistingToPrevious );
            }
        }

Same methods

GroupService::AddNewGroupAddress ( RockContext rockContext, Group group, string locationTypeGuid, Location location, bool moveExistingToPrevious = false ) : void
GroupService::AddNewGroupAddress ( RockContext rockContext, Group group, string locationTypeGuid, int locationId, bool moveExistingToPrevious = false ) : void