Esempio n. 1
0
        private OrganisationParty_Type GetOrganisationPartyType(
            CountryCode_Type resCountryCode,
            CountryCode_Type tinIssuedBy,
            string tinValue,
            CountryCode_Type organisationINTypeIssuedBy,
            string organisationINTypeValue,
            string nameOrganisation,
            CountryCode_Type addressCountryCode,
            object[] address,
            OECDLegalAddressType_EnumType legalAddressType
            )
        {
            var entity = new OrganisationParty_Type();

            // Entity
            entity = new OrganisationParty_Type();

            entity.ResCountryCode = new CountryCode_Type[] { resCountryCode };

            // Entity.TIN
            entity.TIN                   = new TIN_Type();
            entity.TIN.issuedBy          = tinIssuedBy;
            entity.TIN.issuedBySpecified = true;
            entity.TIN.Value             = tinValue;


            OrganisationIN_Type organisationIN_Type = new OrganisationIN_Type
            {
                INType            = "Company Registration Number",
                issuedBy          = organisationINTypeIssuedBy,
                issuedBySpecified = true,
                Value             = organisationINTypeValue
            };

            entity.IN = new OrganisationIN_Type[] { organisationIN_Type };


            NameOrganisation_Type nameOrganisation_Type = new NameOrganisation_Type();

            nameOrganisation_Type.Value = nameOrganisation;
            entity.Name = new NameOrganisation_Type[] { nameOrganisation_Type };


            var addr = new Address_Type()
            {
                CountryCode               = addressCountryCode,
                Items                     = address,
                legalAddressType          = legalAddressType,
                legalAddressTypeSpecified = true
            };

            entity.Address = new Address_Type[] { addr };


            return(entity);
        }
        private OrganisationParty_Type GetOrganisationPartyType(
            CountryCode_Type resCountryCode,
            CountryCode_Type tinIssuedBy,
            string tinValue,
            CountryCode_Type organisationINTypeIssuedBy,
            string organisationINTypeValue,
            string nameOrganisation,
            CountryCode_Type addressCountryCode,
            string[] address,
            OECDLegalAddressType_EnumType legalAddressType
            )
        {
            // Entity
            var entity = new OrganisationParty_Type();

            entity.ResCountryCode = new CountryCode_Type[] { resCountryCode };

            // Entity.TIN
            entity.TIN                   = new TIN_Type();
            entity.TIN.issuedBy          = tinIssuedBy;
            entity.TIN.issuedBySpecified = true;
            entity.TIN.Value             = tinValue;


            OrganisationIN_Type organisationIN_Type = new OrganisationIN_Type
            {
                INType            = "Company Registration Number",
                issuedBy          = organisationINTypeIssuedBy,
                issuedBySpecified = true,
                Value             = organisationINTypeValue
            };

            entity.IN = new OrganisationIN_Type[] { organisationIN_Type };


            NameOrganisation_Type nameOrganisation_Type = new NameOrganisation_Type();

            nameOrganisation_Type.Value = nameOrganisation;
            entity.Name = new NameOrganisation_Type[] { nameOrganisation_Type };


            //if (address.Count() == 3)
            //{
            //    var addrItem = new AddressFix_Type()
            //    {
            //        Street = address[0].Trim(),
            //        City = address[1].Trim(),
            //        PostCode = address[2].Trim()
            //    };

            //    var addr = new Address_Type()
            //    {
            //        CountryCode = addressCountryCode,
            //        Items = new AddressFix_Type[] { addrItem },
            //        legalAddressType = legalAddressType,
            //        legalAddressTypeSpecified = true
            //    };
            //    entity.Address = new Address_Type[] { addr };
            //}
            //else
            //{
            var adr  = string.Join(",", address);
            var addr = new Address_Type()
            {
                CountryCode               = addressCountryCode,
                Items                     = new string[] { adr },
                legalAddressType          = legalAddressType,
                legalAddressTypeSpecified = true
            };

            entity.Address = new Address_Type[] { addr };
            //}


            return(entity);
        }