-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathUserHome.cs
104 lines (91 loc) · 2.92 KB
/
UserHome.cs
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PayrollSystem
{
public partial class UserHome : Form
{
public UserHome()
{
InitializeComponent();
UserNamee.Text = Login.Users;
SumSalary();
SumBonus();
}
SqlConnection Con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=D:\Trials\PayrollSystem\PayRollDB.mdf;Integrated Security=True;Connect Timeout=30");
private void pictureBox9_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void SumSalary()
{
Con.Open();
SqlDataAdapter sda = new SqlDataAdapter("select sum(EmpBalance) from SalaryTbl where EmpName='"+ UserNamee.Text + "'", Con);
DataTable dt = new DataTable();
sda.Fill(dt);
SalNum.Text = "Rs " + dt.Rows[0][0].ToString();
Con.Close();
}
private void SumBonus()
{
Con.Open();
SqlDataAdapter sda = new SqlDataAdapter("select sum(EmpBonus) from SalaryTbl where EmpName='" + UserNamee.Text + "'", Con);
DataTable dt = new DataTable();
sda.Fill(dt);
BonNum.Text = "Rs " + dt.Rows[0][0].ToString();
Con.Close();
}
private void pictureBox8_Click(object sender, EventArgs e)
{
Login Objl = new Login();
Objl.Show();
this.Hide();
}
private void Salic_Click(object sender, EventArgs e)
{
UserSal Objl = new UserSal();
Objl.Show();
this.Hide();
}
private void Sal_Click(object sender, EventArgs e)
{
UserSal Obj = new UserSal();
Obj.Show();
this.Hide();
}
private void Profile_Click(object sender, EventArgs e)
{
UserProfile Obj = new UserProfile();
Obj.Show();
this.Hide();
}
private void repic_Click(object sender, EventArgs e)
{
UserProfile Obj = new UserProfile();
Obj.Show();
this.Hide();
}
private void label1_Click(object sender, EventArgs e)
{
UserFeedback Obj = new UserFeedback();
Obj.Show();
this.Hide();
}
private void pictureBox3_Click(object sender, EventArgs e)
{
UserFeedback Obj = new UserFeedback();
Obj.Show();
this.Hide();
}
private void pictureBox2_Click(object sender, EventArgs e)
{
}
}
}