コード例 #1
0
ファイル: CustomerAccount.cs プロジェクト: wncoder/core
        /// <summary>
        ///     Allows you to populate the current customer account object using a CustomerAccount instance
        /// </summary>
        /// <param name="dto">An instance of the customer account from the REST API</param>
        public void FromDto(CustomerAccountDTO dto)
        {
            Bvin      = dto.Bvin;
            Email     = dto.Email;
            FirstName = dto.FirstName;
            LastName  = dto.LastName;
            Password  = dto.Password;

            TaxExempt      = dto.TaxExempt;
            Notes          = dto.Notes;
            PricingGroupId = dto.PricingGroupId;

            FailedLoginCount = dto.FailedLoginCount;

            LastUpdatedUtc   = dto.LastUpdatedUtc;
            CreationDateUtc  = dto.CreationDateUtc;
            LastLoginDateUtc = dto.LastLoginDateUtc;

            foreach (var a in dto.Addresses)
            {
                var addr = new Address();
                addr.FromDto(a);
                Addresses.Add(addr);
            }

            ShippingAddress.FromDto(dto.ShippingAddress);
            BillingAddress.FromDto(dto.BillingAddress);
        }