From ab4fb64f83636ac0d9cb7cbfb50e0b38c03e9da2 Mon Sep 17 00:00:00 2001 From: kittapath Date: Tue, 15 Oct 2024 14:22:30 +0700 Subject: [PATCH] no message --- .../Controllers/DisciplineResultController.cs | 8 ++++---- .../Controllers/PlacementController.cs | 19 +++++++++++++------ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs index e05bd0ad..ea26afc1 100644 --- a/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs @@ -1625,7 +1625,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates .Where(x => req.refIds.Contains(x.Id.ToString())) .ToListAsync(); - data.ForEach(profile => profile.StatusDiscard = "REPORT"); + data.ForEach(profile => profile.Status = "REPORT"); await _context.SaveChangesAsync(); return Success(); } @@ -1650,9 +1650,9 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers { var data = await _context.DisciplineDisciplinary_ProfileComplaintInvestigates .Where(x => req.refIds.Contains(x.Id.ToString())) - // .Where(x => x.StatusDiscard.ToUpper() == "REPORT") + // .Where(x => x.Status.ToUpper() == "REPORT") .ToListAsync(); - data.ForEach(profile => profile.StatusDiscard = "NEW"); + data.ForEach(profile => profile.Status = "NEW"); await _context.SaveChangesAsync(); return Success(); } @@ -1709,7 +1709,7 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers var _result = await _res.Content.ReadAsStringAsync(); if (_res.IsSuccessStatusCode) { - data.ForEach(profile => { profile.StatusDiscard = "NEW"; profile.CommandTypeId = null; }); + data.ForEach(profile => { profile.Status = "NEW"; profile.CommandTypeId = null; }); await _context.SaveChangesAsync(); } } diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs index 170de44a..339c8281 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs @@ -1710,11 +1710,13 @@ namespace BMA.EHR.Placement.Service.Controllers data = resultData }); var _result = await _res.Content.ReadAsStringAsync(); + if (_res.IsSuccessStatusCode) + { + placementProfile.ForEach(profile => profile.PlacementStatus = "DONE"); + await _context.SaveChangesAsync(); + } } - // update placementstatus - placementProfile.ForEach(profile => profile.PlacementStatus = "DONE"); - await _context.SaveChangesAsync(); return Success(); } catch @@ -1966,11 +1968,16 @@ namespace BMA.EHR.Placement.Service.Controllers data = resultData }); var _result = await _res.Content.ReadAsStringAsync(); + if (_res.IsSuccessStatusCode) + { + placementProfile.ForEach(profile => profile.PlacementStatus = "DONE"); + await _context.SaveChangesAsync(); + } } - // update placementstatus - placementProfile.ForEach(profile => profile.PlacementStatus = "DONE"); - await _context.SaveChangesAsync(); + // // update placementstatus + // placementProfile.ForEach(profile => profile.PlacementStatus = "DONE"); + // await _context.SaveChangesAsync(); return Success(); } catch