เพิ่มฟิลที่นั่งสอบ

This commit is contained in:
Kittapath 2023-03-29 12:55:20 +07:00
parent 5c7a655a66
commit a93dcbbd20
10 changed files with 1285 additions and 15 deletions

View file

@ -243,6 +243,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
if (exam == null)
throw new Exception(GlobalMessages.ExamNotFound);
var _candidateNumber = await _context.Candidates.AsQueryable()
.CountAsync(x => x.PeriodExam == exam);
var _candidate = await _context.Candidates.AsQueryable()
.FirstOrDefaultAsync(x => x.PeriodExam == exam && x.UserId == UserId);
if (_candidate == null)
@ -257,6 +260,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
CreatedFullName = FullName ?? "",
LastUpdateFullName = FullName ?? "",
UserId = UserId ?? "",
SeatNumber = "CDC-" + (_candidateNumber + 1),
};
await _context.Candidates.AddAsync(candidate);