示例#1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            //lay thong tin tu form cho et_DangNhap.
            ET_DangNhap = new ET_DangNhap(txtUser.Text, txtPass.Text, type);
            DataTable dt = bus_DangNhap.GetData(ET_DangNhap.MaNV
                                                , ET_DangNhap.PassWord
                                                , ET_DangNhap.PhanQuyen);

            //Check dt empty.
            if (dt.Rows.Count > 0)
            {
                MessageBox.Show("Dang nhap thanh cong");
                this.Hide();
                frmMain main = new frmMain();
                main.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Kiem tra lai ten dang nhap hoac mat khau");
            }
        }