当前位置: 首页>>代码示例>>C#>>正文


C# IAddress.TrySplitLastName方法代码示例

本文整理汇总了C#中IAddress.TrySplitLastName方法的典型用法代码示例。如果您正苦于以下问题:C# IAddress.TrySplitLastName方法的具体用法?C# IAddress.TrySplitLastName怎么用?C# IAddress.TrySplitLastName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IAddress的用法示例。


在下文中一共展示了IAddress.TrySplitLastName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateAddressRequest

 /// <summary>
 /// Creates an <see cref="AddressRequest"/>.
 /// </summary>
 /// <param name="address">
 /// The address.
 /// </param>
 /// <returns>
 /// The <see cref="AddressRequest"/>.
 /// </returns>
 public AddressRequest CreateAddressRequest(IAddress address)
 {
     return new AddressRequest()
     {
         FirstName = address.TrySplitFirstName(),
         LastName = address.TrySplitLastName(),
         Company = address.Organization,
         StreetAddress = address.Address1,
         ExtendedAddress = address.Address2,
         Locality = address.Locality,
         Region = address.Region,
         PostalCode = address.PostalCode,
         CountryCodeAlpha2 = address.CountryCode
     };
 }
开发者ID:GaryLProthero,项目名称:Merchello,代码行数:24,代码来源:BraintreeApiRequestFactory.cs

示例2: IsEqual

        /// <summary>
        /// Performs an equality comparison between a Braintree <see cref="Address"/> and a Merchello <see cref="IAddress"/>.
        /// </summary>
        /// <param name="bta">
        /// The Braintree address.
        /// </param>
        /// <param name="ma">
        /// The Merchello address.
        /// </param>
        /// <returns>
        /// Returns true if address properties match.
        /// </returns>
        private static bool IsEqual(this Address bta, IAddress ma)
        {
            var initial = bta.Company == ma.Organization && bta.StreetAddress == ma.Address1
                   && bta.ExtendedAddress == ma.Address2 && bta.Locality == ma.Locality && bta.Region == ma.Region
                   && bta.CountryCodeAlpha2 == ma.CountryCode && bta.PostalCode == ma.PostalCode;

            if (!initial) return false;

            if (!string.IsNullOrEmpty(ma.Name))
            {
                return bta.FirstName == ma.TrySplitFirstName() && bta.LastName == ma.TrySplitLastName();
            }

            return true;
        }
开发者ID:jlarc,项目名称:Merchello,代码行数:27,代码来源:BraintreeCustomerExtensions.cs

示例3: CreateCreditCardAddressRequest

 /// <summary>
 /// Creates a <see cref="CreditCardRequest"/>.
 /// </summary>
 /// <param name="address">
 /// The address.
 /// </param>
 /// <param name="isUpdate">
 /// The is update.
 /// </param>
 /// <returns>
 /// The <see cref="CreditCardAddressRequest"/>.
 /// </returns>
 public CreditCardAddressRequest CreateCreditCardAddressRequest(IAddress address, bool isUpdate = false)
 {
     return new CreditCardAddressRequest()
     {
         FirstName = address.TrySplitFirstName(),
         LastName = address.TrySplitLastName(),
         Company = address.Organization,
         StreetAddress = address.Address1,
         ExtendedAddress = address.Address2,
         Locality = address.Locality,
         Region = address.Region,
         PostalCode = address.PostalCode,
         CountryCodeAlpha2 = address.CountryCode,
         Options = new CreditCardAddressOptionsRequest() { UpdateExisting = isUpdate }
     };
 }
开发者ID:GaryLProthero,项目名称:Merchello,代码行数:28,代码来源:BraintreeApiRequestFactory.cs


注:本文中的IAddress.TrySplitLastName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。