Example #1
0
        public void DeleteFolder(string name, string path, int page)
        {
            var folder = _folderContentFolderRepository.GetFolder(name, path);

            if (folder == null)
            {
                return;
            }

            for (var i = 1; i <= folder.NumOfPhysicalPages; i++)
            {
                var folderPage = _folderContentPageService.GetPhysicalFolderPage(folder, i);
                foreach (var folderContent in folderPage.Content)
                {
                    DeleteFolder(folderContent.Name, folderContent.Path, page);
                }
                _folderContentFolderRepository.DeleteFolder(folder.Name, folder.Path);
                _folderContentPageService.DeletePage(folder, i);
            }

            _folderContentFolderRepository.DeleteDirectory(folder.Name, folder.Path);

            var parent = GetParentFolder(folder);

            _folderContentPageService.RemoveFolderContentFromPage(parent, folder, page);
        }
        public void DeleteFile(string name, string path, int page)
        {
            var file = _folderContentFileRepository.GetFolderContentFile(name, path);

            if (file == null)
            {
                return;
            }
            ;

            _folderContentFileRepository.Delete(name, path);

            var parent = _folderContentFolderService.GetParentFolder(file);

            _folderContentPageService.RemoveFolderContentFromPage(parent, file, page);
        }