From 777f4d093070cb2b65580d471d7f837c72376b63 Mon Sep 17 00:00:00 2001 From: Bright Date: Mon, 29 Sep 2025 13:44:35 +0700 Subject: [PATCH] no message --- .../Controllers/RetirementResignController.cs | 40 +++++++++---------- .../RetirementResignEmployeeController.cs | 40 +++++++++---------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs index d4cd4377..b7eb02a9 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs @@ -3076,26 +3076,26 @@ namespace BMA.EHR.Retirement.Service.Controllers } } } - //else - //{ - // var apiUrlOrg = $"{baseAPIOrg}/org/command/cancel-resign"; - // using (var client = new HttpClient()) - // { - // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); - // client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); - // var _res = await client.PostAsJsonAsync(apiUrlOrg, new - // { - // commandId = resultData.Select(x => x.commandId).ToList(), - // }); - // var _result = await _res.Content.ReadAsStringAsync(); - // if (_res.IsSuccessStatusCode) - // { - // data.ForEach(profile => profile.Status = "DONE"); - // data.ForEach(profile => profile.RetirementResign.Status = "CANCEL"); - // await _context.SaveChangesAsync(); - // } - // } - //} + else + { + var apiUrlOrg = $"{baseAPIOrg}/org/command/cancel-resign"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); + var _res = await client.PostAsJsonAsync(apiUrlOrg, new + { + commandId = resultData.Select(x => x.commandId).ToList(), + }); + var _result = await _res.Content.ReadAsStringAsync(); + if (_res.IsSuccessStatusCode) + { + data.ForEach(profile => profile.Status = "DONE"); + data.ForEach(profile => profile.RetirementResign.Status = "CANCEL"); + await _context.SaveChangesAsync(); + } + } + } return Success(); } diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs index 6c46d608..9157b947 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignEmployeeController.cs @@ -2572,26 +2572,26 @@ namespace BMA.EHR.Retirement.Service.Controllers } } } - //else - //{ - // var apiUrlOrg = $"{baseAPIOrg}/org/command/cancel-resign"; - // using (var client = new HttpClient()) - // { - // client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); - // client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); - // var _res = await client.PostAsJsonAsync(apiUrlOrg, new - // { - // commandId = resultData.Select(x => x.commandId).ToList(), - // }); - // var _result = await _res.Content.ReadAsStringAsync(); - // if (_res.IsSuccessStatusCode) - // { - // data.ForEach(profile => profile.Status = "DONE"); - // data.ForEach(profile => profile.RetirementResignEmployee.Status = "CANCEL"); - // await _context.SaveChangesAsync(); - // } - // } - //} + else + { + var apiUrlOrg = $"{baseAPIOrg}/org/command/cancel-resign"; + using (var client = new HttpClient()) + { + client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", "")); + client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]); + var _res = await client.PostAsJsonAsync(apiUrlOrg, new + { + commandId = resultData.Select(x => x.commandId).ToList(), + }); + var _result = await _res.Content.ReadAsStringAsync(); + if (_res.IsSuccessStatusCode) + { + data.ForEach(profile => profile.Status = "DONE"); + data.ForEach(profile => profile.RetirementResignEmployee.Status = "CANCEL"); + await _context.SaveChangesAsync(); + } + } + } return Success(); }