From b98b02ac980105c9ee18c2e15c126c6e21e4707c Mon Sep 17 00:00:00 2001 From: kittapath Date: Tue, 5 Nov 2024 14:16:13 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20list=20=E0=B8=A3?= =?UTF-8?q?=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B9=80=E0=B8=81?= =?UTF-8?q?=E0=B8=A9=E0=B8=B5=E0=B8=A2=E0=B8=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/RetirementDeceasedController.cs | 3 +-- .../Controllers/RetirementDischargeController.cs | 3 --- .../Controllers/RetirementExpulsionController.cs | 4 ---- .../Controllers/RetirementOtherController.cs | 14 +++++++------- .../Controllers/RetirementOutController.cs | 3 +-- 5 files changed, 9 insertions(+), 18 deletions(-) diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs index d34ebe94..01bcd391 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementDeceasedController.cs @@ -68,7 +68,6 @@ namespace BMA.EHR.Retirement.Service.Controllers private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value; private string? token => _httpContextAccessor?.HttpContext?.Request.Headers["Authorization"]; - private bool? RetirementAdmin => _httpContextAccessor?.HttpContext?.User?.IsInRole("placement1"); #endregion /// @@ -114,7 +113,7 @@ namespace BMA.EHR.Retirement.Service.Controllers var retirementDeceaseds = await _context.RetirementDeceaseds.AsQueryable() .OrderByDescending(x => x.CreatedAt) - .Where(x => RetirementAdmin == true ? true : (rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id)))))) + .Where(x => rootId == "" ? true : (child1Id == "" ? x.rootId == rootId : (child2Id == "" ? x.child1Id == child1Id : (child3Id == "" ? x.child2Id == child2Id : (child4Id == "" ? x.child3Id == child3Id : x.child4Id == child4Id))))) .Select(p => new { p.Id, diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementDischargeController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementDischargeController.cs index 83b36b6a..c374e975 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementDischargeController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementDischargeController.cs @@ -46,7 +46,6 @@ namespace BMA.EHR.Retirement.Service.Controllers private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value; - private bool? RetirementAdmin => _httpContextAccessor?.HttpContext?.User?.IsInRole("placement1"); #endregion @@ -86,8 +85,6 @@ namespace BMA.EHR.Retirement.Service.Controllers p.IsActive, }) .ToListAsync(); - if (RetirementAdmin == true) - retirementDischarges.Where(x => x.Status.Trim().ToUpper().Contains("APPROVE")); return Success(retirementDischarges); } diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementExpulsionController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementExpulsionController.cs index 285850e0..92bc9a25 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementExpulsionController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementExpulsionController.cs @@ -46,8 +46,6 @@ namespace BMA.EHR.Retirement.Service.Controllers private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value; - private bool? RetirementAdmin => _httpContextAccessor?.HttpContext?.User?.IsInRole("placement1"); - #endregion /// @@ -86,8 +84,6 @@ namespace BMA.EHR.Retirement.Service.Controllers p.IsActive, }) .ToListAsync(); - if (RetirementAdmin == true) - retirementExpulsions.Where(x => x.Status.Trim().ToUpper().Contains("APPROVE")); return Success(retirementExpulsions); } diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs index 0f6f6e66..e892e1ce 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs @@ -57,8 +57,6 @@ namespace BMA.EHR.Retirement.Service.Controllers private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value; private string? token => _httpContextAccessor?.HttpContext?.Request.Headers["Authorization"]; - private bool? RetirementAdmin => _httpContextAccessor?.HttpContext?.User?.IsInRole("placement1"); - #endregion /// @@ -105,7 +103,7 @@ namespace BMA.EHR.Retirement.Service.Controllers var retirementOthers = await _context.RetirementOthers.AsQueryable() .OrderByDescending(x => x.CreatedAt) - .Where(x => RetirementAdmin == true ? true : (rootId == "" ? true : (child1Id == "" ? x.rootOldId == rootId : (child2Id == "" ? x.child1OldId == child1Id : (child3Id == "" ? x.child2OldId == child2Id : (child4Id == "" ? x.child3OldId == child3Id : x.child4OldId == child4Id)))))) + .Where(x => rootId == "" ? true : (child1Id == "" ? x.rootOldId == rootId : (child2Id == "" ? x.child1OldId == child1Id : (child3Id == "" ? x.child2OldId == child2Id : (child4Id == "" ? x.child3OldId == child3Id : x.child4OldId == child4Id))))) .Select(p => new { p.Id, @@ -720,7 +718,8 @@ namespace BMA.EHR.Retirement.Service.Controllers { result.Add(r); string? _null = null; - result.Add(new { + result.Add(new + { No = _null, FullName = r.RemarkHorizontal, Education = _null, @@ -735,7 +734,7 @@ namespace BMA.EHR.Retirement.Service.Controllers NewPositionLevel = _null, NewPositionNumber = _null, NewSalary = _null, - AppointDate = _null, + AppointDate = _null, RemarkHorizontal = _null, RemarkVertical = _null, }); @@ -920,7 +919,8 @@ namespace BMA.EHR.Retirement.Service.Controllers { result.Add(r); string? _null = null; - result.Add(new { + result.Add(new + { No = _null, FullName = r.RemarkHorizontal, Education = _null, @@ -936,7 +936,7 @@ namespace BMA.EHR.Retirement.Service.Controllers NewPositionLevel = _null, NewPositionNumber = _null, NewSalary = _null, - AppointDate = _null, + AppointDate = _null, RemarkHorizontal = _null, RemarkVertical = _null, }); diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs index c442f029..9935f956 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs @@ -57,7 +57,6 @@ namespace BMA.EHR.Retirement.Service.Controllers private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value; private string? token => _httpContextAccessor?.HttpContext?.Request.Headers["Authorization"]; - private bool? RetirementAdmin => _httpContextAccessor?.HttpContext?.User?.IsInRole("placement1"); #endregion @@ -104,7 +103,7 @@ namespace BMA.EHR.Retirement.Service.Controllers var retirementOuts = await _context.RetirementOuts.AsQueryable() .OrderByDescending(x => x.CreatedAt) - .Where(x => RetirementAdmin == true ? true : (rootId == "" ? true : (child1Id == "" ? x.rootOldId == rootId : (child2Id == "" ? x.child1OldId == child1Id : (child3Id == "" ? x.child2OldId == child2Id : (child4Id == "" ? x.child3OldId == child3Id : x.child4OldId == child4Id)))))) + .Where(x => rootId == "" ? true : (child1Id == "" ? x.rootOldId == rootId : (child2Id == "" ? x.child1OldId == child1Id : (child3Id == "" ? x.child2OldId == child2Id : (child4Id == "" ? x.child3OldId == child3Id : x.child4OldId == child4Id))))) .Select(p => new { p.Id,