-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMenuForm.cs
156 lines (131 loc) · 3.93 KB
/
MenuForm.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
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;
namespace SMS_Server
{
public partial class MenuForm : Form
{
StudentClass student = new StudentClass();
public MenuForm()
{
InitializeComponent();
customDesign();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void PocetStd()
{
lblStdCount.Text = "Student count: " + student.totalStudent();
lblBoysCount.Text = "Boys count: " + student.totalStudentM();
lblGirlsCount.Text = "Girls count: " + student.totalStudentF();
}
private void customDesign()
{
panelStudents.Visible = false;
panelCourses.Visible = false;
panelmarks.Visible = false;
}
private void hideSubMenu()
{
if (panelStudents.Visible == true)
{
panelStudents.Visible = false;
}
if (panelCourses.Visible == true)
{
panelCourses.Visible = false;
}
if (panelmarks.Visible == true)
{
panelmarks.Visible = false;
}
}
private void showSubMenu(Panel panel)
{
if (panel.Visible == false)
{
hideSubMenu();
panel.Visible = true;
}
else
{
panel.Visible = false;
}
}
private void button_students_Click(object sender, EventArgs e)
{
showSubMenu(panelStudents);
}
private void btnCourses_Click(object sender, EventArgs e)
{
showSubMenu(panelCourses);
}
private void btnMarks_Click(object sender, EventArgs e)
{
showSubMenu(panelmarks);
}
private Form activeForm = null;
private void openChildForm(Form childForm)
{
if(activeForm != null)
activeForm.Close();
activeForm = childForm;
childForm.TopLevel = false;
childForm.FormBorderStyle = FormBorderStyle.None;
childForm.Dock = DockStyle.Fill;
panelMenu .Controls.Add(childForm);
panelMenu.Tag = childForm;
childForm.BringToFront();
childForm.Show();
}
private void btnRegistrace_Click(object sender, EventArgs e)
{
openChildForm(new NewStudent());
}
private void btnHome_Click(object sender, EventArgs e)
{
if (activeForm != null)
activeForm.Close();
PocetStd();
}
private void btnManageStudentu_Click(object sender, EventArgs e)
{
openChildForm(new ManageStudentForm());
}
private void btnExport_Click(object sender, EventArgs e)
{
openChildForm(new ExportStudent());
}
private void btnNewCourse_Click(object sender, EventArgs e)
{
openChildForm(new NewCourse());
}
private void button4_Click(object sender, EventArgs e)
{
openChildForm(new ManageCourseForm());
}
private void btnExportPr_Click(object sender, EventArgs e)
{
openChildForm(new ExportCourse());
}
private void btnNewMark_Click(object sender, EventArgs e)
{
openChildForm(new NewMark());
}
private void btnManageMarks_Click(object sender, EventArgs e)
{
openChildForm(new ManageMarksForm());
}
private void btnExportMarks_Click(object sender, EventArgs e)
{
openChildForm(new ExportMark());
}
}
}