<file_sep># TDNET

TD 6 : mise en place du web service http://www.dneonline.com/calculator.asmx

![alt text]( https://github.com/edossantos241/TDNET/tree/master/TD/Image/TD6.png)

<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RemotingObjects
{
    public interface IRemotingObjects
    {
        String sayHello(String name);
    }
}<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebApplicationCalculator.ServiceReference1;

namespace WebApplicationCalculator
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        private CalculatorSoapClient calculatorSoapReference;
        protected void Page_Load(object sender, EventArgs e)
        {
            calculatorSoapReference = new CalculatorSoapClient();
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (this.Add.Checked == true)
            {
                this.Label3.Text = calculatorSoapReference.Add(int.Parse(TextBox1.Text), int.Parse(this.TextBox2.Text)).ToString();
            } else if (this.Divide.Checked == true)
            {
                this.Label3.Text = calculatorSoapReference.Divide(int.Parse(TextBox1.Text), int.Parse(this.TextBox2.Text)).ToString();

            }
            else if (this.Multiply.Checked == true)
            {
                this.Label3.Text = calculatorSoapReference.Multiply(int.Parse(TextBox1.Text), int.Parse(this.TextBox2.Text)).ToString();

            }
            else
            {
                this.Label3.Text = calculatorSoapReference.Subtract(int.Parse(TextBox1.Text), int.Parse(this.TextBox2.Text)).ToString();

            }
        }

        protected void TextBox1_TextChanged(object sender, EventArgs e)
        {

        }

        protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
        {

        }
    }
}