Example #1
0
 /// <summary>
 /// Address (section 5)
 /// </summary>
 /// <param name="contractor">Contractor contat information</param>
 /// <returns>Xelement</returns>
 public static XElement INC_05(ContractorContactInformation contractor)
 {
     return(Element("CONTACT_DATA_WITHOUT_RESPONSIBLE_NAME",
                    Element("ORGANISATION",
                            Element("OFFICIALNAME", contractor.OfficialName),
                            Element("NATIONALID", contractor.NationalRegistrationNumber)
                            ),
                    Element("ADDRESS", contractor.PostalAddress?.StreetAddress),
                    Element("TOWN", contractor.PostalAddress?.Town),
                    Element("POSTAL_CODE", contractor.PostalAddress?.PostalCode),
                    ElementWithAttribute("COUNTRY", "VALUE", contractor.PostalAddress?.Country),
                    Element("E_MAILS",
                            Element("E_MAIL", contractor.Email)
                            ),
                    Element("PHONE", contractor.TelephoneNumber),
                    Element("URL", contractor.MainUrl)
                    ));
 }
Example #2
0
        /// <summary>
        /// Address (section 5)
        /// </summary>
        /// <param name="contractor">Contractor contat information</param>
        /// <param name="rootElement">Root element</param>
        /// <returns>Xelement</returns>
        public static XElement ADDRS5(ContractorContactInformation contractor, string rootElement = "ADDRESS_CONTRACTOR")
        {
            if (contractor == null)
            {
                return(null);
            }

            return(Element(rootElement,
                           Element("OFFICIALNAME", contractor.OfficialName),
                           Element("NATIONALID", contractor.NationalRegistrationNumber),
                           Element("ADDRESS", contractor.PostalAddress?.StreetAddress),
                           Element("TOWN", contractor.PostalAddress?.Town),
                           Element("POSTAL_CODE", contractor.PostalAddress?.PostalCode),
                           ElementWithAttribute("COUNTRY", "VALUE", contractor.PostalAddress?.Country),
                           Element("PHONE", contractor.TelephoneNumber),
                           Element("E_MAIL", contractor.Email),
                           contractor.NutsCodes.ToList().Select(x => new XElement(n2016 + "NUTS", new XAttribute("CODE", x))),
                           Element("URL", contractor.MainUrl)
                           ));
        }