Example #1
0
    /*
     * This function handles the event of converting a temperature represented in
     * Fahrenheit to Celcius.
     */
    protected void f2cConvert_Click(object sender, EventArgs e)
    {
        Label4.Text = "";
        TempConvService.Service1Client f2cService = new TempConvService.Service1Client();
        try
        {
            int celcius = f2cService.f2c(int.Parse(fahrenheitValue.Text));
            celciusResult.Text = celcius.ToString();
        }

        catch (Exception exception)
        {
            Label4.Text = "Exception: " + exception.Message;
        }
    }
Example #2
0
    /*
     * This function handles the event of converting a temperature represented in
     * Celcius to Fahrenheit.
     */
    protected void c2fConvert_Click(object sender, EventArgs e)
    {
        Label3.Text = "";
        TempConvService.Service1Client c2fService = new TempConvService.Service1Client();
        try
        {
            int fahrenheit = c2fService.c2f(int.Parse(celciusValue.Text));
            fahrenheitResult.Text = fahrenheit.ToString();
        }

        catch (Exception exception)
        {
            Label3.Text = "Exception: " + exception.Message;
        }
    }
 protected void FarToCelBut_Click(object sender, EventArgs e)
 {
     TempConvService.Service1Client TempConvSerCliet = new TempConvService.Service1Client();
     try { Result.Text = TempConvSerCliet.f2c(int.Parse(FarInp.Text)).ToString(); }
     catch (Exception) { Console.WriteLine("Exception caught in FarToCelConv"); }
 }
 protected void CelToFarBut_Click(object sender, EventArgs e)
 {
     TempConvService.Service1Client TempConvSerCliet = new TempConvService.Service1Client();
     try { Result.Text = TempConvSerCliet.c2f(int.Parse(InpCel.Text)).ToString(); }
     catch (Exception) { Console.WriteLine("Exception caught in CelToFarConv"); }
 }
Example #5
0
 protected void FarToCelBut_Click(object sender, EventArgs e)
 {
     TempConvService.Service1Client TempConvSerCliet = new TempConvService.Service1Client();
     try { Result.Text = TempConvSerCliet.f2c(int.Parse(FarInp.Text)).ToString(); }
     catch (Exception) { Console.WriteLine("Exception caught in FarToCelConv"); }
 }
Example #6
0
 protected void CelToFarBut_Click(object sender, EventArgs e)
 {
     TempConvService.Service1Client TempConvSerCliet = new TempConvService.Service1Client();
     try { Result.Text = TempConvSerCliet.c2f(int.Parse(InpCel.Text)).ToString(); }
     catch (Exception) { Console.WriteLine("Exception caught in CelToFarConv"); }
 }