-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfrmSalaryCalc.aspx.cs
More file actions
151 lines (132 loc) · 4.85 KB
/
frmSalaryCalc.aspx.cs
File metadata and controls
151 lines (132 loc) · 4.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace EmpSalaryCalc
{
public partial class frmSalaryCalc : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Panel4.Visible = false;
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
String name = txtName.Text;
String deg = ddl_Designation.ToString();
int days = int.Parse(txtDays.Text);
int salary = int.Parse( txtBasicSalary.Text);
int ta = int.Parse( txtTA.Text);
int da = int.Parse(txtDA.Text);
int tax = int.Parse(txtTAX.Text);
//Employee e1 = new Employee();
//e1.getDetails(name,deg,days,salary,ta,da,tax);
float daysalary = salary / 365;
float dayta = ta / 365;
float dayda = da / 365;
float netsalary;
float calcTax = (tax * salary) / 100;
float daytax = calcTax / 365;
netsalary = (days * (daysalary + dayta + dayda - daytax));
txtNetSalary.Text = netsalary.ToString();
Panel4.Visible = true;
lblName.Text = txtName.Text;
lblDesignation.Text = ddl_Designation.SelectedValue;
lblBSalary.Text = txtBasicSalary.Text;
lblTA.Text = txtTA.Text;
lblDA.Text = txtDA.Text;
lblTAX.Text = txtTAX.Text+"%";
lblWDays.Text = txtDays.Text;
lblNetSalary.Text = txtNetSalary.Text;
}
protected void ddl_Designation_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddl_Designation.SelectedIndex == 0)
{
LabelddlError.Text = "* Please Select Designation";
txtBasicSalary.Text = " ";
}
if (ddl_Designation.SelectedItem.Text == "HOS")
{
txtBasicSalary.Text = 350000 + "";
txtTA.Text = 5000 + "";
txtDA.Text = 2000 + "";
txtTAX.Text = 30 + "";
LabelddlError.Text = " ";
}
if (ddl_Designation.SelectedItem.Text == "HOD")
{
txtBasicSalary.Text = 30000 + "";
txtTA.Text = 4000 + "";
txtDA.Text = 1800 + "";
txtTAX.Text = 25 + "";
LabelddlError.Text = " ";
}
if (ddl_Designation.SelectedItem.Text == "Incharge")
{
txtBasicSalary.Text = 280000 + "";
txtTA.Text = 3500 + "";
txtDA.Text = 1500 + "";
txtTAX.Text = 20 + "";
LabelddlError.Text = " ";
}
if (ddl_Designation.SelectedItem.Text == "Professor")
{
txtBasicSalary.Text = 250000 + "";
txtTA.Text = 2000 + "";
txtDA.Text = 1200 + "";
txtTAX.Text = 18 + "";
LabelddlError.Text = " ";
}
if (ddl_Designation.SelectedItem.Text == "Lab Assistant")
{
txtBasicSalary.Text = 180000 + "";
txtTA.Text = 2500 + "";
txtDA.Text = 1000 + "";
txtTAX.Text = 12 + "";
LabelddlError.Text = " ";
}
if (ddl_Designation.SelectedItem.Text == "Helper")
{
txtBasicSalary.Text = 12000 + "";
txtTA.Text = 0 + "";
txtDA.Text = 1000 + "";
txtTAX.Text = 10 + "";
LabelddlError.Text = " ";
}
}
protected void txtDays_TextChanged(object sender, EventArgs e)
{
int[] lastDays = {29,30,31 };
foreach (int s in lastDays)
{
if (s.Equals(txtDays.Text))
{
Label16.Text = "Per 1 Month";
}
}
}
protected void btnClear_Click(object sender, EventArgs e)
{
txtName.Text = " ";
ddl_Designation.SelectedIndex = 0;
txtBasicSalary.Text = " ";
txtDays.Text = " ";
txtDA.Text = " ";
txtTA.Text = " ";
txtTAX.Text = " ";
txtNetSalary.Text = " ";
Panel4.Visible = false;
}
protected void btnBack_Click(object sender, EventArgs e)
{
Response.Redirect("frmHome.aspx");
}
protected void btnExit_Click(object sender, EventArgs e)
{
Response.Redirect("index.aspx");
}
}
}