/// <summary> /// Gera um subset XML completo com as informacoes deste /// </summary> /// <returns></returns> public string ToXML() { string response = ""; string xml = "<traderBean>"; xml += "<ID>" + RecordNumber + "</ID>"; xml += "<DATA_NEGOCIO>" + TradeDate.ToString("yyyy-MM-dd") + "</DATA_NEGOCIO>"; xml += "<HORA_NEGOCIO>" + HoraNegocio + "</HORA_NEGOCIO>"; xml += "<NR_NEGOCIO>" + TradeID + "</NR_NEGOCIO>"; xml += "<CODNEG>" + Papel + "</CODNEG>"; xml += "<SERPAP>" + Serie + "</SERPAP>"; xml += "<OPERACAO>" + Orientation + "</OPERACAO>"; xml += "<QTDADE>" + NumberOfContracts + "</QTDADE>"; xml += "<PDENEG>" + Price.ToString(ciEn) + "</PDENEG>"; xml += "<FC_NOME>" + BuyerName + "</FC_NOME>"; xml += "<NM_EMIT_ORDEM>" + TraderName + "/<NM_EMIT_ORDEM>"; xml += "<MERCADO>" + SegmentoBolsa + "</MERCADO>"; response += xml; response += "</traderBean>"; return(response); }
public void Refresh() { if (Employer != null) { labelEmployer.Text = Employer.FullName; } if (TradeDate != null) { labelTradeDate.Text = TradeDate.ToString(PFConstants.DateOutputFormat); } }
public override string SqlInsertString() { // Ensure file entry is there and grab the ID StringBuilder sql = new StringBuilder(); sql.AppendFormat("declare @ID int\r\nEXEC @ID=InsertSwiftFile '{0}'", ContainingSwiftFileName.Replace(".working", "")); sql.AppendFormat("EXEC InsertMT300message @ID,'{0}','{1}','{2}','{3}','{4}','{5}','{6}'", ApplicationID, ServiceID, LogicalTerminalAddress, SessionNumber, SequenceNumber, Direction, ReceiverAddress); sql.AppendFormat(",'{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}'", Priority, DeliveryMonitor, ObsolescencePeriod, InputDate, InputTime, MessageInputReference, OutputDate, OutputTime ); sql.AppendFormat(",'{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}'", SenderReference, TypeOfOperation, CommonReference, PartyA, PartyB, TradeDate.ToString("yyyyMMdd"), ValueDate.ToString("yyyyMMdd"), ExchangeRate ); sql.AppendFormat(",'{0}','{1}','{2}','{3}','{4}','{5}'", BoughtCurrency, BoughtAmount, BoughtReceivingAgent, SoldCurrency, SoldAmount, SoldReceivingAgent ); sql.AppendFormat("\r\ndeclare @recid int\r\nselect @recid = recid from tblrec where name='FX Confirmation'\r\nEXEC ScheduleRec @recid,'{0:ddMMMyy}'", ValueDate); return(sql.ToString()); }
public traderBean ToBean() { traderBean bean = new traderBean(); bean.ID = RecordNumber.ToString(); bean.DATA_NEGOCIO = TradeDate.ToString("yyyy-MM-dd"); bean.HORA_NEGOCIO = HoraNegocio; bean.NR_NEGOCIO = TradeID; bean.CODNEG = Papel; bean.SERPAP = Serie; bean.OPERACAO = Orientation; bean.QTDADE = NumberOfContracts.ToString(); bean.PDENEG = Price.ToString(ciEn); bean.FC_NOME = BuyerName; bean.NM_EMIT_ORDEM = TraderName; bean.MERCADO = SegmentoBolsa; return(bean); }
/// <summary> /// Gera um subset XML completo com as informacoes deste /// </summary> /// <returns></returns> public string ToXML() { string response = ""; string xml = "<trade>"; xml += "<trade-date>" + TradeDate.ToString("yyyy-MM-dd") + "</trade-date>"; xml += "<trade-id>" + TradeID + "</trade-id>"; if ((DMASource != null && DMASource.Length > 0) && (DMATrade != null && DMATrade.Length > 0) && (DMATradeID != null && DMATradeID.Length > 0)) { xml += "<dma>"; xml += "<dma-source>" + DMASource + "</dma-source>"; xml += "<dma-trader>" + DMATrade + "</dma-trader>"; xml += "<dma-trade-id>" + DMATradeID + "</dma-trade-id>"; xml += "</dma>"; } //else // xml += "<dma/>"; xml += "<record-type>" + RecordType + "</record-type>"; xml += "<product-id>" + ProductID + "</product-id>"; xml += "<market-id>" + MarketID + "</market-id>"; xml += "<serie>" + Serie + "</serie>"; xml += "<maturity-date>" + MaturityDate.ToString("yyyy-MM-dd") + "</maturity-date>"; xml += "<hedge-long-maturity>" + HedgeLongMaturity.ToString("yyyy-MM-dd") + "</hedge-long-maturity>"; xml += "<trade-timestamp>" + TradeTimestamp.ToString("yyyy-MM-ddTHH:mm:ss") + "</trade-timestamp>"; //xml += "<trade-timestamp>" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + "</trade-timestamp>"; xml += "<negotiation-channel>" + NegotiationChannel + "</negotiation-channel>"; xml += "<after-hours>" + AfterHours.ToString().ToLowerInvariant() + "</after-hours>"; xml += "<orientation>" + Orientation + "</orientation>"; xml += "<number-of-contracts>" + NumberOfContracts + "</number-of-contracts>"; xml += "<price>" + Price.ToString(ciEn) + "</price>"; if (OptionType != null && OptionType.Length > 0) { xml += "<option-type>" + OptionType + "</option-type>"; } if (ValReference1 != 0) { xml += "<val-reference-1>" + ValReference1 + "</val-reference-1>"; } if (ValReference2 != 0) { xml += "<val-reference-2>" + ValReference2 + "</val-reference-2>"; } if (ValDelta != 0) { xml += "<val-delta>" + ValDelta + "</val-delta>"; } response += xml; if (TradeDetails.Count > 0) { xml = "<additional-details>"; foreach (TradeDetail detail in TradeDetails) { xml += detail.ToXML(); } xml += "</additional-details>"; } else { xml = "<additional-details/>"; } response += xml; xml = "<buyer>"; xml += "<buyer-code>{0}</buyer-code>"; xml += "<buyer-name>{1}</buyer-name>"; xml += "</buyer>"; xml += "<broker>"; xml += "<broker-code>{2}</broker-code>"; xml += "<broker-name>{3}</broker-name>"; xml += "</broker>"; xml += "<seller>"; xml += "<seller-code>{4}</seller-code>"; xml += "<seller-name>{5}</seller-name>"; xml += "</seller>"; xml += "<trader>"; xml += "<trader-code>{6}</trader-code>"; xml += "<trader-name>{7}</trader-name>"; xml += "</trader>"; response += string.Format(xml, BuyerCode, BuyerName, BrokerCode, BrokerName, SellerCode, SellerName, TraderCode, TraderName); response += "</trade>"; return(response); }