private void LoadUser() { busGroup = new BUS.BUStblGROUP(); busGroupUser = new BUS.BUStblGROUPUSER(); busNhanVien = new BUS.BUSNHANVIEN(); busUser = new BUS.BUStblUSER(); busChucVu = new BUS.BUSCHUCVU(); var _User = from a in busNhanVien.LayTatCaNHANVIEN() join b in busUser.LayTatCatblUSER() on a.MANV equals b.USERID //join c in busGroupUser.LayTatCatblGROUPUSER() on b.USERID equals c.USERID //join d in busGroup.LayTatCatblGROUP() on c.GROUPID equals d.GROUPID join e in busChucVu.LayTatCaCHUCVU() on a.MACV equals e.MACV select new { HoTen = a.TENNV, UserID = b.USERID, Password = b.PASSWORDS, ChucVu = e.TENCV, //Group = d.GROUPNAME, LastLogin = b.LASTLOGIN, LastPassChanged = b.LASTCHANGEDPASS, //GroupID = d.GROUPID }; grdUser.DataSource = _User.ToList(); grdvUser.MoveFirst(); //Binding(); }
private void LoadNV() { busNhanVien = new BUS.BUSNHANVIEN(); busUser = new BUS.BUStblUSER(); var _NV = (from a in busNhanVien.LayTatCaNHANVIEN() where !(from b in busUser.LayTatCatblUSER() select b.USERID).Contains(a.MANV) select a); cmbMaNV.DataSource = _NV.ToList(); cmbMaNV.DisplayMember = "MANV"; cmbMaNV.ValueMember = "MANV"; }