-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExamHomeForm.cs
47 lines (46 loc) · 1.25 KB
/
ExamHomeForm.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
using ExamProj.Class;
using System;
namespace ExamProj
{
public partial class ExamHomeForm : DevExpress.XtraEditors.XtraForm
{
public User user = new User();
public ExamHomeForm(User user)
{
InitializeComponent();
this.user = user;
welcomeLbl.Text = $"Welcome {user.Username}!";
if (!user.IsTeacher)
{
userBtn.Enabled = false;
questionBtn.Enabled = false;
}
}
private void userBtn_Click(object sender, EventArgs e)
{
ExamUserGridForm form = new ExamUserGridForm();
form.ShowDialog();
}
private void questionBtn_Click(object sender, EventArgs e)
{
ExamQuestionGridForm form = new ExamQuestionGridForm();
form.ShowDialog();
}
private void examBtn_Click(object sender, EventArgs e)
{
ExamMainForm form = new ExamMainForm(user);
try
{
form.ShowDialog();
}
catch (Exception)
{
return;
}
}
private void logOutBtn_Click(object sender, EventArgs e)
{
Close();
}
}
}