コード例 #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            LoginController login_controller = new LoginController();

            if (!GLOBALS.isAlphaNumeric(txtUsername.Text) ||
                !GLOBALS.isAlphaNumeric(txtPassword.Text))
            {
                return;
            }

            if (login_controller.validateLogin(txtUsername.Text, txtPassword.Text))
            {
                MessageBox.Show("Success!");
                this.Hide();
                if (Member.membership_type == "administrator" || Member.membership_type == "data entry operator")
                {
                    HomePageAdmin homepage_admin = new HomePageAdmin();
                    homepage_admin.ShowDialog();
                }
                else if (Member.membership_type == "student" || Member.membership_type == "faculty")
                {
                    HomePage homepage = new HomePage();
                    homepage.ShowDialog();
                }

                txtUsername.Text = "";
                txtPassword.Text = "";
                this.Show();
            }
            else
            {
                MessageBox.Show("Your username and password are not match!");
            }
        }
コード例 #2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            LoginController login_controller = new LoginController();

            if (!GLOBALS.isAlphaNumeric(txtUsername.Text)
                || !GLOBALS.isAlphaNumeric(txtPassword.Text))
            {
                return;
            }

            if (login_controller.validateLogin(txtUsername.Text, txtPassword.Text))
            {
                MessageBox.Show("Success!");
                this.Hide();
                if (Member.membership_type == "administrator" || Member.membership_type == "data entry operator")
                {
                    HomePageAdmin homepage_admin = new HomePageAdmin();
                    homepage_admin.ShowDialog();
                }
                else if (Member.membership_type == "student" || Member.membership_type == "faculty")
                {
                    HomePage homepage = new HomePage();
                    homepage.ShowDialog();
                }

                txtUsername.Text = "";
                txtPassword.Text = "";
                this.Show();
            }
            else
            {
                MessageBox.Show("Your username and password are not match!");
            }
        }