Esempio n. 1
0
        private XElement ObjectContract()
        {
            var configuration    = _configuration.ProcurementObject;
            var projectConfig    = _configuration.Project;
            var procuremenObject = _notice.ProcurementObject;

            var contract = TedHelpers.Element("OBJECT_CONTRACT",
                                              projectConfig.Title
                    ? TedHelpers.PElement("TITLE", _notice.Project.Title)
                    : null,
                                              projectConfig.ReferenceNumber
                    ? TedHelpers.Element("REFERENCE_NUMBER", _notice.Project.ReferenceNumber)
                    : null,
                                              configuration.MainCpvCode.Code
                    ? TedHelpers.CpvCodeElement("CPV_MAIN", new [] { procuremenObject.MainCpvCode })
                    : null,
                                              projectConfig.ContractType
                    ? TedHelpers.ElementWithAttribute("TYPE_CONTRACT", "CTYPE", _notice.Project.ContractType.ToTEDFormat(_notice.Project.ProcurementCategory))
                    : null,
                                              configuration.ShortDescription
                    ? TedHelpers.PElement("SHORT_DESCR", procuremenObject.ShortDescription)
                    : null,
                                              procuremenObject.TotalValue != null ? procuremenObject.TotalValue.Type == ContractValueType.Exact
                    ? TedHelpers.Element("VAL_TOTAL",
                                         _notice.Project.ProcurementCategory == ProcurementCategory.Utility
                            ? new XAttribute("PUBLICATION", (!procuremenObject.TotalValue?.DisagreeToBePublished ?? false).ToYesNo("EN").ToUpperInvariant())
                            : null,
                                         new XAttribute("CURRENCY", procuremenObject.TotalValue.Currency),
                                         procuremenObject.TotalValue.Value)
                    : TedHelpers.Element("VAL_RANGE_TOTAL",
                                         _notice.Project.ProcurementCategory == ProcurementCategory.Utility
                            ? new XAttribute("PUBLICATION", (!procuremenObject.TotalValue.DisagreeToBePublished ?? false).ToYesNo("EN").ToUpperInvariant())
                            : null,
                                         new XAttribute("CURRENCY", procuremenObject.TotalValue.Currency),
                                         TedHelpers.Element("LOW", procuremenObject.TotalValue.MinValue),
                                         TedHelpers.Element("HIGH", procuremenObject.TotalValue.MaxValue)) : null,
                                              _helper.LotDivision(_notice.LotsInfo),
                                              _helper.ObjectDescriptions(_notice.ObjectDescriptions)
                                              );

            return(contract);
        }