From 3b58d38eb1fc24876861eff957de4f69d547aae6 Mon Sep 17 00:00:00 2001 From: harid Date: Mon, 22 Dec 2025 09:49:59 +0700 Subject: [PATCH] add filter status #2083 --- .../Controllers/DisciplineSuspendController.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineSuspendController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineSuspendController.cs index de2c7ab2..9b32b1eb 100644 --- a/BMA.EHR.Discipline.Service/Controllers/DisciplineSuspendController.cs +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineSuspendController.cs @@ -59,7 +59,7 @@ namespace BMA.EHR.DisciplineSuspend.Service.Controllers /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet()] - public async Task> GetDisciplineSuspend(DateTime? startDate, DateTime? endDate, int page = 1, int pageSize = 25, string keyword = "", string profileType = "", string? sortBy = "", bool? descending = false) + public async Task> GetDisciplineSuspend(DateTime? startDate, DateTime? endDate, int page = 1, int pageSize = 25, string keyword = "", string profileType = "", string? sortBy = "", bool? descending = false, string? status="") { var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_DISCIPLINE_SUSPENDED"); var jsonData = JsonConvert.DeserializeObject(getPermission); @@ -78,7 +78,7 @@ namespace BMA.EHR.DisciplineSuspend.Service.Controllers ) : true ) - && + && ( (x.CitizenId != null && x.CitizenId.Contains(keyword)) || ((x.Prefix ?? "") + (x.FirstName ?? "") + " " + (x.LastName ?? "")).Contains(keyword) || @@ -94,6 +94,10 @@ namespace BMA.EHR.DisciplineSuspend.Service.Controllers (profileType.ToUpper() == "OFFICER" && x.profileType == "OFFICER") || (profileType.ToUpper() == "EMPLOYEE" && x.profileType == "EMPLOYEE") ) + && + ( + !string.IsNullOrEmpty(status) ? x.Status!.Trim().ToUpper() == status : true + ) select x).ToList(); var query = data_search .Select(x => new