private void btnDang_nhap_Click(object sender, EventArgs e) { string uid = this.txtTen_dang_nhap.Text.Trim(); string pass = this.txtMat_khau.Text.Trim(); //string pass_mahoa = mahoa.mahoa(pass); //string group_list = ""; if (uid == "") { MessageBox.Show("Chưa nhập tên đăng nhập."); txtTen_dang_nhap.Focus(); return; } else if (pass == "") { MessageBox.Show("Chưa nhập mật khẩu."); txtMat_khau.Focus(); return; } DataTable userDt = userBus.XAC_THUC_USER(uid, pass); if (userDt.Rows.Count <= 0) { MessageBox.Show("Sai tên đăng nhập hoặc mật khẩu. Đề nghị kiểm tra lại!"); return; } else { Chinhanh cn = ChinhanhBUS.CN_theo_ma(userDt.Rows[0]["MACN"].ToString()); Thong_tin_dang_nhap.ten_dang_nhap = uid; Thong_tin_dang_nhap.mat_khau = pass; Thong_tin_dang_nhap.ma_cn = cn.ma_CN; Thong_tin_dang_nhap.ten_cn = cn.ten_CN; Thong_tin_dang_nhap.mst_cn = cn.mst; Thong_tin_dang_nhap.dia_chi_cn = cn.dia_chi; Thong_tin_dang_nhap.ten_cn_day_du = cn.ten_cn_day_du; Thong_tin_dang_nhap.ho_ten = userDt.Rows[0]["TENNV"].ToString(); Thong_tin_dang_nhap.maNV = userDt.Rows[0]["MANV"].ToString(); Thong_tin_dang_nhap.chuc_vu = userDt.Rows[0]["CHUCVU"].ToString(); Thong_tin_dang_nhap.ma_pb = userDt.Rows[0]["MAPB"].ToString(); Thong_tin_dang_nhap.tenPb = userDt.Rows[0]["TENPB"].ToString(); Thong_tin_dang_nhap.hs = Convert.ToBoolean(userDt.Rows[0]["HS"].ToString()); this.DialogResult = DialogResult.OK; this.Dispose(); } }