Example #1
0
 private void LayDanhSachNhomNhaCungCap()
 {
     NhomNhaCungCapBUS itemBUS = new NhomNhaCungCapBUS();
     BindingList<NhomNhaCungCapDTO> danhSach = itemBUS.LayDanhSach();
     danhSach.AllowEdit = danhSach.AllowNew = danhSach.AllowRemove = true;
     gcDanhMucNhomNhaCungCap.DataSource = danhSach;
 }
Example #2
0
        private void LayDanhSachNhaCungCap()
        {
            NhaCungCapBUS itemBUS = new NhaCungCapBUS();
            BindingList<NhaCungCapDTO> danhSach = itemBUS.LayDanhSach();
            danhSach.AllowEdit = danhSach.AllowNew = danhSach.AllowRemove = true;
            gcDanhMucNhaCungCap.DataSource = danhSach;

            NhomNhaCungCapBUS nhomNhaCungCapBUS = new NhomNhaCungCapBUS();
            BindingList<NhomNhaCungCapDTO> dsNhomNhaCungCap = nhomNhaCungCapBUS.LayDanhSach();

            RepositoryItemLookUpEdit repositoryItem = new RepositoryItemLookUpEdit();
            repositoryItem.DataSource = dsNhomNhaCungCap;
            repositoryItem.PopulateColumns();
            foreach (LookUpColumnInfo col in repositoryItem.Columns)
            {
                if (col.FieldName == "Id" || col.FieldName == "GhiChu")
                    col.Visible = false;
            }
            repositoryItem.DisplayMember = "TenNhomNhaCungCap";
            repositoryItem.ValueMember = "Id";
            gvDanhMucNhaCungCap.Columns["IdNhomNhaCungCap"].ColumnEdit = repositoryItem;
        }