From d3aee47315b4f494a6e1b9f4fcaddd717958289a Mon Sep 17 00:00:00 2001 From: harid Date: Wed, 17 Dec 2025 09:13:04 +0700 Subject: [PATCH] no message --- Controllers/CandidateController.cs | 2 +- Services/CandidateService.cs | 82 +++++++++++++++--------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/Controllers/CandidateController.cs b/Controllers/CandidateController.cs index f6852cb..4d9e7ba 100644 --- a/Controllers/CandidateController.cs +++ b/Controllers/CandidateController.cs @@ -1575,7 +1575,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers { try { - await _candidateService.CheckCitizen(examId, positionId, item.CitizenId); + // await _candidateService.CheckCitizen(examId, positionId, item.CitizenId); return Success(); } diff --git a/Services/CandidateService.cs b/Services/CandidateService.cs index 4a07e37..fabd363 100644 --- a/Services/CandidateService.cs +++ b/Services/CandidateService.cs @@ -2594,57 +2594,57 @@ namespace BMA.EHR.Recurit.Exam.Service.Services public async Task CheckCitizen(string examId, string positionId, string citizenId) { - var exam = await _context.PeriodExams.AsQueryable() - .Where(p => p.CheckDisability == false) - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(examId)); + // var exam = await _context.PeriodExams.AsQueryable() + // .Where(p => p.CheckDisability == false) + // .FirstOrDefaultAsync(x => x.Id == Guid.Parse(examId)); - if (exam == null) - throw new Exception(GlobalMessages.ExamNotFound); + // if (exam == null) + // throw new Exception(GlobalMessages.ExamNotFound); - if (citizenId.Length != 13) - throw new Exception(GlobalMessages.CitizenIncomplete); + // if (citizenId.Length != 13) + // throw new Exception(GlobalMessages.CitizenIncomplete); - int[] citizenIdDigits = citizenId.Select(c => int.Parse(c.ToString())).ToArray(); - int cal = - citizenIdDigits[0] * 13 + - citizenIdDigits[1] * 12 + - citizenIdDigits[2] * 11 + - citizenIdDigits[3] * 10 + - citizenIdDigits[4] * 9 + - citizenIdDigits[5] * 8 + - citizenIdDigits[6] * 7 + - citizenIdDigits[7] * 6 + - citizenIdDigits[8] * 5 + - citizenIdDigits[9] * 4 + - citizenIdDigits[10] * 3 + - citizenIdDigits[11] * 2; + // int[] citizenIdDigits = citizenId.Select(c => int.Parse(c.ToString())).ToArray(); + // int cal = + // citizenIdDigits[0] * 13 + + // citizenIdDigits[1] * 12 + + // citizenIdDigits[2] * 11 + + // citizenIdDigits[3] * 10 + + // citizenIdDigits[4] * 9 + + // citizenIdDigits[5] * 8 + + // citizenIdDigits[6] * 7 + + // citizenIdDigits[7] * 6 + + // citizenIdDigits[8] * 5 + + // citizenIdDigits[9] * 4 + + // citizenIdDigits[10] * 3 + + // citizenIdDigits[11] * 2; - int calStp2 = cal % 11; - int chkDigit = 11 - calStp2; + // int calStp2 = cal % 11; + // int chkDigit = 11 - calStp2; - if (chkDigit >= 10) - { - chkDigit = 0; - } + // if (chkDigit >= 10) + // { + // chkDigit = 0; + // } - if (citizenIdDigits[12] != chkDigit) - throw new Exception(GlobalMessages.CitizenIncorrect); + // if (citizenIdDigits[12] != chkDigit) + // throw new Exception(GlobalMessages.CitizenIncorrect); - if (positionId != "00000000-0000-0000-0000-000000000000") - { - var position = await _context.PositionExams.AsQueryable() - .FirstOrDefaultAsync(x => x.Id == Guid.Parse(positionId) && x.PeriodExam == exam); + // if (positionId != "00000000-0000-0000-0000-000000000000") + // { + // var position = await _context.PositionExams.AsQueryable() + // .FirstOrDefaultAsync(x => x.Id == Guid.Parse(positionId) && x.PeriodExam == exam); - if (position == null) - throw new Exception(GlobalMessages.PositionExamNotFound); + // if (position == null) + // throw new Exception(GlobalMessages.PositionExamNotFound); - var candidate1 = await _context.Candidates.AsQueryable() - .Where(x => x.PeriodExam == exam && x.UserId != UserId /*&& x.PositionExam == position*/ && x.CitizenId == citizenId) - .FirstOrDefaultAsync(); - if (candidate1 != null) - throw new Exception(GlobalMessages.CitizanDupicate); + // var candidate1 = await _context.Candidates.AsQueryable() + // .Where(x => x.PeriodExam == exam && x.UserId != UserId /*&& x.PositionExam == position*/ && x.CitizenId == citizenId) + // .FirstOrDefaultAsync(); + // if (candidate1 != null) + // throw new Exception(GlobalMessages.CitizanDupicate); return; - } + // } //var candidate2 = await _context.Candidates.AsQueryable() // .Where(x => x.PeriodExam == exam && x.UserId != UserId && x.CitizenId == citizenId)