Beispiel #1
0
        private static producerType SetUpProducer(countryType countryType, eeePlacedOnMarketBandType eeePlacedOnMarketBandType, annualTurnoverBandType annualTurnoverBandType, bool vatRegistered)
        {
            var producerCompany = new companyType()
            {
                companyName      = "Test company",
                companyNumber    = "Test CRN",
                registeredOffice = new contactDetailsContainerType()
                {
                    contactDetails = new contactDetailsType()
                    {
                        address = new addressType()
                        {
                            country = countryType
                        }
                    }
                }
            };

            var producerBusiness = new producerBusinessType()
            {
                Item = producerCompany
            };

            var producer = new producerType
            {
                annualTurnoverBand    = annualTurnoverBandType,
                VATRegistered         = vatRegistered,
                eeePlacedOnMarketBand = eeePlacedOnMarketBandType,
                producerBusiness      = producerBusiness
            };

            return(producer);
        }
Beispiel #2
0
        public async Task <ProducerBusiness> SetProducerBusiness(producerBusinessType producerBusiness)
        {
            object          item = producerBusiness.Item;
            ProducerContact correspondentForNoticeContact = null;

            if (producerBusiness.correspondentForNotices.contactDetails != null)
            {
                correspondentForNoticeContact =
                    await GetProducerContact(producerBusiness.correspondentForNotices.contactDetails);
            }

            Company     company     = null;
            Partnership partnership = null;

            if (item is companyType)
            {
                companyType     companyitem = (companyType)item;
                ProducerContact contact     = await GetProducerContact(companyitem.registeredOffice.contactDetails);

                company = new Company(companyitem.companyName, companyitem.companyNumber, contact);
            }
            else if (item is partnershipType)
            {
                partnershipType partnershipItem = (partnershipType)item;
                string          partnershipName = partnershipItem.partnershipName;

                List <string>   partnersList = partnershipItem.partnershipList.ToList();
                List <Partner>  partners     = partnersList.Select(name => new Partner(name)).ToList();
                ProducerContact contact      = await GetProducerContact(partnershipItem.principalPlaceOfBusiness.contactDetails);

                partnership = new Partnership(partnershipName, contact, partners);
            }

            return(new ProducerBusiness(company, partnership, correspondentForNoticeContact));
        }
Beispiel #3
0
        private static producerType SetRegisteredOfficeOrPPoBDetails(bool hasPartnership)
        {
            producerBusinessType producerBusiness = null;

            var contactDetailsInfo = new contactDetailsContainerType()
            {
                contactDetails = new contactDetailsType()
                {
                    address = new addressType()
                    {
                        country = countryType.UKENGLAND
                    }
                }
            };

            if (hasPartnership)
            {
                var producerPartnership = new partnershipType()
                {
                    partnershipName          = "MiddleEarth",
                    principalPlaceOfBusiness = contactDetailsInfo
                };

                producerBusiness = new producerBusinessType()
                {
                    Item = producerPartnership
                };
            }
            else
            {
                var producerCompany = new companyType()
                {
                    companyName      = "Rivendell",
                    registeredOffice = contactDetailsInfo
                };

                producerBusiness = new producerBusinessType()
                {
                    Item = producerCompany
                };
            }

            var producer = new producerType
            {
                producerBusiness = producerBusiness
            };

            return(producer);
        }