コード例 #1
0
        public Location Geocode( Location location )
        {
            var user = CurrentUser();
            if ( user != null )
            {
                if ( location != null )
                {
                    var locationService = new LocationService();
                    locationService.Geocode( location, user.PersonId );
                    return location;
                }

                throw new HttpResponseException( HttpStatusCode.BadRequest );
            }

            throw new HttpResponseException( HttpStatusCode.Unauthorized );
        }
コード例 #2
0
ファイル: FamilyMembers.ascx.cs プロジェクト: pkdevbox/Rock
        void rptrAddresses_ItemCommand( object source, RepeaterCommandEventArgs e )
        {
            int locationId = int.MinValue;
            if ( int.TryParse( e.CommandArgument.ToString(), out locationId ) )
            {
                var service = new LocationService();
                var location = service.Get( locationId );

                switch ( e.CommandName )
                {
                    case "geocode":
                        service.Geocode( location, CurrentPersonId );
                        break;

                    case "standardize":
                        service.Standardize( location, CurrentPersonId );
                        break;
                }

                service.Save( location, CurrentPersonId );
            }

            BindFamilies();
        }