private void button1_Click(object sender, EventArgs e)
        {
            home hm = new home();

            hm.Tag = this;
            hm.Show(this);
            Hide();
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            //SqlConnection con = new SqlConnection(@"Data Source=DESKTOP-2CL7BNE;Initial Catalog=DataTravel;Integrated Security=True");
            //SqlDataAdapter sda = new SqlDataAdapter("SELECT COUNT(*) FROM admin WHERE username='******' and password='******'", con);

            ClassLogin d = new ClassLogin();

            if (this.tbpass.Text == d.Password && this.tbuname.Text == d.UserName)
            {
                home hm = new home();
                hm.Tag = this;
                hm.Show(this);
                Hide();
            }
            else
            {
                MessageBox.Show("Username atau Password salah");
            }

            //if (dt.Rows[0][0].ToString() == "1")
            //{
            //    home hm = new home();
            //    hm.Tag = this;
            //    hm.Show(this);
            //    Hide();
            //}
            //else
            //    MessageBox.Show("Invalid username or password");

            //int count = 0;

            //if (count == 1)
            //{
            //    home hm = new home();
            //    hm.Tag = this;
            //    hm.Show(this);
            //    Hide();
            //}
            //else if (count > 0)
            //{
            //    MessageBox.Show("duplicate username and password");
            //}
            //else
            //{
            //    MessageBox.Show( "username and password note correct");
            //}
        }