-
Notifications
You must be signed in to change notification settings - Fork 0
/
Faculty.cs
165 lines (121 loc) · 3.91 KB
/
Faculty.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
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace PROJECTDB
{
public partial class Faculty : Form
{
public Faculty()
{
InitializeComponent();
}
private void Faculty_Load(object sender, EventArgs e)
{
}
private void Label1_Click(object sender, EventArgs e)
{
}
private void Label7_Click(object sender, EventArgs e)
{
}
private void Button1_Click(object sender, EventArgs e)
{
int val = 0;
Int32.TryParse(textBox9.Text, out val);
if (val >= 10 || val <= 0)
{
DialogResult result = MessageBox.Show("Please enter a valid Faculty ID", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
if (result == DialogResult.OK)
{
student_details gg = new student_details();
}
else
{
this.Close();
}
}
else
{
SqlConnection conn = new SqlConnection(@"Server=DESKTOP-TP8ATKN;Database=myschool;Trusted_Connection=Yes");
using (SqlCommand cmd = new SqlCommand("select * from faculty where idfaculty='" + textBox9.Text.Trim() + "'"))
{
cmd.CommandType = CommandType.Text;
cmd.Connection = conn;
conn.Open();
using (SqlDataReader sdr = cmd.ExecuteReader())
{
sdr.Read();
textBox1.Text = sdr["FirstName"].ToString();
textBox5.Text = sdr["LastName"].ToString();
textBox2.Text = sdr["Salary"].ToString();
textBox6.Text = sdr["Qualification"].ToString();
textBox8.Text = sdr["EmergencyContact"].ToString();
textBox4.Text = sdr["ContactNumber"].ToString();
textBox3.Text = sdr["Gender"].ToString();
textBox7.Text = sdr["Address"].ToString();
}
conn.Close();
}
}
}
private void Button2_Click(object sender, EventArgs e)
{
this.Hide();
}
private void Label2_Click(object sender, EventArgs e)
{
}
private void Label3_Click(object sender, EventArgs e)
{
}
private void Label4_Click(object sender, EventArgs e)
{
}
private void Label5_Click(object sender, EventArgs e)
{
}
private void Label6_Click(object sender, EventArgs e)
{
}
private void TextBox1_TextChanged(object sender, EventArgs e)
{
}
private void TextBox2_TextChanged(object sender, EventArgs e)
{
}
private void TextBox3_TextChanged(object sender, EventArgs e)
{
}
private void TextBox4_TextChanged(object sender, EventArgs e)
{
}
private void TextBox5_TextChanged(object sender, EventArgs e)
{
}
private void TextBox6_TextChanged(object sender, EventArgs e)
{
}
private void TextBox7_TextChanged(object sender, EventArgs e)
{
}
private void Label9_Click(object sender, EventArgs e)
{
}
private void TextBox8_TextChanged(object sender, EventArgs e)
{
}
private void Label8_Click(object sender, EventArgs e)
{
}
private void TextBox9_TextChanged(object sender, EventArgs e)
{
}
}
}