Beispiel #1
0
        private void b_submit_Click(object sender, EventArgs e)
        {
            string r = c_role.Text;     //String role is being read from the form
            string u = t_username.Text; //String username is being read from the form
            string p = t_password.Text; //String password is being read from the form
            bool   flag;                // Flag holds the success state of login form validation

            //this.Hide();
            Form1 current = this;

            validationOfForms validForm = new validationOfForms(); //Class which validates the user enetered data

            flag = validForm.validateLoginForm(r, u, p, current);  // Function of Class ValidationForms is used

            if (flag)
            {
                current.Hide();
                // MessageBox.Show("Login successful");
            }
            else
            {
                MessageBox.Show("Login Failed. Try again");
            }
        }