From 089e70c7c7be7167377caa66c547d18db3a93df1 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Tue, 6 May 2025 19:40:22 +0700 Subject: [PATCH] fix #901 --- .../Repositories/InsigniaPeriodsRepository.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/BMA.EHR.Application/Repositories/InsigniaPeriodsRepository.cs b/BMA.EHR.Application/Repositories/InsigniaPeriodsRepository.cs index f11ba201..36efbad8 100644 --- a/BMA.EHR.Application/Repositories/InsigniaPeriodsRepository.cs +++ b/BMA.EHR.Application/Repositories/InsigniaPeriodsRepository.cs @@ -7793,6 +7793,18 @@ namespace BMA.EHR.Application.Repositories // result_candidate.Add(r); //} + if (period.Round != 1) + { + var insigniaIdList = await _dbContext.Set() + .Include(x => x.InsigniaType) + .Where(x => x.InsigniaType!.Name == "ชั้นสายสะพาย") + .Select(x => x.Id) + .ToListAsync(); + + + result_candidate = result_candidate.Where(x => insigniaIdList.Contains(x.RequestInsignia.Id)).ToList(); + } + return result_candidate.OrderBy(x => x.Seq).ThenBy(x => x.Gender).ThenBy(x => x.ProfileId).ToList(); } catch