public override ViewModels.Announcement.Notification Read(long id) { var viewModel = base.Read(id); var documents = new List <DocumentHandle>(); viewModel.FolderHandle = new FolderHandle() { isEmpty = true, isLoading = false, itemParameterName = "notificationFolderId", tempFolderId = 0, }; if (viewModel.Folder > 0) { var tempDocumentTypeId = ParameterReader.ReadSystemParameter <long>("TempDocumentType"); viewModel.FolderHandle.folderId = viewModel.Folder; var documentList = _folderService.ListDocuments(viewModel.FolderHandle.folderId.Value); if (documentList.Count() > 0) { viewModel.FolderHandle.isEmpty = false; foreach (var document in documentList) { if (document.DocumentType != tempDocumentTypeId) { var documentHandle = new DocumentHandle { documentId = document.DocumentId, fileName = document.Name, isEmpty = false, isLoading = false, itemId = id, itemParameterName = "notificationFolderId", tempDocumentId = 0 }; documents.Add(documentHandle); } } } } viewModel.FolderHandle.documents = documents; return(viewModel); }