public Service () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string HelloWorld() {
return "Hello World";
}
[WebMethod]
public string FahrenheitToCelsius(string Fahrenheit)
{
object fahr = null;
fahr = Fahrenheit.Replace(",", ".").Trim(' ');
if (fahr == "")
{
return "Error";
}
int returnVal = ((((Convert.ToInt32(fahr)) - 32) / 9) * 5);
return returnVal.ToString();
}
[WebMethod]
public string CelsiusToFahrenheit(string Celsius)
{
object cel = null;
cel = Celsius.Replace(",", ".").Trim(' ');
if (cel == "")
{
return "Error";
}
int returnVal = ((((Convert.ToInt32(cel)) * 9) / 5) + 32);
return returnVal.ToString();
}
}