示例#1
0
        // Check if the username and password match with the list of users in the database
        public bool SignIn()
        {
            bool      flag = false;
            DBConnect dbc  = new DBConnect();                                    //Define a new connection to database
            string    role = dbc.VerifyUser(txtUserName.Text, txtPassword.Text); //sign the parameters to the method

            if (role == "Not found")
            {
                flag = false;
            }
            else
            {
                flag      = true;
                userrRole = role;
            }
            return(flag); //return the bool result
        }