public QuoteQuickService() { _quickQuoteCommand = new RelayCommand(() => { var client = new ServiceReferenceQuotes.DelayedStockQuoteSoapClient(); StockValue = client.GetQuickQuote(StockName, "0"); }); }
public QuoteFullService() { _quoteCommand = new RelayCommand(() => { var client = new ServiceReferenceQuotes.DelayedStockQuoteSoapClient(); var quoteData = client.GetQuote(StockName, "0"); StockValue = quoteData.EarnPerShare; CompanyName = quoteData.CompanyName; }); }
private void btnQuotes_Click(object sender, EventArgs e) { var watch = new Stopwatch(); watch.Start(); var serviceClient = new ServiceReferenceQuotes.DelayedStockQuoteSoapClient("DelayedStockQuoteSoap"); txtQuotesOutput.Text = serviceClient.GetQuickQuote(txtQuotesInput.Text, "0").ToString(); watch.Stop(); txtQuotesWatch.Text = watch.ElapsedMilliseconds.ToString(); //GOOG = 731,25 //MSFT = 54,38 //YHOO = 35,12 //EBAY = 29,30 //IBM = 139,89 }
private void btnQuotesFull_Click(object sender, EventArgs e) { var watch = new Stopwatch(); watch.Start(); var serviceClient = new ServiceReferenceQuotes.DelayedStockQuoteSoapClient("DelayedStockQuoteSoap"); var quoteData = serviceClient.GetQuote(txtQuotesFullInput.Text, "0"); txtQuotesFullOutput.Text = quoteData.ChangePercent; txtQuotesFullOutput1.Text = quoteData.CompanyName; txtQuotesFullOutput2.Text = quoteData.EarnPerShare.ToString(); txtQuotesFullOutput3.Text = quoteData.FiftyTwoWeekRange; watch.Stop(); txtQuotesFullWatch.Text = watch.ElapsedMilliseconds.ToString(); //GOOG = Alphabet Inc.; 23,72; 486.23 - 739.48 //MSFT = Microsoft Corporation; 1,5040; 39.7200 - 54.9800 //YHOO = Yahoo! Inc.; 0,25; 27.20 - 52.62 //EBAY = eBay Inc.; 1,84; 22.11 - 29.69 //IBM = International Business Machines; 14,37; 135.05 - 176.30 GetStockValue(txtQuotesFullInput1.Text, txtQuotesFullyOutput1, txtQuotesFullyOutputDayHigh1, txtOutputEarnPerShare1, txtOutputFiftyTwoWeekRange1); GetStockValue(txtQuotesFullInput2.Text, txtQuotesFullyOutput2, txtQuotesFullyOutputDayHigh2, txtOutputEarnPerShare2, txtOutputFiftyTwoWeekRange2); GetStockValue(txtQuotesFullInput3.Text, txtQuotesFullyOutput3, txtQuotesFullyOutputDayHigh3, txtOutputEarnPerShare3, txtOutputFiftyTwoWeekRange3); GetStockValue(txtQuotesFullInput4.Text, txtQuotesFullyOutput4, txtQuotesFullyOutputDayHigh4, txtOutputEarnPerShare4, txtOutputFiftyTwoWeekRange4); }
private void StartTasks() { var clientQuote = new ServiceReferenceQuotes.DelayedStockQuoteSoapClient("DelayedStockQuoteSoap"); taskQuotes = clientQuote.GetQuickQuoteAsync(txtQuotesInput.Text, "0"); var clientQuoteFull = new ServiceReferenceQuotes.DelayedStockQuoteSoapClient("DelayedStockQuoteSoap"); taskQuotesFull = clientQuoteFull.GetQuoteAsync(txtQuotesFullInput.Text, "0"); var clientResolve = new ServiceResolve.P2GeoSoapClient("IP2GeoSoap"); taskResolve = clientResolve.ResolveIPAsync(txtResolveInput.Text, "0"); var clientTemperature = new ServiceTemperature.ConvertTemperatureSoapClient("ConvertTemperatureSoap"); taskTemperature = clientTemperature.ConvertTempAsync( Convert.ToDouble(txtTemperatureInput.Text), ServiceTemperature.TemperatureUnit.degreeCelsius, ServiceTemperature.TemperatureUnit.kelvin); var clientCurrency = new ServiceCurrency.CurrencyConvertorSoapClient("CurrencyConvertorSoap"); taskCurrency = clientCurrency.ConversionRateAsync(ServiceCurrency.Currency.USD, ServiceCurrency.Currency.JPY); var clientWeather = new ServiceWeather.GlobalWeatherSoapClient("GlobalWeatherSoap"); taskWeather = clientWeather.GetWeatherAsync(txtWeatherInput.Text, txtWeatherInput1.Text); }
private void GetStockValue(string stockSymbol, TextBox txtFullOutput, TextBox txtOutputDayHigh, TextBox txtOutputEarnPerShare, TextBox txtOutputFiftyTwoWeekRange) { var serviceClient = new ServiceReferenceQuotes.DelayedStockQuoteSoapClient("DelayedStockQuoteSoap"); ServiceReferenceQuotes.QuoteData quoteData = serviceClient.GetQuote(stockSymbol, "0"); txtFullOutput.Text = quoteData.LastTradeAmount.ToString(); txtOutputDayHigh.Text = quoteData.DayHigh.ToString(); txtOutputEarnPerShare.Text = quoteData.EarnPerShare.ToString(); txtOutputFiftyTwoWeekRange.Text = quoteData.FiftyTwoWeekRange; }