From 53da74d3226994157beff9780ae632da5c746b03 Mon Sep 17 00:00:00 2001 From: harid Date: Thu, 18 Dec 2025 16:18:51 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=AA=E0=B8=A1=E0=B8=B1=E0=B8=84=E0=B8=A3?= =?UTF-8?q?=E0=B8=AA=E0=B8=AD=E0=B8=9A=E0=B9=80=E0=B8=8A=E0=B9=87=E0=B8=84?= =?UTF-8?q?=E0=B9=80=E0=B8=A5=E0=B8=82=E0=B8=9A=E0=B8=B1=E0=B8=95=E0=B8=A3?= =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=8A=E0=B8=B2=E0=B8=8A=E0=B8=99?= =?UTF-8?q?=20+=20Status=20(=E0=B8=82=E0=B8=B1=E0=B9=89=E0=B8=99=E0=B8=95?= =?UTF-8?q?=E0=B8=AD=E0=B8=99=E0=B8=81=E0=B8=94=E0=B8=AA=E0=B9=88=E0=B8=87?= =?UTF-8?q?=E0=B9=83=E0=B8=9A=E0=B8=AA=E0=B8=A1=E0=B8=B1=E0=B8=84=E0=B8=A3?= =?UTF-8?q?)=20#2136?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Services/CandidateService.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Services/CandidateService.cs b/Services/CandidateService.cs index dd90ae6..fc1ba9f 100644 --- a/Services/CandidateService.cs +++ b/Services/CandidateService.cs @@ -2025,6 +2025,21 @@ namespace BMA.EHR.Recurit.Exam.Service.Services if (status == "checkRegister") { + // เช็คเลขบัตรซ้ำ + var candidate2 = await _context.Candidates.AsQueryable() + .Where(x => + x.PeriodExam == exam + && x.UserId != UserId + && x.CitizenId == candidate.CitizenId + && ( + (exam.Fee > 0 && x.Status.Trim().ToUpper() != "REGISTER") + || (exam.Fee == 0 && x.Status.Trim().ToUpper() == "CHECKSEAT") + ) + ) + .FirstOrDefaultAsync(); + if (candidate2 != null) + throw new Exception(GlobalMessages.CitizanDupicate); + var subject = "แจ้งผลการสมัครสอบคัดเลือก " + exam.Name; var body = candidate.FirstName + " " + candidate.LastName + " สถานะการสมัครสอบ: ได้รับใบสมัครแล้ว"; if (candidate.Email != null && candidate.Email != "") _mailService.SendMailToUser(subject, body, candidate.Email);