From 5c7a655a6623e11eb42e3021f07e30cbd0e1edfa Mon Sep 17 00:00:00 2001 From: Kittapath Date: Wed, 29 Mar 2023 01:00:43 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=95=E0=B8=B1=E0=B8=94=20step=20=E0=B8=88?= =?UTF-8?q?=E0=B8=B1=E0=B8=94=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B8=AA=E0=B8=AD?= =?UTF-8?q?=E0=B8=9A=E0=B8=AD=E0=B8=AD=E0=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controllers/CandidateController.cs | 2 +- Services/PeriodExamService.cs | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Controllers/CandidateController.cs b/Controllers/CandidateController.cs index a7fb576..2d235b0 100644 --- a/Controllers/CandidateController.cs +++ b/Controllers/CandidateController.cs @@ -651,7 +651,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers { try { - await _candidateService.AdminCheckCandidateService(candidate, item.Status ? "checkSeat" : "rejectPayment", item); + await _candidateService.AdminCheckCandidateService(candidate, item.Status ? "done" : "rejectPayment", item); return Success(); } diff --git a/Services/PeriodExamService.cs b/Services/PeriodExamService.cs index ffa9ca9..789d2d8 100644 --- a/Services/PeriodExamService.cs +++ b/Services/PeriodExamService.cs @@ -129,9 +129,18 @@ namespace BMA.EHR.Recurit.Exam.Service.Services if (periodExam == null) throw new Exception(GlobalMessages.ExamNotFound); - return await _context.Candidates.AsQueryable() - .Where(x => x.PeriodExam == periodExam && x.Status == status) - .ToListAsync(); + if (status == "all") + { + return await _context.Candidates.AsQueryable() + .Where(x => x.PeriodExam == periodExam && x.Status != "register" && x.Status != "rejectRegister") + .ToListAsync(); + } + else + { + return await _context.Candidates.AsQueryable() + .Where(x => x.PeriodExam == periodExam && x.Status == status) + .ToListAsync(); + } } #endregion