private void bt_dn_Click(object sender, EventArgs e) { dt.Clear(); dt = cl.dangnhap(txt_tk.Text, txt_mk.Text); if (!string.IsNullOrEmpty(txt_tk.Text)) { if (!string.IsNullOrEmpty(txt_mk.Text)) { if (dt.Rows[0]["errcode"].ToString() == "0") { qlks.nguoi_dn = txt_tk.Text; tinhtien.nv = txt_tk.Text; txt_mk.Text = ""; txt_tk.Text = ""; txt_tk.Focus(); this.Hide(); qlks ql = new qlks(); ql.ShowDialog(); } else { string kt = Checkkiemtradangnhap.ktdangnhap(txt_tk.Text, txt_mk.Text); if (kt == "1") { MessageBox.Show("Sai Tài Khoản Hoặc Mật khẩu", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } txt_tk.Text = ""; txt_mk.Text = ""; txt_tk.Focus(); } } else { string kt = Checkkiemtradangnhap.ktdangnhap(txt_tk.Text, txt_mk.Text); if (kt == "2") { MessageBox.Show("Nhập Mật khẩu", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } txt_mk.Focus(); } } else { string kt = Checkkiemtradangnhap.ktdangnhap(txt_tk.Text, txt_mk.Text); if (kt == "2") { MessageBox.Show("Nhập Tài Khoản", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } txt_tk.Focus(); } }
private void bt_dn_Click(object sender, EventArgs e) { dt.Clear(); dt = cl.dangnhap(txt_tk.Text, txt_mk.Text); if (!string.IsNullOrEmpty(txt_tk.Text)) { if (!string.IsNullOrEmpty(txt_mk.Text)) { if (dt.Rows[0]["errcode"].ToString() == "0") { qlks.nguoi_dn = txt_tk.Text; tinhtien.nv = txt_tk.Text; txt_mk.Text = ""; txt_tk.Text = ""; txt_tk.Focus(); this.Hide(); qlks ql = new qlks(); ql.ShowDialog(); } else { lblhienthi.Text = "Sai Tên Đăng Nhập Hoặc Mật Khẩu !!!"; txt_tk.Text = ""; txt_mk.Text = ""; txt_tk.Focus(); } } else { lblhienthi.Text = "Chưa Nhập Mật Khẩu !!!"; txt_mk.Focus(); } } else { lblhienthi.Text = "Chưa Nhập Tên Đăng Nhập !!!"; txt_tk.Focus(); } }