public SaveTranscriptionResponse SaveTranscription(SaveTranscriptionRequest request)
        {
            var transcriptionStep = this.PersistenceContext.Load <TranscriptionStep>(request.TranscriptionStepRef);
            var supervisor        = request.SupervisorRef == null
                                ? null
                                : this.PersistenceContext.Load <Staff>(request.SupervisorRef, EntityLoadFlags.Proxy);

            SaveReportHelper(transcriptionStep, request.ReportPartExtendedProperties, supervisor);

            this.PersistenceContext.SynchState();

            return(new SaveTranscriptionResponse());
        }
示例#2
0
 public async Task SaveAudioVerificationAsync(SaveTranscriptionRequest request, long agentId)
 {
     UnsubscribeFromReopenAudio(request.Transcription.Id);
     await transactionService.CommitAsync(new[] { TransactionContextScope.Main }, async() =>
     {
         await SaveVerifiedTranscription(request.Transcription, agentId);
         var filter = new WorkingPeriodFilter
         {
             AgentId = agentId,
             Type    = LabelingType.Transcription,
             Action  = LabelingAction.Verification
         };
         await workingPeriodsService.SaveWorkingPeriodAsync(filter, request.SpentTime);
         await UpdateLabels(request.SelectedLabelIds, request.Transcription.Id);
     });
 }
示例#3
0
        public async Task SaveAudioTrancriptionAsync(SaveTranscriptionRequest request, long agentId)
        {
            UnsubscribeFromReopenAudio(request.Transcription.Id);

            await transactionService.CommitAsync(new[] { TransactionContextScope.Main }, async() =>
            {
                await SaveTranscription(request.Transcription, agentId);
                var filter = new WorkingPeriodFilter
                {
                    AgentId = agentId,
                    Type    = LabelingType.Transcription,
                    Action  = LabelingAction.Labeling
                };
                await workingPeriodsService.SaveWorkingPeriodAsync(filter, request.SpentTime);

                if (request.SelectedLabelIds.Any())
                {
                    await labelService.SaveSelectedLabelsAsync(request.SelectedLabelIds, request.Transcription.Id, null);
                }
            });
        }
        public async Task SaveAudioTrancription([FromBody] SaveTranscriptionRequest request)
        {
            var user = await userManager.GetUserAsync(HttpContext.User);

            await transcriptionService.SaveAudioTrancriptionAsync(request, user.Id);
        }