api ใบสรุปสมัครสอบ

This commit is contained in:
Kittapath 2023-04-06 22:50:53 +07:00
parent ab86c20b84
commit 9f115e3c72
5 changed files with 106 additions and 15 deletions

View file

@ -622,10 +622,22 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
if (periodExam == null)
throw new Exception(GlobalMessages.ExamNotFound);
var candidates = await _context.Candidates
.AsQueryable()
.Where(x => x.PeriodExam == periodExam)
.ToListAsync();
var candidates = new List<Candidate>();
if (periodExam.SetSeat == true)
{
candidates = await _context.Candidates
.AsQueryable()
.Where(x => x.PeriodExam == periodExam)
.Where(x => x.Status != "waiver")
.ToListAsync();
}
else
{
candidates = await _context.Candidates
.AsQueryable()
.Where(x => x.PeriodExam == periodExam)
.ToListAsync();
}
var stream = new MemoryStream();
using (var package = new ExcelPackage(stream))