|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace CvrtC2Frnt
{
public partial class ShowTemperature : Form
{
public ShowTemperature(double Temperature, Boolean Fahrenheit, string SalesId)
{
InitializeComponent();
txtSourceTmp.Text = Temperature.ToString();
ConvertTemp.Faren = Fahrenheit;
ConvertTemp.sourceTemp = Temperature;
ConvertTemp.SalesId = SalesId;
}
private void btnConvert_Click(object sender, EventArgs e)
{
AxHelper axhlp = new AxHelper();
if (ConvertTemp.Faren == true)
{
txtDestTmp.Text = Convert.ToString(ConvertTemp.ConvertFahrenheitToCelsius(double.Parse(txtSourceTmp.Text)));
axhlp.SetAxRec(false, ConvertTemp.ConvertFahrenheitToCelsius(double.Parse(txtSourceTmp.Text)),ConvertTemp.SalesId);
}
if (ConvertTemp.Faren == false)
{
txtDestTmp.Text = Convert.ToString(ConvertTemp.ConvertCelsiusToFahrenheit(double.Parse(txtSourceTmp.Text)));
axhlp.SetAxRec(true, ConvertTemp.ConvertCelsiusToFahrenheit(double.Parse(txtSourceTmp.Text)), ConvertTemp.SalesId);
}
}
private void ShowTemperature_Load(object sender, EventArgs e)
{
if (ConvertTemp.Faren == true)
{
lblsrcTemp.Text = "Farenheit";
lbldesTemp.Text = "Celsius";
}
else
{
lblsrcTemp.Text = "Celsius";
lbldesTemp.Text = "Farenheit";
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.