Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            var loginScreen = new Logins();

            loginScreen.username = textUsername.Text;
            loginScreen.password = textPassword.Text;
            var returnVal = loginScreen.GetUsernamePass(); //it returns as dataTable

            if (returnVal.Rows[0][0].ToString() == "1")
            {
                this.Hide();
                Dashboard dash = new Dashboard();
                dash.Show();
            }
            else
            {
                MessageBox.Show("Invalid Username or Password", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }