Пример #1
0
        /// <summary>
        /// This function is responsible for generating the actual data which will be displayed by the report
        /// </summary>
        protected void GenerateReportData()
        {
            // Create a string representation of the publisher filter list passed to us
            // We need to get the entire licensing information at this point
            FileSystemDAO lwDataAccess = new FileSystemDAO();
            DataTable     dataTable    = lwDataAccess.EnumerateFileSystemFiles(_filterFile);

            // Create a string representation of the publisher filter list passed to us
            // We need to get the entire licensing information at this point
            AssetGroup.GROUPTYPE displayType        = AssetGroup.GROUPTYPE.userlocation;
            DataTable            table              = new LocationsDAO().GetGroups(new AssetGroup(displayType));
            AssetGroup           _cachedAssetGroups = new AssetGroup(table.Rows[0], displayType);

            _cachedAssetGroups.Populate(true, _ignoreChildAssets, true);

            // Now apply the filter to these groups
            _cachedAssetGroups.ApplyFilters(_selectedGroups, _selectedAssets, _ignoreChildAssets);

            // Now that we have a definitive list of the assets (as objects) which we want to include in the
            // report we could really do with expanding this list so that ALL of the assets are in a single list
            // and not distributed among the publishers
            //AssetList _cachedAssetList = _cachedAssetGroups.GetAllAssets();
            //_selectedAssets = String.Empty;

            //foreach (Asset asset in _cachedAssetList)
            //{
            //    _selectedAssets += asset.Name + ";";
            //}

            //char[] charsToTrim = { ';' };
            //_selectedAssets.TrimEnd(charsToTrim);

            _selectedAssets = new AssetDAO().ConvertIdListToNames(new AssetDAO().GetSelectedAssets(), ',');

            ResetSelectedAssets();

            // ...then create InternetReportEntry objects for each returned and add to the view
            foreach (DataRow row in dataTable.Rows)
            {
                FileSystemFile file = new FileSystemFile(row);

                // Check for this being filtered by location/asset
                if (FilterRecord(file))
                {
                    AddRecord(file);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Load all of the File Systems audited for this asset
        /// </summary>
        /// <returns>Count of items added to the list</returns>
        public int PopulateFileSystem()
        {
            FileSystemDAO lwDataAccess = new FileSystemDAO();

            _listFolders = new FileSystemFolderList(lwDataAccess.EnumerateFileSystemFolders(AssetID), lwDataAccess.EnumerateFileSystemFiles(AssetID));
            return(_listFolders.Count);
        }