void isLogin() { D_NHOMQUYEN nqb = new D_NHOMQUYEN(); D_DAILY nvb = new D_DAILY(); List <O_DAILY> nvo = nvb.NhanVien(txtUserName.Text, TMD5.TMd5Hash(txtPassword.Text)); if (nvo.Count == 1) { if (!nvo[0].Nghi) { RegistryKey key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\THCRM", true); if (key == null) { key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\THCRM"); } if (chk.Checked) { key.SetValue("cmra", txtUserName.Text); key.SetValue("cmrp", txtPassword.Text); } else { key.SetValue("cmra", string.Empty); key.SetValue("cmrp", string.Empty); } key.Close(); DuLieuTaoSan.NV = nvo[0]; DuLieuTaoSan.Q = (nvo[0].TenDangNhapCty.ToLower().Equals("itadmin")) ? nqb.QuyenAdmin() : nqb.LayQuyenNhanVien(nvo[0].ChinhSach); frmChinh f = new frmChinh(); XuLyGiaoDien.SplashScreen(f); TopMost = false; Hide(); f.Show(this); } else { XtraMessageBox.Show("Tài khoản đã bị khóa vui lòng liên hệ ban quản lý...", "T-CMR", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { XtraMessageBox.Show("Sai tên đăng nhập hoặc mật khẩu...", "T-CMR", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void frmKhachLe_Load(object sender, EventArgs e)// { nhanVienOBindingSource.DataSource = _DaiLyD.NhanVien(); DuLieu(); XuLyGiaoDien.OpenForm(this); }