public void ProcessQuoteMessage(QuoteMessage quoteMessage) { this.PlaySound(SoundOption.Enquiry); int waiteTime = this._SettingsParameterManager.DealingOrderParameter.EnquiryWaitTime; string exhcangeCode = quoteMessage.ExchangeCode; Guid customerId = quoteMessage.CustomerID; ExchangeSettingManager settingManager = this.GetExchangeSetting(exhcangeCode); Dictionary<Guid, InstrumentClient> instruments = this.GetInstruments(exhcangeCode); Customer customer = settingManager.GetCustomers().SingleOrDefault(P => P.Id == customerId); if (customer == null) return; if (!instruments.ContainsKey(quoteMessage.InstrumentID)) return; InstrumentClient instrument = instruments[quoteMessage.InstrumentID]; QuotePolicyDetail quotePolicy = settingManager.GetQuotePolicyDetail(instrument.Id, customer); ExchangeQuotation quotation = this.GetExchangeQuotation(exhcangeCode, quotePolicy); QuotePriceClient quotePriceClient = new QuotePriceClient(quoteMessage, waiteTime, instrument, customer, quotation); this._QuotePriceClientModel.AddSendQuotePrice(quotePriceClient); App.MainFrameWindow.QuotePriceWindow.ShowQuotePriceWindow(); }
public void ProcessQuoteMessage(QuoteMessage quoteMessage) { int waiteTime = 50; // this.SettingsManager.GetSettingsParameter(quoteMessage.ExchangeCode).ParameterSetting.EnquiryWaitTime; string exhcangeCode = quoteMessage.ExchangeCode; Guid customerId = quoteMessage.CustomerID; Customer customer = this.SettingsManager.GetCustomers().SingleOrDefault(P => P.Id == customerId); if (customer == null) { //get from db return; } if (!this._Instruments.ContainsKey(quoteMessage.InstrumentID)) return; InstrumentClient instrument = this._Instruments[quoteMessage.InstrumentID]; QuotePolicyDetail quotePolicy = this.SettingsManager.GetQuotePolicyDetail(instrument.Id, customer); ExchangeQuotation quotation = this.GetExchangeQuotation(exhcangeCode, quotePolicy); QuotePriceClient quotePriceClient = new QuotePriceClient(quoteMessage, waiteTime, instrument, customer, quotation); this._QuotePriceClientModel.AddSendQuotePrice(quotePriceClient); }
void MessageClient_QuotePriceReceived(QuoteMessage quoteMessage) { if (!this._QuoteTimer.IsEnabled) { this._QuoteTimer.Start(); } }