Beispiel #1
0
        //TRYIT FOR ELECTIVE SERVICE #2
        protected void GetTransactionPriceBtn_Click(object sender, EventArgs e)
        {
            //open the proxy
            StockRelatedWebServices.Service1Client proxy = new StockRelatedWebServices.Service1Client();
            //store variables
            string stockSymbol = TransactionInput1.Value;
            int    numShares   = Convert.ToInt32(TransactionInput2.Value);
            //calculate transaction price
            decimal transactionPrice = proxy.CalcTransactionPrice(stockSymbol, numShares);

            //display transaction price
            TransactionPriceTextBox.Text = string.Format("{0:C}", transactionPrice);
            //close the client
            proxy.Close();
        }