コード例 #1
0
ファイル: AddressMap.cs プロジェクト: ychung-mot/PIMS
        /// <summary>
        /// Create an address based on the model property values.
        /// </summary>
        /// <param name="properties"></param>
        /// <returns></returns>
        private string GetAddress1(GModel.PropertyModel properties)
        {
            var address = new StringBuilder();

            if (!String.IsNullOrWhiteSpace($"{ properties.CivicNumber}"))
            {
                address.Append($"{properties.CivicNumber} ");
            }

            if (properties.IsStreetTypePrefix && !String.IsNullOrWhiteSpace(properties.StreetType))
            {
                address.Append($"{properties.StreetType} ");
            }

            if (properties.IsStreetDirectionPrefix && !String.IsNullOrWhiteSpace(properties.StreetDirection))
            {
                address.Append($"{properties.StreetDirection} ");
            }

            if (!String.IsNullOrWhiteSpace(properties.StreetName))
            {
                address.Append(properties.StreetName);
            }

            if (!String.IsNullOrWhiteSpace(properties.StreetQualifier))
            {
                address.Append($" {properties.StreetQualifier}");
            }

            if (!properties.IsStreetDirectionPrefix && !String.IsNullOrWhiteSpace(properties.StreetDirection))
            {
                address.Append($" {properties.StreetDirection}");
            }

            if (!properties.IsStreetTypePrefix && !String.IsNullOrWhiteSpace(properties.StreetType))
            {
                address.Append($" {properties.StreetType}");
            }
            return(address.ToString());
        }
コード例 #2
0
ファイル: AddressMap.cs プロジェクト: ychung-mot/PIMS
 /// <summary>
 /// Get the administrative area name (city, municipality, district, etc.) based on the model property values.
 /// </summary>
 /// <param name="properties"></param>
 /// <returns></returns>
 private string GetAdministrativeArea(GModel.PropertyModel properties)
 {
     return(properties.LocalityName);
 }
コード例 #3
0
 /// <summary>
 /// Get the city name based on the model property values.
 /// </summary>
 /// <param name="properties"></param>
 /// <returns></returns>
 private string GetCity(GModel.PropertyModel properties)
 {
     return(properties.LocalityType == "City" ? properties.LocalityName : null);
 }