Exemple #1
0
        private void buttonX1_Click(object sender, EventArgs e)
        {
            kiemtradangnhap bll_ktdn = new kiemtradangnhap();
            String          b        = "vui lòng không để trống";

            if (txt_user.Text.Length > 0 && txt_pass.Text.Length > 0)
            {
                if (bll_ktdn.dangnhap_cotontai(txt_user.Text.ToString(), txt_pass.Text.ToString()) == true)
                {
                    MessageBox.Show("thành công");
                    Formmain m = new Formmain();
                    m.Message = txt_user.Text.ToString();
                    m.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Tài khoản không tồn tại");
                }
            }
            else
            {
                if (txt_pass.Text.Length == 0)
                {
                    b += " mật khẩu";
                }
                else
                if (txt_user.Text.Length == 0)
                {
                    b += " tên đăng nhập";
                }
                MessageBox.Show(b);
            }
        }