예제 #1
0
        private async Task <string> DownloadInstrumentFromBucketAsync(string instrumentName, string tempFilePath)
        {
            var instrumentPackageName = _fileService.GetInstrumentPackageName(instrumentName);

            _loggingService.LogInfo($"Downloading instrument package '{instrumentPackageName}'");
            return(await _storageService.DownloadPackageFromInstrumentBucketAsync(instrumentPackageName, tempFilePath));
        }
        public async Task <string> InstallInstrumentAsync(string serverParkName, InstrumentPackageDto instrumentPackageDto, string tempFilePath)
        {
            serverParkName.ThrowExceptionIfNullOrEmpty("serverParkName");
            instrumentPackageDto.InstrumentFile.ThrowExceptionIfNullOrEmpty("instrumentPackageDto.InstrumentFile");
            tempFilePath.ThrowExceptionIfNullOrEmpty("tempFilePath");

            var instrumentFile = await _storageService.DownloadPackageFromInstrumentBucketAsync(instrumentPackageDto.InstrumentFile, tempFilePath);

            _fileService.UpdateInstrumentFileWithSqlConnection(instrumentFile);

            var instrumentName = _fileService.GetInstrumentNameFromFile(instrumentPackageDto.InstrumentFile);

            _blaiseSurveyApi.InstallSurvey(
                instrumentName,
                serverParkName,
                instrumentFile,
                SurveyInterviewType.Cati);

            return(instrumentName);
        }