protected int GetProductCount(object dataItem) { Manufacturer m = (Manufacturer)dataItem; if (_ProductCounts.ContainsKey(m.Id)) { return(_ProductCounts[m.Id]); } int count = ProductDataSource.CountForManufacturer(m.Id); _ProductCounts[m.Id] = count; return(count); }
protected bool HasProducts(object dataItem) { Manufacturer m = (Manufacturer)dataItem; return(ProductDataSource.CountForManufacturer(m.Id) > 0); }