/* * 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 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"); } }
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"); } }