-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStudentPanel.cs
153 lines (129 loc) · 4.57 KB
/
StudentPanel.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
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 EducationManagementSystem
{
public partial class StudentPanel : Form
{
SqlConnection con = new SqlConnection(@"Data Source=DESKTOP-OUS5TJV\SQLEXPRESS;database=OOPProject;UID=helloworld;password=hello");
int stdid,cid,t_id;
string name,course,teacher;
public StudentPanel()
{
}
public StudentPanel(int stdid)
{
InitializeComponent();
this.stdid = stdid;
con.Open();
SqlCommand cmd = new SqlCommand("select s.name,c.c_id,c.course_name,t.id,t.name from student s join course c on s.c_id=c.c_id join teacher t on t.c_id=c.c_id where s.Id=@id", con);
cmd.Parameters.AddWithValue("@id", stdid);
SqlDataAdapter sad = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
sad.Fill(dt);
this.name=dt.Rows[0][0].ToString();
this.cid = (int)dt.Rows[0][1];
this.course = dt.Rows[0][2].ToString();
this.t_id = (int)dt.Rows[0][3];
this.teacher = dt.Rows[0][4].ToString();
con.Close();
// MessageBox.Show(name+cid.ToString()+course+t_id.ToString()+teacher);
}
bool mnuExpanded = false;
private void MouseDetect_Tick(object sender, EventArgs e)
{
if (!bunifuTransition1.IsCompleted) return;
if (panel1.ClientRectangle.Contains(PointToClient(Control.MousePosition)))
{
if (!mnuExpanded)
{
mnuExpanded = true;
panel1.Visible = false;
panel1.Width = 200;
bunifuTransition1.Show(panel1);
}
}
else
{
if (mnuExpanded)
{
mnuExpanded = false;
panel1.Visible = false;
panel1.Width = 52;
bunifuTransition1.Show(panel1);
}
}
}
private void Logout_Button_Click(object sender, EventArgs e)
{
Login lg = new Login();
lg.Show();
this.Hide();
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
}
private void Dashboard_Button_Click(object sender, EventArgs e)
{
dashboard_StudentPanel1.getlabel(stdid);
dashboard_StudentPanel1.Show();
cF_StudentPanel1.Hide();
sA_Student1.Hide();
marks_Student1.Hide();
}
private void StudentPanel_Load(object sender, EventArgs e)
{
dashboard_StudentPanel1.getlabel(stdid);
dashboard_StudentPanel1.Show();
cF_StudentPanel1.Hide();
sA_Student1.Hide();
marks_Student1.Hide();
}
private void panel2_Paint(object sender, PaintEventArgs e)
{
}
private void CF_Button_Click(object sender, EventArgs e)
{
SqlCommand cmd = new SqlCommand();
cF_StudentPanel1.getdata(stdid, t_id, cid, teacher, course);
cF_StudentPanel1.Show();
dashboard_StudentPanel1.Hide();
sA_Student1.Hide();
marks_Student1.Hide();
}
private void cF_StudentPanel1_Load(object sender, EventArgs e)
{
}
private void marks_Student1_Load(object sender, EventArgs e)
{
}
private void SAttendance_Button_Click(object sender, EventArgs e)
{
cF_StudentPanel1.Hide();
dashboard_StudentPanel1.Hide();
sA_Student1.Show();
marks_Student1.Hide();
}
private void Marks_Button_Click(object sender, EventArgs e)
{
cF_StudentPanel1.Hide();
dashboard_StudentPanel1.Hide();
sA_Student1.Hide();
marks_Student1.getdata(stdid, cid,course);
marks_Student1.Show();
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private void dashboard_StudentPanel1_Load(object sender, EventArgs e)
{
}
}
}