Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Assign this file to the specified application - note passing 0 will unassign the file
        /// </summary>
        /// <param name="applicationID"></param>
        public void Assign(int applicationID)
        {
            FileSystemDAO lwDataAccess = new FileSystemDAO();

            _assignApplicationID = applicationID;
            lwDataAccess.FileSystemFile_Assign(this);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Add this FileSystemFolder to the database - note we do not update ANY folders just ignore
        /// any which already have a database ID
        /// </summary>
        /// <returns></returns>
        public int Save()
        {
            FileSystemDAO lwDataAccess = new FileSystemDAO();

            if (FolderID != 0)
            {
                return(-1);
            }

            // Save this folder
            FolderID = lwDataAccess.FileSystemFolder_Add(this);

            // Iterate through any child folders and save them also remembering to set their parent ID to
            // point to us
            foreach (FileSystemFolder childFolder in _listFolders)
            {
                childFolder.ParentID = FolderID;
                childFolder.AssetID  = AssetID;
                childFolder.Save();
            }

            // Iterate through any child files and save them also remembering to set their parent ID to
            // point to us
            foreach (FileSystemFile childFile in _listFiles)
            {
                childFile.ParentID = FolderID;
                childFile.AssetID  = AssetID;
                childFile.Save();
            }

            return(0);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Add this FileSystemFolder to the database - note we do not update ANY folders just ignore
        /// any which already have a database ID
        /// </summary>
        /// <returns></returns>
        public int Save()
        {
            FileSystemDAO lwDataAccess = new FileSystemDAO();

            if (FileID != 0)
            {
                return(-1);
            }

            // Save this file
            FileID = lwDataAccess.FileSystemFile_Add(this);

            // ...and return
            return(0);
        }
Exemplo n.º 5
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);
                }
            }
        }