Exemplo n.º 1
0
 private void btnDangNhap_Click(object sender, EventArgs e)
 {
     if (txtUsername.Text != "" && txtPassword.Text != "")
     {
         DataTable dtNhanVien = busNhanVien.GetOfUsernameAndPassword(txtUsername.Text, txtPassword.Text);
         if (dtNhanVien.Rows.Count > 0)
         {
             DataRow row = dtNhanVien.Rows[0];
             Form    frm = new frmMain(row);
             this.Hide();
             frm.ShowDialog();
             this.Close();
         }
         else
         {
             MessageBox.Show("Đăng nhập không thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     else
     {
         MessageBox.Show("Vui lòng nhập đầy đủ thông tin!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }