public IEnumerable <FileManager.DataStructure.Folder> GetParents(Guid websiteId) { try { var list = FileManagerComponent.Instance.FolderFacade.GetParents(true); var listfolder = new List <FileManager.DataStructure.Folder>(); var congressFoldersBo = new FolderBO(); foreach (var folder in list) { var congressFolders = congressFoldersBo.Get(this.ConnectionHandler, websiteId, folder.Id); if (congressFolders == null) { continue; } listfolder.Add(folder); } return(listfolder.OrderBy(folder => folder.Title)); } catch (KnownException knownException) { throw new KnownException(knownException.Message, knownException); } catch (Exception ex) { throw new KnownException(ex.Message, ex); } }
public override bool Delete(params object[] keys) { try { this.ConnectionHandler.StartTransaction(IsolationLevel.ReadUncommitted); this.FileManagerConnection.StartTransaction(IsolationLevel.ReadUncommitted); var folderBo = new FolderBO(); var obj = folderBo.Get(this.ConnectionHandler, keys); if (!folderBo.Delete(this.ConnectionHandler, keys)) { throw new Exception("خطایی در حذف پوشه فایل وجود دارد"); } if (!FileManagerComponent.Instance.FolderTransactionalFacade(this.FileManagerConnection).Delete(obj.FolderId)) { throw new Exception("خطایی در حذف پوشه فایل وجود دارد"); } this.ConnectionHandler.CommitTransaction(); this.FileManagerConnection.CommitTransaction(); return(true); } catch (KnownException knownException) { this.ConnectionHandler.RollBack(); this.FileManagerConnection.RollBack(); throw new KnownException(knownException.Message, knownException); } catch (Exception ex) { this.ConnectionHandler.RollBack(); this.FileManagerConnection.RollBack(); throw new KnownException(ex.Message, ex); } }