สมัครสอบเช็คเลขบัตรประชาชน + Status (ขั้นตอนกดส่งใบสมัคร) #2136
This commit is contained in:
parent
0304e0594c
commit
53da74d322
1 changed files with 15 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue