Compare commits

..

No commits in common. "7e446bcc80716a8e170bb19998be2ec268b320bc" and "60cc6fde8533b4920603f309a231f515813ca2ba" have entirely different histories.

2 changed files with 26 additions and 26 deletions

View file

@ -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();
}

View file

@ -667,8 +667,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
EditorConfirm = exam.EditorConfirm,
Position = candidatePosition == null ? false : true,
//CanRegister = exam.RegisterStartDate == null || exam.RegisterEndDate == null ? true : DateOnly.FromDateTime(exam.RegisterStartDate.Value) <= DateOnly.FromDateTime(DateTime.Now) && DateOnly.FromDateTime(exam.RegisterEndDate.Value) >= DateOnly.FromDateTime(DateTime.Now),
CanRegister = exam.RegisterStartDate == null || exam.RegisterEndDate == null
? true
CanRegister = exam.RegisterStartDate == null || exam.RegisterEndDate == null
? true
: exam.RegisterStartDate.Value <= DateTime.Now && exam.RegisterEndDate.Value >= DateTime.Now,
RegisterEndDate = exam.RegisterEndDate,
RegisterStartDate = exam.RegisterStartDate,
@ -2282,7 +2282,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
var periodExam = await _context.PeriodExams.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == examGuid);
if (periodExam == null)
if (periodExam == null)
throw new Exception(GlobalMessages.ExamNotFound);
var candidates = await _context.Candidates.AsQueryable()
@ -2594,12 +2594,12 @@ 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);
@ -2630,27 +2630,27 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
// 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)
.FirstOrDefaultAsync();
if (candidate2 != null)
throw new Exception(GlobalMessages.CitizanDupicate);
//var candidate2 = await _context.Candidates.AsQueryable()
// .Where(x => x.PeriodExam == exam && x.UserId != UserId && x.CitizenId == citizenId)
// .FirstOrDefaultAsync();
//if (candidate2 != null)
// throw new Exception(GlobalMessages.CitizanDupicate);
}
public async Task GetExamCandidateAsync(Guid id)