DocumentManagerById Method (IEnumerableInt32) |
Namespace: Law.EdaIntegration.Document
public IEnumerable<IDocument> ById( IEnumerable<int> documentIds )
using Law.EdaIntegration; using Law.EdaIntegration.Case; using Law.EdaIntegration.Document; class Sample { public static void Main() { string connectionString = @"Data Source=localhost;Initial Catalog=EDA_Management;Integrated Security=False;User ID=myUserId;Password=myPassword"; EdaIntegration edaIntegration = new EdaIntegration(); edaIntegration.InitializeEnvironment(connectionString); Case edaCase = edaIntegration.Cases.OpenCaseByName("Case 1"); // Retrieve all documents that have exceptions int[] docIds = edaCase.Exceptions.All().Select(x => x.DocumentId).ToArray(); IDocument[] docs = edaCase.Documents.ById(docIds).ToArray(); // Print the document id and name Console.WriteLine("All documents with exceptions"); Console.WriteLine("============================="); foreach (IDocument doc in docs) { if (doc.DocumentType == DocumentType.EDocument) { Console.WriteLine("{0,6} {1, -25}", doc.Id, doc.FileName); } else if (doc.DocumentType == DocumentType.Email) { Console.WriteLine("{0,6} {1, -25}", doc.Id, doc.EmailMetadata.Subject); } } } } /* This example produces the following results: All documents with exceptions ====================================== 26 Doc1_metadata.docm 6 Empty Content.rtf 22 early.docx 15 lorem_pw.docx 3 Custom Encrypted.pptx 1 Background.jpg 7 nashvile march.jpg*/