protected void btnDivide_Click(object sender, EventArgs e)
        {
            int numerator   = Convert.ToInt32(txtNumerator.Text);
            int denominator = Convert.ToInt32(txtDenominator.Text);

            CalculatorService.CalculatorServiceClient client =
                new CalculatorService.CalculatorServiceClient();
            lblResult.Text = client.Divide(numerator, denominator).ToString();
        }
Esempio n. 2
0
 protected void btnDivide_Click(object sender, EventArgs e)
 {
     CalculatorClient.CalculatorService.CalculatorServiceClient client = new CalculatorService.CalculatorServiceClient();
     try
     { lblMessage.Text = client.Divide(Convert.ToInt32(txtNumerator.Text), Convert.ToInt32(txtDenomirator.Text)).ToString(); }
     catch (FaultException faultException)
     {
         lblMessage.Text = faultException.Message;
         //Log exception
     }
 }
Esempio n. 3
0
 protected void btnDivide_Click(object sender, EventArgs e)
 {
     try
     {
         int numerator   = Convert.ToInt32(txtNumerator.Text);
         int denominator = Convert.ToInt32(txtDenominator.Text);
         CalculatorService.CalculatorServiceClient client =
             new CalculatorService.CalculatorServiceClient();
         lblResult.Text = client.Divide(numerator, denominator).ToString();
     }
     catch (FaultException faultexception)
     {
         lblResult.Text = faultexception.Message;
     }
 }
        private void divide_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var numerator   = Convert.ToInt32(numeratorFiled.Text);
                var denominator = Convert.ToInt32(denominatorField.Text);
                resultText.Text = client.Divide(numerator, denominator).ToString();
            }
            //catch(FaultException<CalculatorService.DivideByZeroFault> faultException)
            //{
            //    resultText.Text = faultException.Detail.Error +"-"+ faultException.Detail.Details;
            //}

            catch (FaultException faultException)
            {
                resultText.Text = faultException.Message;
            }
        }
Esempio n. 5
0
 protected void btnDivide_Click(object sender, EventArgs e)
 {
     CalculatorClient.CalculatorService.CalculatorServiceClient client = new CalculatorService.CalculatorServiceClient();
     lblMessage.Text = client.Divide(Convert.ToInt32(txtNumerator.Text), Convert.ToInt32(txtDenomirator.Text)).ToString();
 }