Esempio n. 1
0
        public GetVersionInfoForResponse GetVersionInfoForDocument(GetVersionInfoForDocumentRequest request)
        {
            ContractInfo DocInfo = new ContractInfo();
            if (request.DocInfo == null)
            {
                DocInfo.BookingCompShortName = "Merc GVA";
                DocInfo.CmdtyGroup = "CRUDE";
                DocInfo.DocName = request.DocumentKey;
                DocInfo.DocType = request.FeedType;
                DocInfo.Source = request.TradingSystemCode;
                DocInfo.FileType="docx";
            }
            DocInfo = request.DocInfo;

            ContractInfo[] contracts = new ContractInfo[5];
            contracts[0] = new ContractInfo
            {
                BookingCompShortName = DocInfo.BookingCompShortName,
                CmdtyGroup = DocInfo.CmdtyGroup,
                DocName = request.DocumentKey,
                DocType = request.FeedType,
                FileType = DocInfo.FileType,
                IsLatestVersion = false,
                TradeNum = ConvertToInt (request.DocumentKey),
                Source = request.TradingSystemCode,
                DocID = ConvertToInt (request.DocumentKey)+1,
                VersionNum="1",
                URL = DocInfo.CmdtyGroup + "/" + request.FeedType + "/" + DocInfo.FileType + "/" + request.DocumentKey + "/" + request.DocumentKey + 
                "1" + "." + DocInfo.FileType            
            };
            contracts[1] = new ContractInfo
            {
                BookingCompShortName = DocInfo.BookingCompShortName,
                CmdtyGroup = DocInfo.CmdtyGroup,
                DocName = request.DocumentKey,
                DocType = request.FeedType,
                FileType = DocInfo.FileType,
                IsLatestVersion = false,
                TradeNum = ConvertToInt(request.DocumentKey),
                Source = request.TradingSystemCode,
                DocID = ConvertToInt(request.DocumentKey) + 2,
                VersionNum = "2",
                URL = DocInfo.CmdtyGroup + "/" + request.FeedType + "/" + DocInfo.FileType + "/" + request.DocumentKey + "/" + request.DocumentKey +
                "2" + "." + DocInfo.FileType     
            };
            contracts[2] = new ContractInfo
            {
                BookingCompShortName = DocInfo.BookingCompShortName,
                CmdtyGroup = DocInfo.CmdtyGroup,
                DocName = request.DocumentKey,
                DocType = request.FeedType,
                FileType = DocInfo.FileType,
                IsLatestVersion = false,
                TradeNum = ConvertToInt(request.DocumentKey),
                Source = request.TradingSystemCode,
                DocID = ConvertToInt(request.DocumentKey) + 3,
                VersionNum = "3",
                URL = DocInfo.CmdtyGroup + "/" + request.FeedType + "/" + DocInfo.FileType + "/" + request.DocumentKey + "/" + request.DocumentKey +
                "3" + "." + DocInfo.FileType     

            };
            contracts[3] = new ContractInfo
            {
                BookingCompShortName = DocInfo.BookingCompShortName,
                CmdtyGroup = DocInfo.CmdtyGroup,
                DocName = request.DocumentKey,
                DocType = request.FeedType,
                FileType = DocInfo.FileType,
                IsLatestVersion = false,
                TradeNum = ConvertToInt(request.DocumentKey),
                Source = request.TradingSystemCode,
                DocID = ConvertToInt(request.DocumentKey) + 4,
                VersionNum = "4",
                URL = DocInfo.CmdtyGroup + "/" + request.FeedType + "/" + DocInfo.FileType + "/" + request.DocumentKey + "/" + request.DocumentKey +
                "4" + "." + DocInfo.FileType     
            };
            contracts[4] = new ContractInfo
            {
                BookingCompShortName = DocInfo.BookingCompShortName,
                CmdtyGroup = DocInfo.CmdtyGroup,
                DocName = request.DocumentKey,
                DocType = request.FeedType,
                FileType = DocInfo.FileType,
                IsLatestVersion = false,
                TradeNum = ConvertToInt(request.DocumentKey),
                Source = request.TradingSystemCode,
                DocID = ConvertToInt(request.DocumentKey) + 5,
                VersionNum = "5",
                URL = DocInfo.CmdtyGroup + "/" + request.FeedType + "/" + DocInfo.FileType + "/" + request.DocumentKey + "/" + request.DocumentKey +
                "5" + "." + DocInfo.FileType 
            };

            return new GetVersionInfoForResponse { QueryResult=contracts };
        }
