private void ShowDocumentsWithoutAN() { if (InfoDetailsVM == null) { InfoDetailsVM = new PresentDetailVM(this, settings.presentation); } InfoDetailsVM.Documents = InfoDetailsVM.ConvertDocumentToDocumentVM(DocumentService.ReadDocuments(true)); }
private async void SearchDocument() { string searchQuery = await MessagesService.GetInput("ПОИСК", "Введите текст для поиска:"); if (!string.IsNullOrEmpty(searchQuery)) { var foundedDocuments = DocumentService.SearchDocuments(searchQuery); var foundedInTS = DocumentService.SearchDocumentsInTS(searchQuery); if (foundedInTS != null && foundedInTS.Count > 0) { foundedDocuments.AddRange(foundedInTS); } if (foundedDocuments != null && foundedDocuments.Count > 0) { if (InfoDetailsVM == null) { InfoDetailsVM = new PresentDetailVM(this, settings.presentation); } InfoDetailsVM.Documents.Clear(); var filteredDocuments = foundedDocuments; //.Where(f => f.serialNumber == null).ToList(); //var documentsWith = foundedDocuments.Where(f => f.serialNumber != null).ToList(); //if (filteredDocuments != null && documentsWith != null) filteredDocuments.AddRange(documentsWith); //else if (filteredDocuments == null && documentsWith != null) filteredDocuments = documentsWith; //if (documentsWith != null && documentsWith.Count > 0) DetailsVM.Documents = new ObservableCollection<DocumentVM>(DetailsVM.ConvertDocumentToDocumentVM(foundedDocuments)); if (filteredDocuments != null && filteredDocuments.Count > 0) { InfoDetailsVM.Documents = new ObservableCollection <DocumentVM>(InfoDetailsVM.ConvertDocumentToDocumentVM(filteredDocuments)); } } else { MessagesService.Show("ПОИСК ДОКУМЕНТОВ", "Результатов нет"); } } }