Example #1
0
 public bool Validate(ContractBodyContactInformation info)
 {
     return(ValidateAll(Valid(info != null, "Information"),
                        Valid(!string.IsNullOrWhiteSpace(info?.NationalRegistrationNumber), "Information.NationalRegistrationNumber"),
                        Valid(info != null && info.NutsCodes.Any(), "Information.NutsCodes"),
                        Valid(!string.IsNullOrWhiteSpace(info?.OfficialName), "Information.OfficialName"),
                        Valid(!string.IsNullOrWhiteSpace(info?.MainUrl), "ContactInformation.MainUrl"),
                        Validate(info?.PostalAddress)));
 }
Example #2
0
 public bool Validate(string name, ContractBodyContactInformation info)
 {
     return(ValidateAll(Valid(info != null, $"{name}"),
                        Valid(info != null && info.NutsCodes?.Any() == true, $"{name}.NutsCodes"),
                        Valid(!string.IsNullOrWhiteSpace(info.OfficialName), $"{name}.OfficialName"),
                        Valid(!string.IsNullOrEmpty(info.MainUrl), $"{name}.MainUrl"),
                        Valid(!string.IsNullOrEmpty(info.Email), $"{name}.Email"),
                        Validate(info.PostalAddress)));
 }
Example #3
0
 /// <summary>
 /// Address (section 5)
 /// </summary>
 /// <param name="organisation">Contractor contat information</param>
 /// <returns>Xelement</returns>
 public static XElement INC_05(ContractBodyContactInformation organisation)
 {
     return(Element("CONTACT_DATA_WITHOUT_RESPONSIBLE_NAME",
                    Element("ORGANISATION",
                            Element("OFFICIALNAME", organisation.OfficialName),
                            Element("NATIONALID", organisation.NationalRegistrationNumber)
                            ),
                    Element("ADDRESS", organisation.PostalAddress?.StreetAddress),
                    Element("TOWN", organisation.PostalAddress?.Town),
                    Element("POSTAL_CODE", organisation.PostalAddress?.PostalCode),
                    ElementWithAttribute("COUNTRY", "VALUE", organisation.PostalAddress?.Country),
                    Element("E_MAILS",
                            Element("E_MAIL", organisation.Email)
                            ),
                    Element("PHONE", organisation.TelephoneNumber),
                    Element("URL", organisation.MainUrl)
                    ));
 }
Example #4
0
 /// <summary>
 /// ADDR-S1
 /// </summary>
 /// <param name="elementName">Name of element(ADDRESS_CONTRACTING_BODY or ADDRESS_CONTRACTING_BODY_ADDITIONAL)</param>
 /// <param name="information">Contract body contact</param>
 /// <returns>XElement</returns>
 public static XElement ADDRS1(string elementName, ContractBodyContactInformation information)
 {
     if (information == null)
     {
         return(null);
     }
     return(Element(elementName,
                    Element("OFFICIALNAME", information.OfficialName),
                    Element("NATIONALID", information.NationalRegistrationNumber),
                    Element("ADDRESS", information.PostalAddress?.StreetAddress),
                    Element("TOWN", information.PostalAddress?.Town),
                    Element("POSTAL_CODE", information.PostalAddress?.PostalCode),
                    ElementWithAttribute("COUNTRY", "VALUE", information.PostalAddress?.Country),
                    Element("E_MAIL", information.Email),
                    information.NutsCodes?.ToList().Select(x => new XElement(n2016 + "NUTS", new XAttribute("CODE", x))),
                    Element("URL_GENERAL", information.MainUrl)
                    ));
 }
Example #5
0
        /// <summary>
        /// ADDR-S6 Review body
        /// </summary>
        /// <param name="elementName"></param>
        /// <param name="information"></param>
        /// <returns></returns>
        public static XElement ADDRS6(string elementName, ContractBodyContactInformation information)
        {
            if (information == null)
            {
                return(null);
            }

            return(Element(elementName,
                           Element("OFFICIALNAME", information.OfficialName),
                           Element("ADDRESS", information.PostalAddress?.StreetAddress),
                           Element("TOWN", information.PostalAddress?.Town),
                           Element("POSTAL_CODE", information.PostalAddress?.PostalCode),
                           ElementWithAttribute("COUNTRY", "VALUE", information.PostalAddress?.Country),
                           Element("PHONE", information.TelephoneNumber),
                           Element("E_MAIL", information.Email),
                           Element("URL", information.MainUrl)
                           ));
        }
Example #6
0
        /// <summary>
        /// Conact data
        /// </summary>
        /// <param name="information">ContractBodyContactInformation</param>
        /// <returns>Xelement</returns>
        public static XElement INC_04(ContractBodyContactInformation information)
        {
            if (information == null)
            {
                return(null);
            }

            return(Element("CONTACT_DATA",
                           Element("ORGANISATION",
                                   Element("OFFICIALNAME", information.OfficialName),
                                   Element("NATIONALID", information.NationalRegistrationNumber)
                                   ),
                           Element("ADDRESS", information.PostalAddress?.StreetAddress),
                           Element("TOWN", information.PostalAddress?.Town),
                           Element("POSTAL_CODE", information.PostalAddress?.PostalCode),
                           ElementWithAttribute("COUNTRY", "VALUE", information.PostalAddress?.Country),
                           Element("CONTACT_POINT", information.ContactPerson),
                           Element("PHONE", information.TelephoneNumber),
                           Element("E_MAILS",
                                   Element("E_MAIL", information.Email)
                                   ),
                           Element("URL", information.MainUrl)
                           ));
        }