Exemplo n.º 1
0
        public void LoginButton_Click(object sender, EventArgs e)
        {
            Username = UserNameTextBox.Text;
            Password = PasswordTextBox.Text;
            FakeAppUserRepository fr = new FakeAppUserRepository();

            credentialsAccepted = fr.Login(Username, Password);
            Properties.Settings.Default.Username = Username;
            if (credentialsAccepted == true)
            {
                this.Hide();
                FormSelectProject startingproj = new FormSelectProject("Login");
                startingproj.Show();
            }

            else

            {
                System.Windows.Forms.MessageBox.Show("Incorrect Username/Password");
                Application.Exit();
            }
        }
Exemplo n.º 2
0
        public void LoginButton_Click(object sender, EventArgs e)       // Reacts upon fulfilling or failing credentials conditions, intent to Login iwith proper credentials
        {
            Username = UserNameTextBox.Text;
            Password = PasswordTextBox.Text;
            FakeAppUserRepository fr = new FakeAppUserRepository();

            credentialsAccepted = fr.Login(Username, Password);     // Confirms login info is correct
//           System.Windows.Forms.MessageBox.Show(credentialsAccepted.ToString());
//            System.Windows.Forms.MessageBox.Show(Username);
//            System.Windows.Forms.MessageBox.Show(Password);
            if (credentialsAccepted == true)
            {
                this.Hide();                  // Login form goes away for main form to take center stage
                MainForm ss = new MainForm(); // If login info is correct, opens MainForm
                ss.Show();
            }

            else

            {
                System.Windows.Forms.MessageBox.Show("Incorrect Username/Password");        // If incorrect user/pass, display text detailing wrong login
            }
        }