Пример #1
0
        public DataTable Dangnhap(LoginObject lgo)

        {
            string    sql = "SELECT * FROM LOGIN WHERE  [USERNAME] =N'" + lgo.Username + "' AND [PASSWORD] =N'" + lgo.Password + "'";
            DataTable dt  = new DataTable();

            dt = db.Execute(sql);
            return(dt);
        }
Пример #2
0
        private void btnDn_Click(object sender, EventArgs e)
        {
            if (txtPass.Text == "" || txtUser.Text == "")
            {
                MessageBox.Show("Du lieu khong duoc bo trong ");
                return;
            }
            lgo = new LoginObject(txtUser.Text, txtPass.Text);
            DataTable dt = new DataTable();

            dt = lglg.Dangnhap(lgo);
            if (dt.Rows.Count > 0)
            {
                MessageBox.Show("Dang nhap tc");
                return;
            }
            else
            {
                MessageBox.Show("Dn that bai");
            }
        }