Beispiel #1
0
        private void login()
        {
            Database_Class database = new Database_Class();
            string         password = database.getLogins(UsernameField.Text);

            String entered_name = UsernameField.Text;
            String entered_pass = PasswordField.Text;

            if ((entered_name == "") || (entered_pass == ""))
            {
                IncorrectCredentials.Show();
            }
            else if (password.Equals(entered_pass))
            {
                //You may login
                //Hide the incorrect credentials message box
                IncorrectCredentials.Hide();
                //Create and show the main menu when login is successful
                Main_Menu _mainMenu = new Main_Menu();
                Hide();
                _mainMenu.Show();
            }
            else
            {
                //You may not login. Incorrect Credentials
                IncorrectCredentials.Show();
            }
        }
Beispiel #2
0
        private void LoginButton_Click(object sender, EventArgs e)
        {
            string password = getLogins(UsernameField.Text);

            String entered_name = UsernameField.Text;
            String entered_pass = PasswordField.Text;

            if (password.Equals(entered_pass))
            {
                //You may login
                //Hide the incorrect credentials message box
                IncorrectCredentials.Hide();
                MessageBox.Show("Login Successful");
            }
            else
            {
                //You may not login. Incorrect Credentials
                IncorrectCredentials.Show();
            }
        }