예제 #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;
        }
    }
예제 #2
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"); }
 }
예제 #3
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"); }
 }