コード例 #1
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            if (passwordTextBox.Text == "pass" && userTextBox.Text == "user") //&& adminCheckBox_CheckedChanged.IsChecked)
            {
                employee_Form newForm = new employee_Form();

                //this allows us to hide our forms from one another when one has been accessed.
                this.Hide();
                newForm.ShowDialog();
                this.Show();
                userTextBox.Clear();
                passwordTextBox.Clear();
            }


            if (passwordTextBox.Text == "admin" && userTextBox.Text == "admin")
            {
                admin_Form newForm = new admin_Form();

                //this allows us to hide our forms from one another when one has been accessed.
                this.Hide();
                newForm.ShowDialog();
                this.Show();
                userTextBox.Clear();
                passwordTextBox.Clear();
            }

            else
            {
                MessageBox.Show("Invalid User Name or Password", "BAD INPUT",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
 private void loginButton_Click(object sender, EventArgs e)
 {
     if (passwordTextBox.Text == "pass" && userTextBox.Text == "pass")
     {
         employee_Form newForm = new employee_Form();
         //this allows us to hide our forms from one another when one has been accessed.
         this.Hide();
         newForm.ShowDialog();
         this.Show();
         userTextBox.Clear();
         passwordTextBox.Clear();
     }
 }