Merge branch 'develop'
All checks were successful
Build & Deploy Placement Service / build (push) Successful in 1m11s

This commit is contained in:
harid 2025-11-12 11:00:40 +07:00
commit ee0bb692ec
32 changed files with 453 additions and 452 deletions

View file

@ -919,7 +919,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -934,7 +934,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient()) using (var _client = new HttpClient())
{ {
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); _client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req); var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -986,7 +986,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -1001,7 +1001,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient()) using (var _client = new HttpClient())
{ {
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); _client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req); var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -1423,7 +1423,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -1440,7 +1440,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient()) using (var _client = new HttpClient())
{ {
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); _client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req); var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -1534,7 +1534,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -1550,7 +1550,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient()) using (var _client = new HttpClient())
{ {
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); _client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req); var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -1603,7 +1603,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -1832,7 +1832,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -1849,7 +1849,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient()) using (var _client = new HttpClient())
{ {
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); _client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req); var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -1905,7 +1905,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -1922,7 +1922,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient()) using (var _client = new HttpClient())
{ {
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); _client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req); var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -1978,7 +1978,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -1995,7 +1995,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient()) using (var _client = new HttpClient())
{ {
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); _client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req); var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -2051,7 +2051,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -2068,7 +2068,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient()) using (var _client = new HttpClient())
{ {
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); _client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req); var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -2124,7 +2124,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -2141,7 +2141,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient()) using (var _client = new HttpClient())
{ {
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); _client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req); var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -2197,7 +2197,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -2214,7 +2214,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient()) using (var _client = new HttpClient())
{ {
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); _client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req); var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -2270,7 +2270,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -2287,7 +2287,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient()) using (var _client = new HttpClient())
{ {
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); _client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req); var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -2340,7 +2340,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -2355,7 +2355,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var _client = new HttpClient()) using (var _client = new HttpClient())
{ {
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); _client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req); var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -2409,7 +2409,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -2462,7 +2462,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -2515,7 +2515,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -2568,7 +2568,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -2621,7 +2621,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -2673,7 +2673,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -2725,7 +2725,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -2994,7 +2994,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new var _res = await client.PostAsJsonAsync(apiUrl, new
{ {
@ -3046,7 +3046,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
foreach (var edu in placementProfile.PlacementEducations) foreach (var edu in placementProfile.PlacementEducations)
{ {
var _res = await client.PostAsJsonAsync(apiUrlEdu, new var _res = await client.PostAsJsonAsync(apiUrlEdu, new
@ -3083,7 +3083,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
foreach (var cer in placementProfile.PlacementCertificates) foreach (var cer in placementProfile.PlacementCertificates)
{ {
var _res = await client.PostAsJsonAsync(apiUrlCer, new var _res = await client.PostAsJsonAsync(apiUrlCer, new
@ -3104,7 +3104,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
profileId = profileId, profileId = profileId,
@ -3135,7 +3135,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
@ -3287,7 +3287,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
@ -3319,7 +3319,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
@ -3468,7 +3468,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
@ -3500,7 +3500,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
@ -3649,7 +3649,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
@ -3681,7 +3681,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
@ -3832,7 +3832,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
@ -3864,7 +3864,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
@ -4017,7 +4017,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
@ -4049,7 +4049,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
@ -4199,7 +4199,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
@ -4231,7 +4231,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
@ -4382,7 +4382,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
@ -4409,7 +4409,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlLeave); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlLeave);
string? _null = null; string? _null = null;
var _res = await client.PostAsJsonAsync(apiUrlLeave, new var _res = await client.PostAsJsonAsync(apiUrlLeave, new
@ -4560,7 +4560,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
@ -4587,7 +4587,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlLeave); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlLeave);
string? _null = null; string? _null = null;
var _res = await client.PostAsJsonAsync(apiUrlLeave, new var _res = await client.PostAsJsonAsync(apiUrlLeave, new
@ -4928,7 +4928,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new var _res = await client.PostAsJsonAsync(apiUrl, new
{ {
@ -5085,7 +5085,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new var _res = await client.PostAsJsonAsync(apiUrl, new
{ {
@ -5262,7 +5262,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
@ -5440,7 +5440,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
@ -5472,7 +5472,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
@ -5626,7 +5626,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
@ -5805,7 +5805,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
@ -5986,7 +5986,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new var _res = await client.PostAsJsonAsync(apiUrl, new
{ {
@ -6001,7 +6001,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
@ -6182,7 +6182,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new var _res = await client.PostAsJsonAsync(apiUrl, new
{ {
@ -6197,7 +6197,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
@ -6371,7 +6371,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new var _res = await client.PostAsJsonAsync(apiUrl, new
{ {
@ -6452,7 +6452,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, _apiUrl); var req = new HttpRequestMessage(HttpMethod.Post, _apiUrl);
var res = await client.PostAsJsonAsync(_apiUrl, new { result = dataSend }); var res = await client.PostAsJsonAsync(_apiUrl, new { result = dataSend });
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -6549,7 +6549,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new var _res = await client.PostAsJsonAsync(apiUrl, new
{ {
@ -6630,7 +6630,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, _apiUrl); var req = new HttpRequestMessage(HttpMethod.Post, _apiUrl);
var res = await client.PostAsJsonAsync(_apiUrl, new { result = dataSend }); var res = await client.PostAsJsonAsync(_apiUrl, new { result = dataSend });
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -6719,7 +6719,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -6877,7 +6877,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
@ -6906,7 +6906,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
@ -7062,7 +7062,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Put, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Put, apiUrl);
var _res = await client.PutAsJsonAsync(apiUrl, new var _res = await client.PutAsJsonAsync(apiUrl, new
{ {
@ -7215,7 +7215,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
@ -7244,7 +7244,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlOrg);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
@ -7385,7 +7385,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -7411,7 +7411,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2);
var _res = await client.PostAsJsonAsync(apiUrl2, new var _res = await client.PostAsJsonAsync(apiUrl2, new
{ {
@ -7544,7 +7544,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -7570,7 +7570,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2);
var _res = await client.PostAsJsonAsync(apiUrl2, new var _res = await client.PostAsJsonAsync(apiUrl2, new
{ {
@ -7704,7 +7704,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -7730,7 +7730,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2);
var _res = await client.PostAsJsonAsync(apiUrl2, new var _res = await client.PostAsJsonAsync(apiUrl2, new
{ {
@ -7864,7 +7864,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -7890,7 +7890,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2);
var _res = await client.PostAsJsonAsync(apiUrl2, new var _res = await client.PostAsJsonAsync(apiUrl2, new
{ {
@ -8024,7 +8024,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -8050,7 +8050,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2);
var _res = await client.PostAsJsonAsync(apiUrl2, new var _res = await client.PostAsJsonAsync(apiUrl2, new
{ {
@ -8184,7 +8184,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -8210,7 +8210,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2);
var _res = await client.PostAsJsonAsync(apiUrl2, new var _res = await client.PostAsJsonAsync(apiUrl2, new
{ {
@ -8344,7 +8344,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -8370,7 +8370,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2);
var _res = await client.PostAsJsonAsync(apiUrl2, new var _res = await client.PostAsJsonAsync(apiUrl2, new
{ {
@ -8504,7 +8504,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -8530,7 +8530,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl2);
var _res = await client.PostAsJsonAsync(apiUrl2, new var _res = await client.PostAsJsonAsync(apiUrl2, new
{ {
@ -8663,7 +8663,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -8806,7 +8806,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -8949,7 +8949,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -9091,7 +9091,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -9234,7 +9234,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var res = await client.PostAsJsonAsync(apiUrl, new { result = data }); var res = await client.PostAsJsonAsync(apiUrl, new { result = data });
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -9612,7 +9612,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
string? _null = null; string? _null = null;
var _res = await client.PostAsJsonAsync(apiUrl, new var _res = await client.PostAsJsonAsync(apiUrl, new
@ -9628,7 +9628,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlSalary);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
@ -11388,7 +11388,7 @@ namespace BMA.EHR.Application.Repositories.Commands
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
foreach (var insignia in Insignias) foreach (var insignia in Insignias)
{ {
var _res = await client.PostAsJsonAsync(apiUrlInsig, new var _res = await client.PostAsJsonAsync(apiUrlInsig, new

View file

@ -49,7 +49,7 @@ namespace BMA.EHR.Application.Repositories
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
refId = cronjobNoti.DisciplineComplaint_Profiles.Select(x => x.PersonId), refId = cronjobNoti.DisciplineComplaint_Profiles.Select(x => x.PersonId),
@ -91,7 +91,7 @@ namespace BMA.EHR.Application.Repositories
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
refId = cronjobNoti.DisciplineInvestigate_ProfileComplaints.Select(x => x.PersonId), refId = cronjobNoti.DisciplineInvestigate_ProfileComplaints.Select(x => x.PersonId),
@ -132,7 +132,7 @@ namespace BMA.EHR.Application.Repositories
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
refId = cronjobNoti.DisciplineDisciplinary_ProfileComplaintInvestigates.Select(x => x.PersonId), refId = cronjobNoti.DisciplineDisciplinary_ProfileComplaintInvestigates.Select(x => x.PersonId),

View file

@ -60,7 +60,7 @@ namespace BMA.EHR.Application.Repositories
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", apiKey); client.DefaultRequestHeaders.Add("api-key", apiKey);
var _res = await client.GetAsync(apiPath); var _res = await client.GetAsync(apiPath);
if (_res.IsSuccessStatusCode) if (_res.IsSuccessStatusCode)
{ {
@ -91,7 +91,7 @@ namespace BMA.EHR.Application.Repositories
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", apiKey); client.DefaultRequestHeaders.Add("api-key", apiKey);
var _res = await client.SendAsync(request); var _res = await client.SendAsync(request);
if (_res.IsSuccessStatusCode) if (_res.IsSuccessStatusCode)
{ {
@ -113,7 +113,7 @@ namespace BMA.EHR.Application.Repositories
{ {
try try
{ {
var json = JsonConvert.SerializeObject(body); var json = JsonConvert.SerializeObject(body);
var stringContent = new StringContent(json, Encoding.UTF8, "application/json"); var stringContent = new StringContent(json, Encoding.UTF8, "application/json");
//stringContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); //stringContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
@ -121,7 +121,7 @@ namespace BMA.EHR.Application.Repositories
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", apiKey); client.DefaultRequestHeaders.Add("api-key", apiKey);
var _res = await client.PostAsync(apiPath, stringContent); var _res = await client.PostAsync(apiPath, stringContent);
if (_res.IsSuccessStatusCode) if (_res.IsSuccessStatusCode)
{ {
@ -149,7 +149,7 @@ namespace BMA.EHR.Application.Repositories
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", apiKey); client.DefaultRequestHeaders.Add("api-key", apiKey);
var _res = await client.PostAsync(apiPath, stringContent); var _res = await client.PostAsync(apiPath, stringContent);
return _res.IsSuccessStatusCode; return _res.IsSuccessStatusCode;
} }

View file

@ -584,7 +584,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var request = new HttpRequestMessage(HttpMethod.Patch, apiUrlSalary); var request = new HttpRequestMessage(HttpMethod.Patch, apiUrlSalary);
@ -657,7 +657,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var request = new HttpRequestMessage(HttpMethod.Patch, apiUrlSalary); var request = new HttpRequestMessage(HttpMethod.Patch, apiUrlSalary);
@ -1128,7 +1128,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
profileId = profile.Id, profileId = profile.Id,
@ -1151,7 +1151,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlSalary, new var _res = await client.PostAsJsonAsync(apiUrlSalary, new
{ {
profileEmployeeId = profile.Id, profileEmployeeId = profile.Id,

View file

@ -56,7 +56,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();

View file

@ -60,7 +60,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -136,7 +136,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -227,7 +227,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -287,7 +287,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -361,7 +361,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -434,7 +434,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -504,7 +504,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -566,7 +566,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();

View file

@ -60,7 +60,7 @@ namespace BMA.EHR.Application.Repositories
{ {
client.DefaultRequestHeaders.Authorization = client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = await client.GetAsync(apiPath); var req = await client.GetAsync(apiPath);
var res = await req.Content.ReadAsStringAsync(); var res = await req.Content.ReadAsStringAsync();
return res; return res;
@ -81,7 +81,7 @@ namespace BMA.EHR.Application.Repositories
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = await client.GetAsync(apiPath); var req = await client.GetAsync(apiPath);
var res = await req.Content.ReadAsStringAsync(); var res = await req.Content.ReadAsStringAsync();
return res; return res;

View file

@ -1018,7 +1018,7 @@ namespace BMA.EHR.Application.Repositories.Reports
r.Request.OrganizationId r.Request.OrganizationId
}) })
.Select(group => new .Select(group => new
{ {
InsigniaInitial = group.Key.ShortName, InsigniaInitial = group.Key.ShortName,
InsigniaName = group.Key.Name, InsigniaName = group.Key.Name,
ProfileId = group.Key.ProfileId, ProfileId = group.Key.ProfileId,
@ -1236,7 +1236,7 @@ namespace BMA.EHR.Application.Repositories.Reports
var _apiUrl = $"{_baseAPI}/org/unauthorize/calculateEvaluation/{type}"; var _apiUrl = $"{_baseAPI}/org/unauthorize/calculateEvaluation/{type}";
using (var _client = new HttpClient()) using (var _client = new HttpClient())
{ {
_client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); _client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await _client.SendAsync(_req); var _res = await _client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();

View file

@ -51,7 +51,7 @@ namespace BMA.EHR.Application.Repositories.Reports
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, api_url); var req = new HttpRequestMessage(HttpMethod.Get, api_url);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -161,7 +161,7 @@ namespace BMA.EHR.Application.Repositories.Reports
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, api_url); var req = new HttpRequestMessage(HttpMethod.Get, api_url);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -433,7 +433,7 @@ namespace BMA.EHR.Application.Repositories.Reports
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, api_url); var req = new HttpRequestMessage(HttpMethod.Get, api_url);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -642,7 +642,7 @@ namespace BMA.EHR.Application.Repositories.Reports
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, api_url); var req = new HttpRequestMessage(HttpMethod.Get, api_url);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();
@ -894,7 +894,7 @@ namespace BMA.EHR.Application.Repositories.Reports
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var req = new HttpRequestMessage(HttpMethod.Get, api_url); var req = new HttpRequestMessage(HttpMethod.Get, api_url);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
var result = await res.Content.ReadAsStringAsync(); var result = await res.Content.ReadAsStringAsync();

View file

@ -87,7 +87,7 @@ namespace BMA.EHR.Application.Repositories.Reports
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -580,7 +580,7 @@ namespace BMA.EHR.Application.Repositories.Reports
if (data.Type == "OFFICER") if (data.Type == "OFFICER")
{ {
var Approver = _dbContext.Set<RetirementResignApprover>() var Approver = _dbContext.Set<RetirementResignApprover>()
.Where(x => x.RetirementResign.Id == data.Id && x.ApproveType == "APPROVER") .Where(x => x.RetirementResign.Id == data.Id && x.ApproveType == "APPROVER")
.ToList(); .ToList();
var Commander = _dbContext.Set<RetirementResignApprover>() var Commander = _dbContext.Set<RetirementResignApprover>()
@ -591,8 +591,8 @@ namespace BMA.EHR.Application.Repositories.Reports
{ {
approverPositionExecutiveName = Approver[0].PositionExecutiveName; approverPositionExecutiveName = Approver[0].PositionExecutiveName;
approverStatus = Approver[0].ApproveStatus == "APPROVE" ? "☑ อนุญาต" : approverStatus; approverStatus = Approver[0].ApproveStatus == "APPROVE" ? "☑ อนุญาต" : approverStatus;
approverRejectStatus = Approver[0].ApproveStatus == "REJECT" approverRejectStatus = Approver[0].ApproveStatus == "REJECT"
? $"☑ ยับยั้งการลาออกไว้จนถึง{(Approver[0].RejectDate != null ? DateTime.Parse(Approver[0].RejectDate.ToString()).ToThaiFullDate().ToString().ToThaiNumber() : "...................")}" ? $"☑ ยับยั้งการลาออกไว้จนถึง{(Approver[0].RejectDate != null ? DateTime.Parse(Approver[0].RejectDate.ToString()).ToThaiFullDate().ToString().ToThaiNumber() : "...................")}"
: approverRejectStatus; : approverRejectStatus;
approver = $"{Approver[0].Prefix}{Approver[0].FirstName} {Approver[0].LastName}"; approver = $"{Approver[0].Prefix}{Approver[0].FirstName} {Approver[0].LastName}";
approverPosition = Approver[0].PositionName; approverPosition = Approver[0].PositionName;
@ -606,7 +606,7 @@ namespace BMA.EHR.Application.Repositories.Reports
: Commander[0].LastUpdatedAt != null : Commander[0].LastUpdatedAt != null
? DateTime.Parse(Commander[0].LastUpdatedAt.ToString()).ToThaiFullDate().ToString().ToThaiNumber() ? DateTime.Parse(Commander[0].LastUpdatedAt.ToString()).ToThaiFullDate().ToString().ToThaiNumber()
: commanderDateUpdate; : commanderDateUpdate;
commanderStatus = Commander[0].ApproveStatus == "APPROVE" commanderStatus = Commander[0].ApproveStatus == "APPROVE"
? $"☑ อนุญาต ตั้งแต่{(Commander[0].LastUpdatedAt != null ? DateTime.Parse(Commander[0].LastUpdatedAt.ToString()).ToThaiFullDate().ToString().ToThaiNumber() : "...................")}" ? $"☑ อนุญาต ตั้งแต่{(Commander[0].LastUpdatedAt != null ? DateTime.Parse(Commander[0].LastUpdatedAt.ToString()).ToThaiFullDate().ToString().ToThaiNumber() : "...................")}"
: commanderStatus; : commanderStatus;
commanderCommentApprove = Commander[0].ApproveStatus == "APPROVE" commanderCommentApprove = Commander[0].ApproveStatus == "APPROVE"

View file

@ -116,7 +116,7 @@ namespace BMA.EHR.Application.Repositories
// using (var client = new HttpClient()) // using (var client = new HttpClient())
// { // {
// client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
// client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); // client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
// var jsonBody = JsonConvert.SerializeObject(body); // var jsonBody = JsonConvert.SerializeObject(body);
// var content = new StringContent(jsonBody, Encoding.UTF8, "application/json"); // var content = new StringContent(jsonBody, Encoding.UTF8, "application/json");

View file

@ -129,12 +129,12 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
var pageSize = req.pageSize <= 0 ? 25 : req.pageSize; var pageSize = req.pageSize <= 0 ? 25 : req.pageSize;
var keyword = string.IsNullOrEmpty(req.keyword) ? string.Empty : req.keyword; var keyword = string.IsNullOrEmpty(req.keyword) ? string.Empty : req.keyword;
var status = string.IsNullOrEmpty(req.status) ? string.Empty : req.status; var status = string.IsNullOrEmpty(req.status) ? string.Empty : req.status;
var data_search = (from x in _context.DisciplineComplaints var data_search = (from x in _context.DisciplineComplaints
where x.Title.Contains(keyword) || where x.Title.Contains(keyword) ||
(x.Appellant == null ? false : x.Appellant.Contains(keyword)) (x.Appellant == null ? false : x.Appellant.Contains(keyword))
select x).ToList(); select x).ToList();
if (status.Trim().ToUpper() != "ALL") if (status.Trim().ToUpper() != "ALL")
data_search = data_search.Where(x => x.Status.Contains(status.Trim().ToUpper())).ToList(); data_search = data_search.Where(x => x.Status.Contains(status.Trim().ToUpper())).ToList();
@ -244,7 +244,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
} }
} }
var data = query var data = query
.Skip((page - 1) * pageSize) .Skip((page - 1) * pageSize)
.Take(pageSize) .Take(pageSize)
@ -837,7 +837,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
refId = persons.Select(x => x.PersonId), refId = persons.Select(x => x.PersonId),

View file

@ -97,7 +97,7 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -364,7 +364,7 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers
{ {
client.DefaultRequestHeaders.Authorization = client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -404,7 +404,7 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _apiUrl = $"{_configuration["API"]}/org/profile/profileid/position/{id}"; var _apiUrl = $"{_configuration["API"]}/org/profile/profileid/position/{id}";
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
@ -479,7 +479,7 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers
{ {
client.DefaultRequestHeaders.Authorization = client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var __res = await client.PostAsJsonAsync(apiUrlOrg, new var __res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
refId = new List<Guid> { Guid.Parse(id) }, refId = new List<Guid> { Guid.Parse(id) },
@ -543,7 +543,7 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var apiUrl = $"{_configuration["API"]}/org/profile/profileid/position/{req.ProfileId}"; var apiUrl = $"{_configuration["API"]}/org/profile/profileid/position/{req.ProfileId}";
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
@ -617,7 +617,7 @@ namespace BMA.EHR.DisciplineComplaint_Appeal.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var __res = await client.PostAsJsonAsync(apiUrlOrg, new var __res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
refId = new List<Guid> { Guid.Parse(req.ProfileId) }, refId = new List<Guid> { Guid.Parse(req.ProfileId) },

View file

@ -176,74 +176,74 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
InvestigationStatusResult = x.InvestigationStatusResult, InvestigationStatusResult = x.InvestigationStatusResult,
}); });
bool desc = req.descending ?? false; bool desc = req.descending ?? false;
if (!string.IsNullOrEmpty(req.sortBy)) if (!string.IsNullOrEmpty(req.sortBy))
{ {
switch (req.sortBy) switch (req.sortBy)
{ {
case "title": case "title":
query = desc ? query.OrderByDescending(x => x.Title) query = desc ? query.OrderByDescending(x => x.Title)
: query.OrderBy(x => x.Title); : query.OrderBy(x => x.Title);
break; break;
case "respondentType": case "respondentType":
query = desc ? query.OrderByDescending(x => x.RespondentType) query = desc ? query.OrderByDescending(x => x.RespondentType)
: query.OrderBy(x => x.RespondentType); : query.OrderBy(x => x.RespondentType);
break; break;
case "offenseDetails": case "offenseDetails":
query = desc ? query.OrderByDescending(x => x.OffenseDetails) query = desc ? query.OrderByDescending(x => x.OffenseDetails)
: query.OrderBy(x => x.OffenseDetails); : query.OrderBy(x => x.OffenseDetails);
break; break;
case "status": case "status":
query = desc ? query.OrderByDescending(x => x.Status) query = desc ? query.OrderByDescending(x => x.Status)
: query.OrderBy(x => x.Status); : query.OrderBy(x => x.Status);
break; break;
case "investigationDateStart": case "investigationDateStart":
query = desc ? query.OrderByDescending(x => x.InvestigationDateStart) query = desc ? query.OrderByDescending(x => x.InvestigationDateStart)
: query.OrderBy(x => x.InvestigationDateStart); : query.OrderBy(x => x.InvestigationDateStart);
break; break;
case "investigationDateEnd": case "investigationDateEnd":
query = desc ? query.OrderByDescending(x => x.InvestigationDateEnd) query = desc ? query.OrderByDescending(x => x.InvestigationDateEnd)
: query.OrderBy(x => x.InvestigationDateEnd); : query.OrderBy(x => x.InvestigationDateEnd);
break; break;
case "dateReceived": case "dateReceived":
query = desc ? query.OrderByDescending(x => x.DateReceived) query = desc ? query.OrderByDescending(x => x.DateReceived)
: query.OrderBy(x => x.DateReceived); : query.OrderBy(x => x.DateReceived);
break; break;
case "createdAt": case "createdAt":
query = desc ? query.OrderByDescending(x => x.CreatedAt) query = desc ? query.OrderByDescending(x => x.CreatedAt)
: query.OrderBy(x => x.CreatedAt); : query.OrderBy(x => x.CreatedAt);
break; break;
case "investigationDetail": case "investigationDetail":
query = desc ? query.OrderByDescending(x => x.InvestigationDetail) query = desc ? query.OrderByDescending(x => x.InvestigationDetail)
: query.OrderBy(x => x.InvestigationDetail); : query.OrderBy(x => x.InvestigationDetail);
break; break;
case "investigationStatusResult": case "investigationStatusResult":
query = desc ? query.OrderByDescending(x => x.InvestigationStatusResult) query = desc ? query.OrderByDescending(x => x.InvestigationStatusResult)
: query.OrderBy(x => x.InvestigationStatusResult); : query.OrderBy(x => x.InvestigationStatusResult);
break; break;
default: default:
query = query.OrderByDescending(x => x.InvestigationDateStart); query = query.OrderByDescending(x => x.InvestigationDateStart);
break; break;
} }
} }
var data = query
.Skip((page - 1) * pageSize)
.Take(pageSize)
.ToList();
var data = query
.Skip((page - 1) * pageSize)
.Take(pageSize)
.ToList();
return Success(new { data, total = data_search.Count() }); return Success(new { data, total = data_search.Count() });
} }
@ -967,7 +967,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
refId = persons.Select(x => x.PersonId), refId = persons.Select(x => x.PersonId),

View file

@ -211,87 +211,87 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
ResultYear = x.ResultYear,//ปีงบประมาณ ResultYear = x.ResultYear,//ปีงบประมาณ
}); });
bool desc = req.descending ?? false; bool desc = req.descending ?? false;
if (!string.IsNullOrEmpty(req.sortBy)) if (!string.IsNullOrEmpty(req.sortBy))
{ {
switch (req.sortBy) switch (req.sortBy)
{ {
case "title": case "title":
query = desc ? query.OrderByDescending(x => x.Title) query = desc ? query.OrderByDescending(x => x.Title)
: query.OrderBy(x => x.Title); : query.OrderBy(x => x.Title);
break; break;
case "respondentType": case "respondentType":
query = desc ? query.OrderByDescending(x => x.RespondentType) query = desc ? query.OrderByDescending(x => x.RespondentType)
: query.OrderBy(x => x.RespondentType); : query.OrderBy(x => x.RespondentType);
break; break;
case "offenseDetails": case "offenseDetails":
query = desc ? query.OrderByDescending(x => x.OffenseDetails) query = desc ? query.OrderByDescending(x => x.OffenseDetails)
: query.OrderBy(x => x.OffenseDetails); : query.OrderBy(x => x.OffenseDetails);
break; break;
case "disciplinaryFaultLevel": case "disciplinaryFaultLevel":
query = desc ? query.OrderByDescending(x => x.DisciplinaryFaultLevel) query = desc ? query.OrderByDescending(x => x.DisciplinaryFaultLevel)
: query.OrderBy(x => x.DisciplinaryFaultLevel); : query.OrderBy(x => x.DisciplinaryFaultLevel);
break; break;
case "disciplinaryCaseFault": case "disciplinaryCaseFault":
query = desc ? query.OrderByDescending(x => x.DisciplinaryCaseFault) query = desc ? query.OrderByDescending(x => x.DisciplinaryCaseFault)
: query.OrderBy(x => x.DisciplinaryCaseFault); : query.OrderBy(x => x.DisciplinaryCaseFault);
break; break;
case "status": case "status":
query = desc ? query.OrderByDescending(x => x.Status) query = desc ? query.OrderByDescending(x => x.Status)
: query.OrderBy(x => x.Status); : query.OrderBy(x => x.Status);
break; break;
case "createdAt": case "createdAt":
query = desc ? query.OrderByDescending(x => x.CreatedAt) query = desc ? query.OrderByDescending(x => x.CreatedAt)
: query.OrderBy(x => x.CreatedAt); : query.OrderBy(x => x.CreatedAt);
break; break;
case "disciplinaryDateStart": case "disciplinaryDateStart":
query = desc ? query.OrderByDescending(x => x.DisciplinaryDateStart) query = desc ? query.OrderByDescending(x => x.DisciplinaryDateStart)
: query.OrderBy(x => x.DisciplinaryDateStart); : query.OrderBy(x => x.DisciplinaryDateStart);
break; break;
case "disciplinaryDateEnd": case "disciplinaryDateEnd":
query = desc ? query.OrderByDescending(x => x.DisciplinaryDateEnd) query = desc ? query.OrderByDescending(x => x.DisciplinaryDateEnd)
: query.OrderBy(x => x.DisciplinaryDateEnd); : query.OrderBy(x => x.DisciplinaryDateEnd);
break; break;
case "resultOc": case "resultOc":
query = desc ? query.OrderByDescending(x => x.ResultOc) query = desc ? query.OrderByDescending(x => x.ResultOc)
: query.OrderBy(x => x.ResultOc); : query.OrderBy(x => x.ResultOc);
break; break;
case "resultDisciplineType": case "resultDisciplineType":
query = desc ? query.OrderByDescending(x => x.ResultDisciplineType) query = desc ? query.OrderByDescending(x => x.ResultDisciplineType)
: query.OrderBy(x => x.ResultDisciplineType); : query.OrderBy(x => x.ResultDisciplineType);
break; break;
case "resultTitleType": case "resultTitleType":
query = desc ? query.OrderByDescending(x => x.ResultTitleType) query = desc ? query.OrderByDescending(x => x.ResultTitleType)
: query.OrderBy(x => x.ResultTitleType); : query.OrderBy(x => x.ResultTitleType);
break; break;
case "resultYear": case "resultYear":
query = desc ? query.OrderByDescending(x => x.ResultYear) query = desc ? query.OrderByDescending(x => x.ResultYear)
: query.OrderBy(x => x.ResultYear); : query.OrderBy(x => x.ResultYear);
break; break;
default: default:
query = query.OrderByDescending(x => x.CreatedAt); query = query.OrderByDescending(x => x.CreatedAt);
break; break;
} }
} }
var data = query var data = query
.Skip((page - 1) * pageSize) .Skip((page - 1) * pageSize)
.Take(pageSize) .Take(pageSize)
.ToList(); .ToList();
return Success(new { data, total = data_search.Count() }); return Success(new { data, total = data_search.Count() });
} }
@ -708,7 +708,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline);
var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new
{ {
@ -755,7 +755,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline);
var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new
{ {
@ -801,7 +801,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline);
var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new
{ {
@ -829,7 +829,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline);
var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new
{ {
@ -875,7 +875,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrlDiscipline);
var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new var _res = await client.PostAsJsonAsync(apiUrlDiscipline, new
{ {
@ -949,7 +949,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
.OrderByDescending(x => x.CreatedAt) .OrderByDescending(x => x.CreatedAt)
.ToListAsync(); .ToListAsync();
var result = data var result = data
.Select((x, idx) => new { .Select((x, idx) => new
{
no = (idx + 1).ToString(), no = (idx + 1).ToString(),
commandSubject = x.commandType, commandSubject = x.commandType,
createdAt = x.CreatedAt createdAt = x.CreatedAt
@ -1052,7 +1053,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -1189,7 +1190,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -1404,7 +1405,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -1529,7 +1530,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -1652,7 +1653,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -1775,7 +1776,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -1898,7 +1899,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -2021,7 +2022,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -2144,7 +2145,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -2283,7 +2284,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -2337,7 +2338,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData1, data = resultData1,

View file

@ -95,13 +95,13 @@ namespace BMA.EHR.Domain.Middlewares
// หลังจาก Authentication middleware ทำงานแล้ว ลองดึง claims อีกครั้ง // หลังจาก Authentication middleware ทำงานแล้ว ลองดึง claims อีกครั้ง
if (context.User?.Identity?.IsAuthenticated == true) if (context.User?.Identity?.IsAuthenticated == true)
{ {
var authenticatedKeycloakId = context.User.FindFirst(ClaimTypes.NameIdentifier)?.Value var authenticatedKeycloakId = context.User.FindFirst(ClaimTypes.NameIdentifier)?.Value
?? context.User.FindFirst("sub")?.Value; ?? context.User.FindFirst("sub")?.Value;
if (!string.IsNullOrEmpty(authenticatedKeycloakId) && authenticatedKeycloakId != keycloakId) if (!string.IsNullOrEmpty(authenticatedKeycloakId) && authenticatedKeycloakId != keycloakId)
{ {
keycloakId = authenticatedKeycloakId; keycloakId = authenticatedKeycloakId;
Console.WriteLine($"Updated keycloakId from authenticated user: {keycloakId}"); Console.WriteLine($"Updated keycloakId from authenticated user: {keycloakId}");
// อัพเดต profile ด้วย keycloakId ที่ถูกต้อง // อัพเดต profile ด้วย keycloakId ที่ถูกต้อง
try try
{ {
@ -143,7 +143,7 @@ namespace BMA.EHR.Domain.Middlewares
{ {
stopwatch.Stop(); stopwatch.Stop();
await LogRequest(context, client, startTime, stopwatch, pf, keycloakId, requestBodyJson, memoryStream, caughtException); await LogRequest(context, client, startTime, stopwatch, pf, keycloakId, requestBodyJson, memoryStream, caughtException);
// เขียนข้อมูลกลับไปยัง original Response body // เขียนข้อมูลกลับไปยัง original Response body
if (memoryStream.Length > 0) if (memoryStream.Length > 0)
{ {
@ -164,7 +164,7 @@ namespace BMA.EHR.Domain.Middlewares
{ {
var form = await context.Request.ReadFormAsync(); var form = await context.Request.ReadFormAsync();
var formData = new Dictionary<string, object>(); var formData = new Dictionary<string, object>();
foreach (var field in form) foreach (var field in form)
{ {
formData[field.Key] = field.Value.ToString(); formData[field.Key] = field.Value.ToString();
@ -185,23 +185,23 @@ namespace BMA.EHR.Domain.Middlewares
formData["Files"] = fileDataList; formData["Files"] = fileDataList;
} }
var jsonOptions = new JsonSerializerOptions var jsonOptions = new JsonSerializerOptions
{ {
PropertyNamingPolicy = JsonNamingPolicy.CamelCase, PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
WriteIndented = true, WriteIndented = true,
Converters = { new DateTimeFixConverter() } Converters = { new DateTimeFixConverter() }
}; };
return JsonSerializer.Serialize(formData, jsonOptions); return JsonSerializer.Serialize(formData, jsonOptions);
} }
else else
{ {
var jsonOptions = new JsonSerializerOptions var jsonOptions = new JsonSerializerOptions
{ {
PropertyNamingPolicy = JsonNamingPolicy.CamelCase, PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
WriteIndented = true, WriteIndented = true,
Converters = { new DateTimeFixConverter() } Converters = { new DateTimeFixConverter() }
}; };
return JsonSerializer.Serialize(JsonSerializer.Deserialize<object>(requestBody), jsonOptions); return JsonSerializer.Serialize(JsonSerializer.Deserialize<object>(requestBody), jsonOptions);
} }
@ -222,8 +222,8 @@ namespace BMA.EHR.Domain.Middlewares
var response = context.Response; var response = context.Response;
var statusCode = response.StatusCode; var statusCode = response.StatusCode;
string? message = null; string? message = null;
string? responseBodyJson = null; string? responseBodyJson = null;
if (memoryStream.Length > 0) if (memoryStream.Length > 0)
@ -261,16 +261,16 @@ namespace BMA.EHR.Domain.Middlewares
if (!response.HasStarted && ShouldFormatResponse(statusCode)) if (!response.HasStarted && ShouldFormatResponse(statusCode))
{ {
Console.WriteLine($"Formatting response for status: {statusCode}"); Console.WriteLine($"Formatting response for status: {statusCode}");
var responseModel = CreateResponseModel(statusCode,message); var responseModel = CreateResponseModel(statusCode, message);
// Clear memory stream และเขียน response ใหม่ // Clear memory stream และเขียน response ใหม่
memoryStream.SetLength(0); memoryStream.SetLength(0);
memoryStream.Position = 0; memoryStream.Position = 0;
// ไม่เปลี่ยน status code ที่ Authentication middleware ตั้งไว้ // ไม่เปลี่ยน status code ที่ Authentication middleware ตั้งไว้
response.ContentType = "application/json; charset=utf-8"; response.ContentType = "application/json; charset=utf-8";
var jsonOptions = new JsonSerializerOptions var jsonOptions = new JsonSerializerOptions
{ {
PropertyNamingPolicy = JsonNamingPolicy.CamelCase, PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
@ -278,22 +278,22 @@ namespace BMA.EHR.Domain.Middlewares
}; };
var jsonResponse = JsonSerializer.Serialize(responseModel, jsonOptions); var jsonResponse = JsonSerializer.Serialize(responseModel, jsonOptions);
var bytes = System.Text.Encoding.UTF8.GetBytes(jsonResponse); var bytes = System.Text.Encoding.UTF8.GetBytes(jsonResponse);
// กำหนด Content-Length ให้ตรงกับขนาดจริง // กำหนด Content-Length ให้ตรงกับขนาดจริง
response.ContentLength = bytes.Length; response.ContentLength = bytes.Length;
await memoryStream.WriteAsync(bytes, 0, bytes.Length); await memoryStream.WriteAsync(bytes, 0, bytes.Length);
Console.WriteLine($"Response formatted successfully: {jsonResponse}"); Console.WriteLine($"Response formatted successfully: {jsonResponse}");
} }
// หากเป็น 401/403 แต่ยังไม่มี response body ให้สร้างใหม่ // หากเป็น 401/403 แต่ยังไม่มี response body ให้สร้างใหม่
else if (!response.HasStarted && (statusCode == 401 || statusCode == 403) && memoryStream.Length == 0) else if (!response.HasStarted && (statusCode == 401 || statusCode == 403) && memoryStream.Length == 0)
{ {
Console.WriteLine($"Creating response body for {statusCode} status"); Console.WriteLine($"Creating response body for {statusCode} status");
var responseModel = CreateResponseModel(statusCode,message); var responseModel = CreateResponseModel(statusCode, message);
response.ContentType = "application/json; charset=utf-8"; response.ContentType = "application/json; charset=utf-8";
var jsonOptions = new JsonSerializerOptions var jsonOptions = new JsonSerializerOptions
{ {
PropertyNamingPolicy = JsonNamingPolicy.CamelCase, PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
@ -301,12 +301,12 @@ namespace BMA.EHR.Domain.Middlewares
}; };
var jsonResponse = JsonSerializer.Serialize(responseModel, jsonOptions); var jsonResponse = JsonSerializer.Serialize(responseModel, jsonOptions);
var bytes = System.Text.Encoding.UTF8.GetBytes(jsonResponse); var bytes = System.Text.Encoding.UTF8.GetBytes(jsonResponse);
// กำหนด Content-Length ให้ตรงกับขนาดจริง // กำหนด Content-Length ให้ตรงกับขนาดจริง
response.ContentLength = bytes.Length; response.ContentLength = bytes.Length;
await memoryStream.WriteAsync(bytes, 0, bytes.Length); await memoryStream.WriteAsync(bytes, 0, bytes.Length);
Console.WriteLine($"Response body created: {jsonResponse}"); Console.WriteLine($"Response body created: {jsonResponse}");
} }
} }
@ -325,7 +325,7 @@ namespace BMA.EHR.Domain.Middlewares
try try
{ {
Console.WriteLine($"FormatExceptionResponse: Error={error.Message}"); Console.WriteLine($"FormatExceptionResponse: Error={error.Message}");
if (context?.Response == null) if (context?.Response == null)
return; return;
@ -337,7 +337,7 @@ namespace BMA.EHR.Domain.Middlewares
// Clear memory stream และเขียน error response // Clear memory stream และเขียน error response
memoryStream.SetLength(0); memoryStream.SetLength(0);
memoryStream.Position = 0; memoryStream.Position = 0;
response.StatusCode = (int)HttpStatusCode.InternalServerError; response.StatusCode = (int)HttpStatusCode.InternalServerError;
response.ContentType = "application/json; charset=utf-8"; response.ContentType = "application/json; charset=utf-8";
@ -355,13 +355,13 @@ namespace BMA.EHR.Domain.Middlewares
}; };
var jsonResponse = JsonSerializer.Serialize(responseModel, jsonOptions); var jsonResponse = JsonSerializer.Serialize(responseModel, jsonOptions);
var bytes = System.Text.Encoding.UTF8.GetBytes(jsonResponse); var bytes = System.Text.Encoding.UTF8.GetBytes(jsonResponse);
// กำหนด Content-Length ให้ตรงกับขนาดจริง // กำหนด Content-Length ให้ตรงกับขนาดจริง
response.ContentLength = bytes.Length; response.ContentLength = bytes.Length;
await memoryStream.WriteAsync(bytes, 0, bytes.Length); await memoryStream.WriteAsync(bytes, 0, bytes.Length);
Console.WriteLine($"Exception response formatted: {jsonResponse}"); Console.WriteLine($"Exception response formatted: {jsonResponse}");
} }
else else
@ -379,16 +379,16 @@ namespace BMA.EHR.Domain.Middlewares
} }
} }
private async Task LogRequest(HttpContext context, ElasticClient client, DateTime startTime, Stopwatch stopwatch, private async Task LogRequest(HttpContext context, ElasticClient client, DateTime startTime, Stopwatch stopwatch,
GetProfileByKeycloakIdLocal? pf, string keycloakId, string? requestBodyJson, MemoryStream memoryStream, Exception? caughtException) GetProfileByKeycloakIdLocal? pf, string keycloakId, string? requestBodyJson, MemoryStream memoryStream, Exception? caughtException)
{ {
try try
{ {
var processTime = stopwatch.ElapsedMilliseconds; var processTime = stopwatch.ElapsedMilliseconds;
var endTime = DateTime.UtcNow; var endTime = DateTime.UtcNow;
var statusCode = caughtException != null ? (int)HttpStatusCode.InternalServerError : context.Response.StatusCode; var statusCode = caughtException != null ? (int)HttpStatusCode.InternalServerError : context.Response.StatusCode;
var logType = caughtException != null ? "error" : statusCode switch var logType = caughtException != null ? "error" : statusCode switch
{ {
>= 500 => "error", >= 500 => "error",
@ -404,7 +404,7 @@ namespace BMA.EHR.Domain.Middlewares
{ {
memoryStream.Seek(0, SeekOrigin.Begin); memoryStream.Seek(0, SeekOrigin.Begin);
var responseBody = new StreamReader(memoryStream).ReadToEnd(); var responseBody = new StreamReader(memoryStream).ReadToEnd();
if (!string.IsNullOrEmpty(responseBody)) if (!string.IsNullOrEmpty(responseBody))
{ {
var contentType = context.Response.ContentType; var contentType = context.Response.ContentType;
@ -424,12 +424,12 @@ namespace BMA.EHR.Domain.Middlewares
{ {
try try
{ {
var jsonOptions = new JsonSerializerOptions var jsonOptions = new JsonSerializerOptions
{ {
PropertyNamingPolicy = JsonNamingPolicy.CamelCase, PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
WriteIndented = true, WriteIndented = true,
Converters = { new DateTimeFixConverter() } Converters = { new DateTimeFixConverter() }
}; };
responseBodyJson = JsonSerializer.Serialize(JsonSerializer.Deserialize<object>(responseBody), jsonOptions); responseBodyJson = JsonSerializer.Serialize(JsonSerializer.Deserialize<object>(responseBody), jsonOptions);
@ -501,7 +501,7 @@ namespace BMA.EHR.Domain.Middlewares
statusCode == (int)HttpStatusCode.InternalServerError; statusCode == (int)HttpStatusCode.InternalServerError;
} }
private static ResponseObject CreateResponseModel(int statusCode,string? error) private static ResponseObject CreateResponseModel(int statusCode, string? error)
{ {
var message = statusCode switch var message = statusCode switch
{ {
@ -544,7 +544,7 @@ namespace BMA.EHR.Domain.Middlewares
} }
var token = authorizationHeader.Replace("Bearer ", ""); var token = authorizationHeader.Replace("Bearer ", "");
// แยก JWT token เพื่อดึง payload (แบบง่าย โดยไม่ verify signature) // แยก JWT token เพื่อดึง payload (แบบง่าย โดยไม่ verify signature)
var parts = token.Split('.'); var parts = token.Split('.');
if (parts.Length != 3) if (parts.Length != 3)
@ -554,7 +554,7 @@ namespace BMA.EHR.Domain.Middlewares
// Decode Base64 payload // Decode Base64 payload
var payload = parts[1]; var payload = parts[1];
// เพิ่ม padding ถ้าจำเป็น // เพิ่ม padding ถ้าจำเป็น
var padLength = 4 - (payload.Length % 4); var padLength = 4 - (payload.Length % 4);
if (padLength != 4) if (padLength != 4)
@ -564,15 +564,15 @@ namespace BMA.EHR.Domain.Middlewares
var payloadBytes = Convert.FromBase64String(payload); var payloadBytes = Convert.FromBase64String(payload);
var payloadJson = System.Text.Encoding.UTF8.GetString(payloadBytes); var payloadJson = System.Text.Encoding.UTF8.GetString(payloadBytes);
Console.WriteLine($"JWT Payload: {payloadJson}"); Console.WriteLine($"JWT Payload: {payloadJson}");
// Parse JSON และดึง sub (subject) claim // Parse JSON และดึง sub (subject) claim
var jsonDoc = JsonDocument.Parse(payloadJson); var jsonDoc = JsonDocument.Parse(payloadJson);
// ลองหา keycloak ID ใน claims ต่างๆ // ลองหา keycloak ID ใน claims ต่างๆ
string? keycloakId = null; string? keycloakId = null;
if (jsonDoc.RootElement.TryGetProperty("sub", out var subElement)) if (jsonDoc.RootElement.TryGetProperty("sub", out var subElement))
{ {
keycloakId = subElement.GetString(); keycloakId = subElement.GetString();
@ -602,7 +602,7 @@ namespace BMA.EHR.Domain.Middlewares
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", apiKey); client.DefaultRequestHeaders.Add("api-key", apiKey);
var _res = await client.GetAsync(apiPath); var _res = await client.GetAsync(apiPath);
if (_res.IsSuccessStatusCode) if (_res.IsSuccessStatusCode)
{ {

View file

@ -38,7 +38,7 @@ namespace BMA.EHR.Domain.Middlewares
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", apiKey); client.DefaultRequestHeaders.Add("api-key", apiKey);
var _res = await client.GetAsync(apiPath); var _res = await client.GetAsync(apiPath);
if (_res.IsSuccessStatusCode) if (_res.IsSuccessStatusCode)
{ {

View file

@ -2127,7 +2127,7 @@ namespace BMA.EHR.Leave.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
refId = id, refId = id,
@ -2143,7 +2143,7 @@ namespace BMA.EHR.Leave.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
refId = id, refId = id,

View file

@ -129,7 +129,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -218,7 +218,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();

View file

@ -487,7 +487,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -605,7 +605,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new var _res = await client.PostAsJsonAsync(apiUrl, new
{ {
@ -643,7 +643,7 @@ namespace BMA.EHR.Placement.Service.Controllers
// using (var client = new HttpClient()) // using (var client = new HttpClient())
// { // {
// client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
// client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); // client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
// var _resUpdate = await client.PostAsJsonAsync(apiUrlUpdate, new // var _resUpdate = await client.PostAsJsonAsync(apiUrlUpdate, new
// { // {
// posMasterOldId = uppdated.posmasterId, // posMasterOldId = uppdated.posmasterId,
@ -1025,7 +1025,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -1237,7 +1237,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -1437,7 +1437,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -1642,7 +1642,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -1866,7 +1866,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -2027,7 +2027,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,

View file

@ -470,7 +470,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -583,7 +583,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new var _res = await client.PostAsJsonAsync(apiUrl, new
{ {
@ -622,7 +622,7 @@ namespace BMA.EHR.Placement.Service.Controllers
// using (var client = new HttpClient()) // using (var client = new HttpClient())
// { // {
// client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
// client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); // client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
// var _resUpdate = await client.PostAsJsonAsync(apiUrlUpdate, new // var _resUpdate = await client.PostAsJsonAsync(apiUrlUpdate, new
// { // {
// posMasterOldId = uppdated.posmasterId, // posMasterOldId = uppdated.posmasterId,

View file

@ -159,7 +159,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -437,7 +437,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -698,7 +698,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -797,52 +797,52 @@ namespace BMA.EHR.Placement.Service.Controllers
if (person == null) if (person == null)
return Error(GlobalMessages.DataNotFound, 404); return Error(GlobalMessages.DataNotFound, 404);
bool? _nullBool = null; bool? _nullBool = null;
person.PositionLevel = null; //person.PositionLevel = null;
person.PositionType = null; //person.PositionType = null;
person.Amount = null; //person.Amount = null;
person.MouthSalaryAmount = null; //person.MouthSalaryAmount = null;
person.PositionSalaryAmount = null; //person.PositionSalaryAmount = null;
person.RecruitDate = null; //person.RecruitDate = null;
person.ReportingDate = null; //person.ReportingDate = null;
person.RejectReason = req.Note; person.RejectReason = req.Note;
person.PlacementStatus = "DISCLAIM"; person.PlacementStatus = "DISCLAIM";
person.LastUpdateFullName = FullName ?? "System Administrator"; person.LastUpdateFullName = FullName ?? "System Administrator";
person.LastUpdateUserId = UserId ?? ""; person.LastUpdateUserId = UserId ?? "";
person.LastUpdatedAt = DateTime.Now; person.LastUpdatedAt = DateTime.Now;
person.root = null; //person.root = null;
person.rootId = null; //person.rootId = null;
person.rootDnaId = null; //person.rootDnaId = null;
person.rootShortName = null; //person.rootShortName = null;
person.child1 = null; //person.child1 = null;
person.child1Id = null; //person.child1Id = null;
person.child1DnaId = null; //person.child1DnaId = null;
person.child1ShortName = null; //person.child1ShortName = null;
person.child2 = null; //person.child2 = null;
person.child2Id = null; //person.child2Id = null;
person.child2Id = null; //person.child2Id = null;
person.child2ShortName = null; //person.child2ShortName = null;
person.child3 = null; //person.child3 = null;
person.child3Id = null; //person.child3Id = null;
person.child3DnaId = null; //person.child3DnaId = null;
person.child3ShortName = null; //person.child3ShortName = null;
person.child4 = null; //person.child4 = null;
person.child4Id = null; //person.child4Id = null;
person.child4DnaId = null; //person.child4DnaId = null;
person.child4ShortName = null; //person.child4ShortName = null;
person.orgRevisionId = null; //person.orgRevisionId = null;
person.posMasterNo = null; //person.posMasterNo = null;
//person.positionName = null; //person.positionName = null;
person.positionField = null; //person.positionField = null;
person.posTypeId = null; //person.posTypeId = null;
person.posTypeName = null; //person.posTypeName = null;
person.posLevelId = null; //person.posLevelId = null;
person.posLevelName = null; //person.posLevelName = null;
person.node = null; //person.node = null;
person.nodeId = null; //person.nodeId = null;
person.posmasterId = null; //person.posmasterId = null;
person.positionId = null; //person.positionId = null;
person.Draft = _nullBool; //person.Draft = _nullBool;
person.typeCommand = null; //person.typeCommand = null;
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
return Success(); return Success();
@ -911,7 +911,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new var _res = await client.PostAsJsonAsync(apiUrl, new
{ {
@ -950,7 +950,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _resUpdate = await client.PostAsJsonAsync(apiUrlUpdate, new var _resUpdate = await client.PostAsJsonAsync(apiUrlUpdate, new
{ {
posMasterId = req.posmasterId, posMasterId = req.posmasterId,
@ -982,7 +982,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -1319,7 +1319,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _resUpdate = await client.PostAsJsonAsync(apiUrlUpdate, new var _resUpdate = await client.PostAsJsonAsync(apiUrlUpdate, new
{ {
posMasterId = profile.posmasterId, posMasterId = profile.posmasterId,
@ -1869,7 +1869,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new var _res = await client.PostAsJsonAsync(apiUrl, new
{ {
@ -2225,7 +2225,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new var _res = await client.PostAsJsonAsync(apiUrl, new
{ {
@ -2485,7 +2485,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -2721,7 +2721,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -2942,7 +2942,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,

View file

@ -204,7 +204,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -422,7 +422,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -780,7 +780,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,

View file

@ -520,7 +520,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -701,7 +701,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new var _res = await client.PostAsJsonAsync(apiUrl, new
{ {
@ -740,7 +740,7 @@ namespace BMA.EHR.Placement.Service.Controllers
// using (var client = new HttpClient()) // using (var client = new HttpClient())
// { // {
// client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
// client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); // client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
// var _resUpdate = await client.PostAsJsonAsync(apiUrlUpdate, new // var _resUpdate = await client.PostAsJsonAsync(apiUrlUpdate, new
// { // {
// posMasterOldId = uppdated.posmasterId, // posMasterOldId = uppdated.posmasterId,
@ -1203,7 +1203,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,

View file

@ -304,7 +304,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -367,7 +367,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
refId = req.OfficerId ?? Guid.Parse("00000000-0000-0000-0000-000000000000"), refId = req.OfficerId ?? Guid.Parse("00000000-0000-0000-0000-000000000000"),
@ -474,7 +474,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
refId = deleted.refId ?? Guid.Parse("00000000-0000-0000-0000-000000000000"), refId = deleted.refId ?? Guid.Parse("00000000-0000-0000-0000-000000000000"),
@ -647,7 +647,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,

View file

@ -83,7 +83,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -554,7 +554,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -645,7 +645,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
refId = placementTransfer.Id, refId = placementTransfer.Id,
@ -977,7 +977,7 @@ namespace BMA.EHR.Placement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,

View file

@ -271,7 +271,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -288,7 +288,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -312,7 +312,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, _apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -1346,7 +1346,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
{ {
client.DefaultRequestHeaders.Authorization = client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();

View file

@ -300,7 +300,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -353,7 +353,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, _apiUrl); var _req = new HttpRequestMessage(HttpMethod.Post, _apiUrl);
var _res = await client.PostAsJsonAsync(_apiUrl, new var _res = await client.PostAsJsonAsync(_apiUrl, new
{ {
@ -370,7 +370,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -420,7 +420,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, _apiUrl); var _req = new HttpRequestMessage(HttpMethod.Post, _apiUrl);
var _res = await client.PostAsJsonAsync(_apiUrl, new var _res = await client.PostAsJsonAsync(_apiUrl, new
{ {
@ -469,7 +469,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(pathUrl, new var _res = await client.PostAsJsonAsync(pathUrl, new
{ {
persons = new List<object> persons = new List<object>
@ -705,7 +705,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -734,7 +734,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
// using (var client = new HttpClient()) // using (var client = new HttpClient())
// { // {
// client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
// client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); // client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
// var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); // var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
// var _res = await client.SendAsync(_req); // var _res = await client.SendAsync(_req);
// var _result = await _res.Content.ReadAsStringAsync(); // var _result = await _res.Content.ReadAsStringAsync();

View file

@ -377,7 +377,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -493,7 +493,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Post, apiUrl);
var _res = await client.PostAsJsonAsync(apiUrl, new var _res = await client.PostAsJsonAsync(apiUrl, new
{ {
@ -531,7 +531,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
// using (var client = new HttpClient()) // using (var client = new HttpClient())
// { // {
// client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
// client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); // client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
// var _resUpdate = await client.PostAsJsonAsync(apiUrlUpdate, new // var _resUpdate = await client.PostAsJsonAsync(apiUrlUpdate, new
// { // {
// posMasterOldId = uppdated.posmasterId, // posMasterOldId = uppdated.posmasterId,
@ -886,7 +886,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -1131,7 +1131,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,

View file

@ -305,7 +305,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -370,7 +370,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -661,7 +661,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,

View file

@ -139,7 +139,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -189,7 +189,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -1371,7 +1371,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -1748,7 +1748,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.DeleteAsync($"{_configuration["API"]}/org/command/tab2Cancel17/{updated.Id}"); var _res = await client.DeleteAsync($"{_configuration["API"]}/org/command/tab2Cancel17/{updated.Id}");
} }
updated.Status = "CANCEL"; updated.Status = "CANCEL";
@ -2326,7 +2326,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var apiUrl = $"{_configuration["API"]}/org/profile/profileid/position/{retirementResign.profileId}"; var apiUrl = $"{_configuration["API"]}/org/profile/profileid/position/{retirementResign.profileId}";
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
@ -2872,7 +2872,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -3077,7 +3077,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -3097,7 +3097,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
resignId = resultData.Select(x => x.resignId).ToList(), resignId = resultData.Select(x => x.resignId).ToList(),

View file

@ -78,7 +78,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -128,7 +128,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -1312,7 +1312,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
var _result = await _res.Content.ReadAsStringAsync(); var _result = await _res.Content.ReadAsStringAsync();
@ -1408,7 +1408,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
// using (var client = new HttpClient()) // using (var client = new HttpClient())
// { // {
// client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
// client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); // client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
// var _res = await client.PostAsJsonAsync($"{_configuration["API"]}/org/workflow/add-workflow", new // var _res = await client.PostAsJsonAsync($"{_configuration["API"]}/org/workflow/add-workflow", new
// { // {
// refId = retirementResignEmployee.Id, // refId = retirementResignEmployee.Id,
@ -1666,7 +1666,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.DeleteAsync($"{_configuration["API"]}/org/command/tab2Cancel23/{updated.Id}"); var _res = await client.DeleteAsync($"{_configuration["API"]}/org/command/tab2Cancel23/{updated.Id}");
} }
updated.Status = "CANCEL"; updated.Status = "CANCEL";
@ -2165,7 +2165,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var apiUrl = $"{_configuration["API"]}/org/profile-employee/profileid/position/{retirementResign.profileId}"; var apiUrl = $"{_configuration["API"]}/org/profile-employee/profileid/position/{retirementResign.profileId}";
var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl); var _req = new HttpRequestMessage(HttpMethod.Get, apiUrl);
var _res = await client.SendAsync(_req); var _res = await client.SendAsync(_req);
@ -2372,7 +2372,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -2574,7 +2574,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
data = resultData, data = resultData,
@ -2594,7 +2594,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
using (var client = new HttpClient()) using (var client = new HttpClient())
{ {
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); client.DefaultRequestHeaders.Add("api-key", _configuration["API_KEY"]);
var _res = await client.PostAsJsonAsync(apiUrlOrg, new var _res = await client.PostAsJsonAsync(apiUrlOrg, new
{ {
resignId = resultData.Select(x => x.resignId).ToList(), resignId = resultData.Select(x => x.resignId).ToList(),