{
public partial
class WebForm1 : System.Web.UI.Page
{
protected void
Page_Load(object sender,
EventArgs e)
{
TextBox4.Focus();
}
protected void
Button1_Click(object sender,
EventArgs e)
{
if (string.IsNullOrEmpty(TextBox4.Text)
|| string.IsNullOrEmpty(TextBox1.Text))
{
Label5.Text =
"Please Enter Some Values"; Label5.ForeColor
= System.Drawing.Color.Red;
}
else
{
Tuple<double,
double> additionType =
new Tuple<double,
double>(double.Parse(TextBox4.Text),
double.Parse(TextBox1.Text));
Label5.Text =
"Addition Result is " + (additionType.Item1 +
additionType.Item2).ToString();
Label5.ForeColor = System.Drawing.Color.Green;
TextBox1.Text
= string.Empty; TextBox4.Text =
string.Empty;
}
}
protected void
Button2_Click(object sender,
EventArgs e)
{
if (string.IsNullOrEmpty(TextBox4.Text)
|| string.IsNullOrEmpty(TextBox1.Text))
{
Label5.Text =
"Please Enter Some Values";
Label5.ForeColor = System.Drawing.Color.Red;
}
else
{
Tuple<double,
double> substractionType =
new Tuple<double,
double>(double.Parse(TextBox4.Text),
double.Parse(TextBox1.Text));
Label5.Text =
"Substraction Result is " +
(substractionType.Item1 - substractionType.Item2).ToString();
Label5.ForeColor = System.Drawing.Color.Green;
TextBox1.Text
= string.Empty;
TextBox4.Text
= string.Empty;
}
}
protected void
Button3_Click(object sender,
EventArgs e)
{
if (string.IsNullOrEmpty(TextBox4.Text)
|| string.IsNullOrEmpty(TextBox1.Text))
{
Label5.Text =
"Please Enter Some Values"; Label5.ForeColor
= System.Drawing.Color.Red;
}
else
{
Tuple<double,
double> multiplicationType =
new Tuple<double,
double>(double.Parse(TextBox4.Text),
double.Parse(TextBox1.Text));
Label5.Text =
"Multiplication Result is " +
(multiplicationType.Item1 * multiplicationType.Item2).ToString();
Label5.ForeColor = System.Drawing.Color.Green;
TextBox1.Text = string.Empty; TextBox4.Text =
string.Empty;
}
}
protected void
Button4_Click(object sender,
EventArgs e)
{
if
(string.IsNullOrEmpty(TextBox4.Text) ||
string.IsNullOrEmpty(TextBox1.Text))
{
Label5.Text =
"Please Enter Some Values"; Label5.ForeColor
= System.Drawing.Color.Red;
}
else
{
Tuple<double,
double> divisionType =
new Tuple<double,
double>(double.Parse(TextBox4.Text),
double.Parse(TextBox1.Text));
Label5.Text =
"Division Result is " + (divisionType.Item1 /
divisionType.Item2).ToString();
Label5.ForeColor = System.Drawing.Color.Green;
TextBox1.Text
= string.Empty;
TextBox4.Text
= string.Empty;
}
}
}
}