コード例 #1
0
        protected void SubmitButton_Click4(object sender, EventArgs e)
        {
            client2 = new ivanService.Assignment6ServiceClient();

            String[] Topics = { TopicTextBox.Text };
            string[] response;
            try
            {
                response          = client2.NewsFocus(Topics);
                theNewsLabel.Text = string.Join("\n\n", response);
                client2.Close();
            }
            catch (Exception stockException)
            {
                theNewsLabel.Text = "Be Sure to enter a topic!";
                client2.Close();
            }
        }
コード例 #2
0
        protected void SubmitButton_Click3(object sender, EventArgs e)
        {
            client2 = new ivanService.Assignment6ServiceClient();


            int response;

            try
            {
                var amount     = Int32.Parse(amountTextBox.Text);
                var conversion = (sender as Button).ID;
                response             = client2.currentConversionService(amount, conversion);
                conversionLabel.Text = amount + " USD is " + response + " " + conversion;
                client2.Close();
            }
            catch (Exception stockException)
            {
                conversionLabel.Text = "Please Enter a Number";
                client2.Close();
            }
        }