private void LoginButton_Click(object sender, EventArgs e) { if (UsernameBox.Text == "admin" && PasswordBox.Text == "admin") { new NavAdmin().Show(); Hide(); return; } Program.User = Program.Entities.Users .Where(u => u.username == UsernameBox.Text) .Where(u => u.password == PasswordBox.Text) .FirstOrDefault(); if (Program.User == null) { ErrorLabel.Text = "Try Again"; return; } switch (Program.User.role) { case "Teacher": NavTeacher.GetInstance().Show(); break; case "Student": NavStudent.GetInstance().Show(); break; } Hide(); }
private void FormInputScore_FormClosed(object sender, FormClosedEventArgs e) { NavTeacher.GetInstance().Show(); }
private void FormViewScheduleTeacher_FormClosed(object sender, FormClosedEventArgs e) { NavTeacher.GetInstance().Show(); }