private void LayDanhSachNguoiDung() { NguoiDungBUS itemBUS = new NguoiDungBUS(); BindingList <NguoiDungDTO> danhSach = itemBUS.LayDanhSach(); danhSach.AllowEdit = danhSach.AllowNew = danhSach.AllowRemove = true; gcDanhMucNguoiDung.DataSource = danhSach; ChucDanhBUS chucDanhBUS = new ChucDanhBUS(); BindingList <ChucDanhDTO> dsChucDanh = chucDanhBUS.LayDanhSach(); RepositoryItemLookUpEdit repositoryItem = new RepositoryItemLookUpEdit(); repositoryItem.DataSource = dsChucDanh; repositoryItem.PopulateColumns(); foreach (LookUpColumnInfo col in repositoryItem.Columns) { if (col.FieldName == "Id" || col.FieldName == "GhiChu") { col.Visible = false; } } repositoryItem.DisplayMember = "TenChucDanh"; repositoryItem.ValueMember = "Id"; gvDanhMucNguoiDung.Columns["IdChucDanh"].ColumnEdit = repositoryItem; }
private void LayDanhSachChucDanh() { ChucDanhBUS itemBUS = new ChucDanhBUS(); BindingList <ChucDanhDTO> danhSach = itemBUS.LayDanhSach(); danhSach.AllowEdit = danhSach.AllowNew = danhSach.AllowRemove = true; gcDanhMucChucDanh.DataSource = danhSach; }