private static void ListAllStoreDialogs(Organization organization) { Console.WriteLine("ListAllStoreDialogs"); string fileCabinetId = "00000000-0000-0000-0000-000000000000"; FileCabinet fileCabinet = organization.GetFileCabinetsFromFilecabinetsRelation().FileCabinet .FirstOrDefault(fc => fc.Id == fileCabinetId); if (fileCabinet == null) { Console.WriteLine("FileCabinet is null!"); } else { DialogInfos dialogInfos = fileCabinet.GetDialogInfosFromStoresRelation(); if (dialogInfos == null) { Console.WriteLine("DialogInfo is null!"); } else { Console.WriteLine("Store Dialogs"); dialogInfos.Dialog.ForEach(d => Console.WriteLine($"ID: {d.Id} - DisplayName: {d.DisplayName} - Type: {d.Type}")); } } }
private static void UploadDocument(Organization organization) { Console.WriteLine("UploadDocument"); string fileCabinetId = "00000000-0000-0000-0000-000000000000"; string dialogId = "00000000-0000-0000-0000-000000000000"; string fileInfoPath = @"C:\Temp\Test.pdf"; FileCabinet fileCabinet = organization.GetFileCabinetsFromFilecabinetsRelation().FileCabinet .FirstOrDefault(fc => fc.Id == fileCabinetId); if (fileCabinet == null) { Console.WriteLine("FileCabinet is null!"); } else { DialogInfos dialogInfos = fileCabinet.GetDialogInfosFromStoresRelation(); if (dialogInfos == null) { Console.WriteLine("DialogInfo is null!"); } else { DialogInfo dialog = dialogInfos.Dialog.FirstOrDefault(d => d.Id == dialogId); if (dialog == null) { Console.WriteLine("Dialog is null!"); } else { Document metaDocument = new Document() { Title = "My Test Document", Fields = new List <DocumentIndexField>() { //Create index value => field name, value DocumentIndexField.Create("NAME", "TestUpload") } }; dialog.EasyUploadDocument(new FileInfo[] { new FileInfo(fileInfoPath) }, metaDocument); } } } }