Esempio n. 2
0
        public GetVersionInfoForResponse GetVersionInfoForDocument(GetVersionInfoForDocumentRequest request)
        {
            ContractInfo DocInfo = new ContractInfo();

            if (request.DocInfo == null)
            {
                DocInfo.BookingCompShortName = "Merc GVA";
                DocInfo.CmdtyGroup           = "CRUDE";
                DocInfo.DocName  = request.DocumentKey;
                DocInfo.DocType  = request.FeedType;
                DocInfo.Source   = request.TradingSystemCode;
                DocInfo.FileType = "docx";
            }
            DocInfo = request.DocInfo;

            ContractInfo[] contracts = new ContractInfo[5];
            contracts[0] = new ContractInfo
            {
                BookingCompShortName = DocInfo.BookingCompShortName,
                CmdtyGroup           = DocInfo.CmdtyGroup,
                DocName         = request.DocumentKey,
                DocType         = request.FeedType,
                FileType        = DocInfo.FileType,
                IsLatestVersion = false,
                TradeNum        = ConvertToInt(request.DocumentKey),
                Source          = request.TradingSystemCode,
                DocID           = ConvertToInt(request.DocumentKey) + 1,
                VersionNum      = "1",
                URL             = DocInfo.CmdtyGroup + "/" + request.FeedType + "/" + DocInfo.FileType + "/" + request.DocumentKey + "/" + request.DocumentKey +
                                  "1" + "." + DocInfo.FileType
            };
            contracts[1] = new ContractInfo
            {
                BookingCompShortName = DocInfo.BookingCompShortName,
                CmdtyGroup           = DocInfo.CmdtyGroup,
                DocName         = request.DocumentKey,
                DocType         = request.FeedType,
                FileType        = DocInfo.FileType,
                IsLatestVersion = false,
                TradeNum        = ConvertToInt(request.DocumentKey),
                Source          = request.TradingSystemCode,
                DocID           = ConvertToInt(request.DocumentKey) + 2,
                VersionNum      = "2",
                URL             = DocInfo.CmdtyGroup + "/" + request.FeedType + "/" + DocInfo.FileType + "/" + request.DocumentKey + "/" + request.DocumentKey +
                                  "2" + "." + DocInfo.FileType
            };
            contracts[2] = new ContractInfo
            {
                BookingCompShortName = DocInfo.BookingCompShortName,
                CmdtyGroup           = DocInfo.CmdtyGroup,
                DocName         = request.DocumentKey,
                DocType         = request.FeedType,
                FileType        = DocInfo.FileType,
                IsLatestVersion = false,
                TradeNum        = ConvertToInt(request.DocumentKey),
                Source          = request.TradingSystemCode,
                DocID           = ConvertToInt(request.DocumentKey) + 3,
                VersionNum      = "3",
                URL             = DocInfo.CmdtyGroup + "/" + request.FeedType + "/" + DocInfo.FileType + "/" + request.DocumentKey + "/" + request.DocumentKey +
                                  "3" + "." + DocInfo.FileType
            };
            contracts[3] = new ContractInfo
            {
                BookingCompShortName = DocInfo.BookingCompShortName,
                CmdtyGroup           = DocInfo.CmdtyGroup,
                DocName         = request.DocumentKey,
                DocType         = request.FeedType,
                FileType        = DocInfo.FileType,
                IsLatestVersion = false,
                TradeNum        = ConvertToInt(request.DocumentKey),
                Source          = request.TradingSystemCode,
                DocID           = ConvertToInt(request.DocumentKey) + 4,
                VersionNum      = "4",
                URL             = DocInfo.CmdtyGroup + "/" + request.FeedType + "/" + DocInfo.FileType + "/" + request.DocumentKey + "/" + request.DocumentKey +
                                  "4" + "." + DocInfo.FileType
            };
            contracts[4] = new ContractInfo
            {
                BookingCompShortName = DocInfo.BookingCompShortName,
                CmdtyGroup           = DocInfo.CmdtyGroup,
                DocName         = request.DocumentKey,
                DocType         = request.FeedType,
                FileType        = DocInfo.FileType,
                IsLatestVersion = false,
                TradeNum        = ConvertToInt(request.DocumentKey),
                Source          = request.TradingSystemCode,
                DocID           = ConvertToInt(request.DocumentKey) + 5,
                VersionNum      = "5",
                URL             = DocInfo.CmdtyGroup + "/" + request.FeedType + "/" + DocInfo.FileType + "/" + request.DocumentKey + "/" + request.DocumentKey +
                                  "5" + "." + DocInfo.FileType
            };

            return(new GetVersionInfoForResponse {
                QueryResult = contracts
            });
        }