コード例 #1
0
ファイル: FormLogin.cs プロジェクト: badasintended/lks2017
        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();
        }
コード例 #2
0
 private void FormInputScore_FormClosed(object sender, FormClosedEventArgs e)
 {
     NavTeacher.GetInstance().Show();
 }
コード例 #3
0
 private void FormViewScheduleTeacher_FormClosed(object sender, FormClosedEventArgs e)
 {
     NavTeacher.GetInstance().Show();
 }