示例#1
0
        private void SearchDocument(int folderId)
        {
            try
            {
                var folderApi   = new IO.Swagger.Api.FoldersApi(Configuration);
                var searchV2Api = new IO.Swagger.Api.SearchesV2Api(Configuration);

                var baseSelect = searchV2Api.SearchesV2GetSelect();
                baseSelect.MaxItems = 0;

                var values   = folderApi.FoldersGetDocumentsById(folderId, baseSelect);
                var profiles = new DataTable();

                foreach (var columnSearchResult in values.First().Columns)
                {
                    profiles.Columns.Add(columnSearchResult.Label);
                }

                foreach (var rowSearchResult in values)
                {
                    profiles.Rows.Add(rowSearchResult.Columns.Select(i => i.Value).ToArray());
                }

                folderDocumentGrid.DataSource = profiles;
            }
            catch (Exception exception)
            {
                errorLabel.Text = exception.Message;
            }
        }