Esempio n. 1
0
        /// <summary>
        /// Sets an invoice business party as an individual
        /// </summary>
        /// <param name="party">The business party</param>
        /// <returns></returns>
        public IndividualType IsIndividual()
        {
            var individual = new IndividualType {
                Parent = this
            };

            this.Item = individual;

            if (this.TaxIdentification.ResidenceTypeCode == ResidenceTypeCodeType.ResidentInSpain)
            {
                AddressType address = new AddressType();

                address.CountryCode = CountryType.ESP;

                individual.Item = address;
            }
            else
            {
                individual.Item = new OverseasAddressType();
            }

            this.TaxIdentification.PersonTypeCode = PersonTypeCodeType.Individual;

            return(individual);
        }
        /// <summary>
        /// Sets an invoice business party as an individual
        /// </summary>
        /// <returns></returns>
        public IndividualType AsIndividual()
        {
            var individual = new IndividualType { Parent = this };

            this.Item = individual;

            if (this.TaxIdentification.ResidenceTypeCode == ResidenceTypeCodeType.ResidentInSpain)
            {
                individual.Item = new AddressType { CountryCode = CountryType.ESP };
            }
            else
            {
                individual.Item = new OverseasAddressType();
            }

            this.TaxIdentification.PersonTypeCode = PersonTypeCodeType.Individual;

            return individual;
        }