示例#1
0
        protected async Task <Boolean> AddFormatToDocumentFromFile(
            string tenantId,
            String jobId,
            Client.Model.DocumentFormat format,
            string pathToFile,
            IDictionary <string, object> customData)
        {
            DocumentStoreServiceClient       client = GetDocumentStoreClient(tenantId);
            AddFormatFromFileToDocumentModel model  = new AddFormatFromFileToDocumentModel
            {
                CreatedById = this.PipelineId,
                JobId       = jobId,
                QueueName   = this.QueueName,
                Format      = format,
                PathToFile  = pathToFile
            };

            var response = await client.AddFormatToDocument(model, customData).ConfigureAwait(false);

            if (Logger.IsInfoEnabled)
            {
                Logger.Info($"Job {this.GetType()} Added format {format} to handle with job id {jobId}");
            }

            return(response != null);
        }
示例#2
0
        protected async Task <Boolean> AddFormatToDocumentFromObject(string tenantId,
                                                                     String queueName,
                                                                     String jobId,
                                                                     Client.Model.DocumentFormat format,
                                                                     Object obj,
                                                                     String originalFileName,
                                                                     IDictionary <string, object> customData)
        {
            DocumentStoreServiceClient         client = GetDocumentStoreClient(tenantId);
            AddFormatFromObjectToDocumentModel model  = new AddFormatFromObjectToDocumentModel
            {
                CreatedById   = this.PipelineId,
                JobId         = jobId,
                QueueName     = queueName,
                Format        = format,
                FileName      = originalFileName,
                StringContent = JsonConvert.SerializeObject(obj),
            };
            var response = await client.AddFormatToDocument(model, customData).ConfigureAwait(false);

            return(response != null);
        }