コード例 #1
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            Teacher_Dashboard teacher = new Teacher_Dashboard(username);

            teacher.Show();
            this.Hide();
        }
コード例 #2
0
        private void btnLogin_Click_1(object sender, EventArgs e)
        {
            DatabaseManager db    = new DatabaseManager();
            string          check = db.checkLogin(txtUsername.Text, txtPassword.Text);

            switch (check)
            {
            case "Admin":
                Admin_Dashboard admin = new Admin_Dashboard();
                admin.Show();
                MessageBox.Show("Welcome  Administrator ", "Administrator", MessageBoxButtons.OK, MessageBoxIcon.None);
                this.Hide();
                break;

            case "Student":
                Student_Dashboard student = new Student_Dashboard(txtUsername.Text);
                student.Show();
                MessageBox.Show("Welcome  Student ", "Student", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Hide();
                break;

            case "Teacher":
                Teacher_Dashboard teacher = new Teacher_Dashboard(txtUsername.Text);
                teacher.Show();
                MessageBox.Show("Welcome  Faculty ", "Faculty", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Hide();
                break;
            }
        }