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 TaxCaculator
{
public partial class Tax_Calculator : Form
{
decimal totalTax = 0;
decimal totalTax1 = 0;
decimal totalTax2 = 0;
decimal totalTax3 = 0;
public Tax_Calculator()
{
InitializeComponent();
}
private void btnCalcTax_Click(object sender, EventArgs e)
{
this.property = property();
totalTax = totalTax1 + totalTax2 + totalTax3;
//now show totalTax
txtResult.Text = totalTax.ToString();
}
public void property()
{
decimal prop = decimal.Parse(txtProperty.Text);
if (prop > 5000 && prop <= 10000)
{
totalTax1 = 100;
}
else if (prop > 10000 && prop <= 50000)
{
totalTax1 = 200;
}
else if(prop > 50000);
{
totalTax1 = 500;
}
return totalTax1;
}
public void salary()
{
decimal sal = int.Parse(textsalary.Text);
if (sal < 5000);
{
totalTax2 = 20;
}
return totalTax2;
}
public void joutok()
{
decimal joutuk = int.Parse(txtJoutuk.Text);
if (joutuk > 0);
{
totalTax3 = 1000;
}
return totalTax3;
}
private void btnQuit_Click(object sender, EventArgs e)
{
// this.Close();
// Application.Exit();
if (MessageBox.Show("Are you sure to Quit?", "Exit", MessageBoxButtons.OKCancel) == DialogResult.OK)
{
Application.Exit();
}
}
private void txtProperty_TextChanged(object sender, EventArgs e)
{
}
private void textsalary_TextChanged(object sender, EventArgs e)
{
}
private void txtJoutuk_TextChanged(object sender, EventArgs e)
{
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace TaxCaculator
{
public partial class Tax_Calculator : Form
{
decimal totalTax = 0;
decimal totalTax1 = 0;
decimal totalTax2 = 0;
decimal totalTax3 = 0;
public Tax_Calculator()
{
InitializeComponent();
}
private void btnCalcTax_Click(object sender, EventArgs e)
{
this.property = property();
totalTax = totalTax1 + totalTax2 + totalTax3;
//now show totalTax
txtResult.Text = totalTax.ToString();
}
public void property()
{
decimal prop = decimal.Parse(txtProperty.Text);
if (prop > 5000 && prop <= 10000)
{
totalTax1 = 100;
}
else if (prop > 10000 && prop <= 50000)
{
totalTax1 = 200;
}
else if(prop > 50000);
{
totalTax1 = 500;
}
return totalTax1;
}
public void salary()
{
decimal sal = int.Parse(textsalary.Text);
if (sal < 5000);
{
totalTax2 = 20;
}
return totalTax2;
}
public void joutok()
{
decimal joutuk = int.Parse(txtJoutuk.Text);
if (joutuk > 0);
{
totalTax3 = 1000;
}
return totalTax3;
}
private void btnQuit_Click(object sender, EventArgs e)
{
// this.Close();
// Application.Exit();
if (MessageBox.Show("Are you sure to Quit?", "Exit", MessageBoxButtons.OKCancel) == DialogResult.OK)
{
Application.Exit();
}
}
private void txtProperty_TextChanged(object sender, EventArgs e)
{
}
private void textsalary_TextChanged(object sender, EventArgs e)
{
}
private void txtJoutuk_TextChanged(object sender, EventArgs e)
{
}
}
}