コード例 #1
0
        public void LogItkRequest(OutcomeViewModel model, ITKDispatchRequest itkRequest)
        {
            var audit             = model.ToAuditEntry();
            var auditedItkRequest = Mapper.Map <AuditedItkRequest>(itkRequest);

            audit.ItkRequest = JsonConvert.SerializeObject(auditedItkRequest);
            Log(audit);
        }
コード例 #2
0
ファイル: AuditLogger.cs プロジェクト: fossabot/nhs111-online
        public async Task LogItkRequest(OutcomeViewModel model, ITKDispatchRequest itkRequest)
        {
            var audit             = model.ToAuditEntry(new HttpSessionStateWrapper(HttpContext.Current.Session));
            var auditedItkRequest = Mapper.Map <AuditedItkRequest>(itkRequest);

            audit.ItkRequest = JsonConvert.SerializeObject(auditedItkRequest);
            await Log(audit);
        }
コード例 #3
0
        private async Task <IRestResponse> SendItkMessage(ITKDispatchRequest itkRequestData)
        {
            var request = new JsonRestRequest(_configuration.ItkDispatcherApiSendItkMessageUrl, Method.POST);

            request.AddJsonBody(itkRequestData);
            var response = await _restClientItkDispatcherApi.ExecuteAsync(request);

            return(response);
        }
コード例 #4
0
        private async Task <HttpResponseMessage> SendItkMessage(ITKDispatchRequest itkRequestData)
        {
            var request = new HttpRequestMessage
            {
                Content = new StringContent(JsonConvert.SerializeObject(itkRequestData), Encoding.UTF8, "application/json")
            };
            var response = await _restfulHelper.PostAsync(_configuration.ItkDispatchApiUrl, request);

            return(response);
        }
コード例 #5
0
        public async Task <ITKDispatchResponse> SendItkMessage(ITKDispatchRequest request)
        {
            BypassCertificateError();
            var submitHaSCToService = _mappingEngine.Mapper.Map <ITKDispatchRequest, SubmitHaSCToService>(request);
            SubmitHaSCToServiceResponse response = null;

            try {
                response = await _itkDispatcher.SubmitHaSCToServiceAsync(submitHaSCToService);
            }
            catch (Exception ex) {
                return(_itkDispatchResponseBuilder.Build(ex));
            }
            return(_itkDispatchResponseBuilder.Build(response));
        }