From e94eb0f3e96eb47cb60f975c11be4a3caa92a533 Mon Sep 17 00:00:00 2001 From: Bright Date: Wed, 8 Jan 2025 17:46:00 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20report?= =?UTF-8?q?=20=E0=B8=A3=E0=B8=B0=E0=B8=9A=E0=B8=9A=E0=B8=AA=E0=B8=A3?= =?UTF-8?q?=E0=B8=A3=E0=B8=AB=E0=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controllers/PeriodExamController.cs | 30 +- Services/PeriodExamService.cs | 445 ++++++++++++++++++++++++++++ 2 files changed, 463 insertions(+), 12 deletions(-) diff --git a/Controllers/PeriodExamController.cs b/Controllers/PeriodExamController.cs index c188468..b0e2c44 100644 --- a/Controllers/PeriodExamController.cs +++ b/Controllers/PeriodExamController.cs @@ -731,11 +731,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers { try { - var stream = await _periodExamService.DownloadCandidateAsync(examId); + //var stream = await _periodExamService.DownloadCandidateAsync(examId); - string excelName = $"Candidate_{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xlsx"; - return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", excelName); - // return Success(); + //string excelName = $"Candidate_{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xlsx"; + //return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", excelName); + + var data = await _periodExamService.NewDownloadCandidateAsync(examId); + return Success(data); } catch (Exception ex) { @@ -759,11 +761,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers { try { - var stream = await _periodExamService.DownloadCandidateAllAsync(examId); + //var stream = await _periodExamService.DownloadCandidateAllAsync(examId); - string excelName = $"Candidate_{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xlsx"; - return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", excelName); - // return Success(); + //string excelName = $"Candidate_{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xlsx"; + //return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", excelName); + + var data = await _periodExamService.NewDownloadCandidateAllAsync(examId); + return Success(data); } catch (Exception ex) { @@ -787,11 +791,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers { try { - var stream = await _periodExamService.GetsDashboardExamAsync(item, examId); + //var stream = await _periodExamService.GetsDashboardExamAsync(item, examId); - string excelName = $"Candidate_{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xlsx"; - return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", excelName); - // return Success(); + //string excelName = $"Candidate_{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xlsx"; + //return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", excelName); + + var data = await _periodExamService.NewGetsDashboardExamAsync(item, examId); + return Success(data); } catch (Exception ex) { diff --git a/Services/PeriodExamService.cs b/Services/PeriodExamService.cs index 74bd17f..ed286e5 100644 --- a/Services/PeriodExamService.cs +++ b/Services/PeriodExamService.cs @@ -1338,6 +1338,128 @@ namespace BMA.EHR.Recurit.Exam.Service.Services return stream; } + public async Task NewDownloadCandidateAsync(string examId) + { + var periodExam = await _context.PeriodExams.AsQueryable() + .Where(x => x.CheckDisability == false) + .FirstOrDefaultAsync(x => x.Id == Guid.Parse(examId)); + + if (periodExam == null) + throw new Exception(GlobalMessages.ExamNotFound); + + var candidates = new List(); + if (periodExam.SetSeat == true) + { + candidates = await _context.Candidates + .AsQueryable() + .Include(x => x.PositionExam) + .OrderBy(x => x.ExamIdenNumber) + .Where(x => x.PeriodExam == periodExam) + .Where(x => x.Status != "waiver") + .Where(x => x.Status != "register") + .ToListAsync(); + } + else + { + candidates = await _context.Candidates + .AsQueryable() + .Include(x => x.PositionExam) + .OrderBy(x => x.ExamIdenNumber) + .Where(x => x.PeriodExam == periodExam) + .Where(x => x.Status != "register") + .ToListAsync(); + } + var _data = new List(); + + if (candidates.Count > 0) + { + foreach (var item in candidates) + { + _data.Add(new + { + Number = item.Number != null ? item.Number.ToThaiNumber() : "-", + ExamIdenNumber = item.ExamIdenNumber != null ? item.ExamIdenNumber.ToString() : "-", + CitizenId = item.CitizenId != null ? item.CitizenId.ToThaiNumber() : "-", + SeatNumber = item.SeatNumber != null ? item.SeatNumber.ToThaiNumber() : "-", + PrefixName = item.PrefixName != null ? item.PrefixName.ToThaiNumber() : "-", + FullName = item.FirstName != null && item.LastName != null ? $"{item.FirstName} {item.LastName}" : "-", + PositionName = item.PositionExam != null && item.PositionExam?.PositionName != null ? item.PositionExam?.PositionName.ToThaiNumber() : "-", + PositionLevelName = item.PositionExam != null && item.PositionExam?.PositionLevelName != null ? item.PositionExam?.PositionLevelName.ToThaiNumber() : "-", + + PointPath1A = item.PointPath1A != null ? item.PointPath1A.ToThaiNumber() : "-", + PointPath2A = item.PointPath2A != null ? item.PointPath2A.ToThaiNumber() : "-", + PointPath3A = item.PointPath3A != null ? item.PointPath3A.ToThaiNumber() : "-", + PointA = item.PointA != null ? item.PointA.ToThaiNumber() : "-", + PointPerA = item.PointPerA != null ? item.PointPerA.ToThaiNumber() : "-", + ResultA = item.ResultA != null ? item.ResultA.ToThaiNumber() : "-", + + PointB = item.PointB != null ? item.PointB.ToThaiNumber() : "-", + PointPerB = item.PointPerB != null ? item.PointPerB.ToThaiNumber() : "-", + ResultB = item.ResultB != null ? item.ResultB.ToThaiNumber() : "-", + + PointPath1C = item.PointPath1C != null ? item.PointPath1C.ToThaiNumber() : "-", + PointPath2C = item.PointPath2C != null ? item.PointPath2C.ToThaiNumber() : "-", + PointC = item.PointC != null ? item.PointC.ToThaiNumber() : "-", + PointPerC = item.PointPerC != null ? item.PointPerC.ToThaiNumber() : "-", + ResultC = item.ResultC != null ? item.ResultC.ToThaiNumber() : "-", + + Pass = item.Pass != null ? item.Pass.ToThaiNumber() : "-", + PaymentStatus = item.PeriodExam == null || item.PeriodExam.Fee <= 0 ? "ไม่มีชำระเงิน" : (item.PaymentDate == null ? "ยังไม่ชำระเงิน" : "ชำระแล้ว"), + PaymentDate = item.PaymentDate == null ? "-" : $"{item.PaymentDate.Value.ToThaiShortDate()} {item.PaymentDate.Value:HH:mm:ss.ffff}".ToString().ToThaiNumber(), + RegisterDate = item.RegisterDate == null ? "-" : $"{item.RegisterDate.Value.ToThaiShortDate()} {item.RegisterDate.Value:HH:mm:ss.ffff}".ToString().ToThaiNumber(), + ExamReason = item.ExamReason != null ? item.ExamReason.ToThaiNumber() : "-" + }); + } + } + else + { + _data.Add(new + { + Number = "-", + ExamIdenNumber = "-", + CitizenId = "-", + SeatNumber = "-", + PrefixName = "-", + FullName = "-", + PositionName = "-", + PositionLevelName = "-", + + PointPath1A = "-", + PointPath2A = "-", + PointPath3A = "-", + PointA = "-", + PointPerA = "-", + ResultA = "-", + + PointB = "-", + PointPerB = "-", + ResultB = "-", + + PointPath1C = "-", + PointPath2C = "-", + PointC = "-", + PointPerC = "-", + ResultC = "-", + + Pass = "-", + PaymentStatus = "-", + PaymentDate = "-", + RegisterDate = "-", + ExamReason = "-" + }); + } + + return new + { + template = "candidate", + reportName = $"Candidate_{DateTime.Now.ToString("yyyyMMddHHmmssfff")}", + data = new + { + data = _data + } + }; + } + public async Task GetsPaymentExamAsync(string examId) { var periodExam = await _context.PeriodExams.AsQueryable() @@ -1769,6 +1891,186 @@ namespace BMA.EHR.Recurit.Exam.Service.Services return stream; } + public async Task NewDownloadCandidateAllAsync(string examId) + { + var periodExam = await _context.PeriodExams.AsQueryable() + .Where(x => x.CheckDisability == false) + .FirstOrDefaultAsync(x => x.Id == Guid.Parse(examId)); + + if (periodExam == null) + throw new Exception(GlobalMessages.ExamNotFound); + + var candidates = await _context.Candidates + .AsQueryable() + .OrderBy(x => x.ExamIdenNumber) + .Where(x => x.PeriodExam == periodExam) + .Where(x => x.Status != "register") + .Select(c => new + { + Id = c.Id, + Status = c.Status, + CitizenId = c.CitizenId, + FullName = $"{c.PrefixName}{c.FirstName} {c.LastName}", + Nationality = c.Nationality, + DateOfBirth = c.DateOfBirth == null ? "" : c.DateOfBirth.Value.Date.ToThaiShortDate(), + Age = c.DateOfBirth == null ? "" : c.DateOfBirth.Value.Date.CalculateAgeStrV2(0, 0), + ReligionName = c.ReligionName, + Telephone = c.Telephone, + MobilePhone = c.MobilePhone, + Email = c.Email, + Knowledge = c.Knowledge, + RegistAddress = c.RegistAddress, + RegistProvinceName = c.RegistProvinceName, + RegistDistrictName = c.RegistDistrictName, + RegistSubDistrictName = c.RegistSubDistrictName, + RegistZipCode = c.RegistZipCode, + CurrentAddress = c.CurrentAddress, + CurrentProvinceName = c.CurrentProvinceName, + CurrentDistrictName = c.CurrentDistrictName, + CurrentSubDistrictName = c.CurrentSubDistrictName, + CurrentZipCode = c.CurrentZipCode, + OccupationOrg = c.OccupationOrg, + OccupationPile = c.OccupationPile, + OccupationGroup = c.OccupationGroup, + OccupationSalary = c.OccupationSalary, + OccupationPosition = c.OccupationPosition, + OccupationPositionType = c.OccupationPositionType, + OccupationTelephone = c.OccupationTelephone, + RegisterDate = c.RegisterDate, + PositionName = c.PositionExam.PositionName, + PositionLevelName = c.PositionExam.PositionLevelName, + + ContactFullName = $"{c.ContactPrefixName}{c.ContactFirstname} {c.ContactLastname}", + ContactRelations = c.ContactRelations, + ContactTel = c.ContactTel, + + Number = c.Number, + ExamIdenNumber = c.ExamIdenNumber, + SeatNumber = c.SeatNumber, + PointTotalA = c.PointTotalA, + PointPath1A = c.PointPath1A, + PointPath2A = c.PointPath2A, + PointPath3A = c.PointPath3A, + PointA = c.PointA, + PointPerA = c.PointPerA, + ResultA = c.ResultA, + PointTotalB = c.PointTotalB, + PointB = c.PointB, + PointPerB = c.PointPerB, + ResultB = c.ResultB, + PointTotalC = c.PointTotalC, + PointPath1C = c.PointPath1C, + PointPath2C = c.PointPath2C, + PointC = c.PointC, + PointPerC = c.PointPerC, + ResultC = c.ResultC, + Pass = c.Pass, + ExamReason = c.ExamReason, + CreatedAt = c.CreatedAt, + }) + .ToListAsync(); + + var _data = new List(); + if (candidates.Count > 0) + { + int num = 1; + foreach (var item in candidates) + { + var education = await _context.Educations + .AsQueryable() + .OrderBy(x => x.EducationEndDate) + .Where(x => x.Candidate.Id == item.Id) + .FirstOrDefaultAsync(); + + var careers = await _context.Careers + .AsQueryable() + .OrderBy(x => x.DurationStart) + .Where(x => x.Candidate.Id == item.Id) + .ToListAsync(); + + _data.Add(new + { + Num = num.ToString().ToThaiNumber(), + PositionName = item.PositionName != null && item.PositionLevelName != null ? $"{item.PositionName} {item.PositionLevelName}".ToThaiNumber() : "-", + FullName = item.FullName != null ? item.FullName.ToThaiNumber() : "-", + Nationality = item.Nationality != null ? item.Nationality.ToThaiNumber() : "-", + ReligionName = item.ReligionName != null ? item.ReligionName.ToThaiNumber() : "-", + DateOfBirth = item.DateOfBirth != null ? item.DateOfBirth.ToThaiNumber() : "-", + Age = item.Age != null ? item.Age.ToThaiNumber() : "-", + Telephone = item.Telephone != null ? item.Telephone.ToThaiNumber() : "-", + Email = item.Email != null ? item.Email : "-", + CitizenId = item.CitizenId != null ? item.CitizenId.ToThaiNumber() : "-", + + EducationLevelExamName = education == null ? "-" : education.EducationLevelExamName.ToThaiNumber(), + EducationName = education == null ? "-" : education.EducationName.ToThaiNumber(), + EducationMajor = education == null ? "-" : education.EducationMajor.ToThaiNumber(), + EducationLocation = education == null ? "-" : education.EducationLocation.ToThaiNumber(), + EducationEndDate = education == null ? "-" : (education.EducationEndDate == null ? "-" : education.EducationEndDate.Value.Date.ToThaiShortDate().ToThaiNumber()), + EducationScores = education == null ? "-" : education.EducationScores.ToThaiNumber(), + EducationType = education == null ? "-" : education.EducationType.ToThaiNumber(), + EducationLevelHighName = education == null ? "-" : education.EducationLevelHighName.ToThaiNumber().ToThaiNumber(), + + OccupationPositionType = item.OccupationPositionType == null ? "-" : GenerateStatusOccupation(item.OccupationPositionType), + OccupationPosition = item.OccupationPosition == null ? "-" : item.OccupationPosition.ToThaiNumber(), + OccupationSalary = item.OccupationSalary == null ? "-" : item.OccupationSalary.ToString().ToThaiNumber(), + OccupationGroup = item.OccupationGroup == null ? "-" : item.OccupationGroup.ToThaiNumber(), + OccupationPile = item.OccupationPile == null ? "-" : item.OccupationPile.ToThaiNumber(), + OccupationOrg = item.OccupationOrg == null ? "-" : item.OccupationOrg.ToThaiNumber(), + OccupationTelephone = item.OccupationTelephone == null ? "-" : item.OccupationTelephone.ToThaiNumber(), + + Position = /*career.Position == null ? "-" : career.Position.ToThaiNumber()*/"-", + Type = /*career.Type == null ? "-" : career.Type*/"-", + DurationStart = /*career.DurationStart == null ? "-" : career.DurationStart.Date.ToThaiShortDate().ToThaiNumber()*/"-", + DurationEnd = /*career.DurationEnd == null ? "-" : career.DurationEnd.Date.ToThaiShortDate().ToThaiNumber()*/"-", + RangeDate = /*career.RangeDate == null ? "-" : career.RangeDate.ToThaiNumber()*/"-", + + CurrentAddress = item.CurrentAddress == null ? "-" : item.CurrentAddress.ToThaiNumber(), + CurrentProvinceName = item.CurrentProvinceName == null ? "-" : item.CurrentProvinceName.ToThaiNumber(), + CurrentDistrictName = item.CurrentDistrictName == null ? "-" : item.CurrentDistrictName.ToThaiNumber(), + CurrentSubDistrictName = item.CurrentSubDistrictName == null ? "-" : item.CurrentSubDistrictName.ToThaiNumber(), + CurrentZipCode = item.CurrentZipCode == null ? "-" : item.CurrentZipCode.ToThaiNumber(), + + RegistAddress = item.RegistAddress == null ? "-" : item.RegistAddress.ToThaiNumber(), + RegistProvinceName = item.RegistProvinceName == null ? "-" : item.RegistProvinceName.ToThaiNumber(), + RegistDistrictName = item.RegistDistrictName == null ? "-" : item.RegistDistrictName.ToThaiNumber(), + RegistSubDistrictName = item.RegistSubDistrictName == null ? "-" : item.RegistSubDistrictName.ToThaiNumber(), + RegistZipCode = item.RegistZipCode == null ? "-" : item.RegistZipCode.ToThaiNumber(), + + ContactFullName = item.ContactFullName == null ? "-" : item.ContactFullName.ToThaiNumber(), + ContactRelations = item.ContactRelations == null ? "-" : item.ContactRelations.ToThaiNumber(), + ContactTel = item.ContactTel == null ? "-" : item.ContactTel.ToThaiNumber(), + CandidateStatus = GenerateStatusCandidate(item.Status), + + Number = item.Number == null ? "-" : item.Number.ToThaiNumber(), + ExamIdenNumber = item.ExamIdenNumber == null ? "-" : item.ExamIdenNumber.ToThaiNumber(), + SeatNumber = item.SeatNumber == null ? "-" : item.SeatNumber.ToThaiNumber(), + PointTotalA = item.PointTotalA == null ? "-" : item.PointTotalA.ToThaiNumber(), + PointA = item.PointA == null ? "-" : item.PointA.ToThaiNumber(), + ResultA = item.ResultA == null ? "-" : item.ResultA.ToThaiNumber(), + PointTotalB = item.PointTotalB == null ? "-" : item.PointTotalB.ToThaiNumber(), + PointB = item.PointB == null ? "-" : item.PointB.ToThaiNumber(), + ResultB = item.ResultB == null ? "-" : item.ResultB.ToThaiNumber(), + PointTotalC = item.PointTotalC == null ? "-" : item.PointTotalC.ToThaiNumber(), + PointC = item.PointC == null ? "-" : item.PointC.ToThaiNumber(), + ResultC = item.ResultC == null ? "-" : item.ResultC.ToThaiNumber(), + Pass = item.Pass == null ? "-" : item.Pass.ToThaiNumber(), + CreatedAt = item.CreatedAt.Date == null ? "-" : item.CreatedAt.Date.ToThaiShortDate().ToThaiNumber(), + RegisterDate = item.RegisterDate.Value.Date == null ? "-" : $"{item.RegisterDate.Value.Date.ToThaiShortDate()} {item.RegisterDate.Value.ToString("HH:mm:ss.ffff")}".ToThaiNumber() + }); + num = num + 1; + } + } + return new + { + template = "candidateDetail", + reportName = $"CandidateDetail_{DateTime.Now.ToString("yyyyMMddHHmmssfff")}", + data = new + { + data = _data + } + }; + } + public async Task GetsDashboardExamAsync(RequestCandidateDashboard item, string examId) { var periodExam = await _context.PeriodExams.AsQueryable() @@ -1966,6 +2268,149 @@ namespace BMA.EHR.Recurit.Exam.Service.Services return stream; } + public async Task NewGetsDashboardExamAsync(RequestCandidateDashboard item, string examId) + { + var periodExam = await _context.PeriodExams.AsQueryable() + .FirstOrDefaultAsync(x => x.Id == Guid.Parse(examId)); + + if (periodExam == null) + throw new Exception(GlobalMessages.ExamNotFound); + + var candidates = await _context.Candidates + .AsQueryable() + .OrderBy(x => x.ExamIdenNumber) + .Where(x => x.PeriodExam == periodExam) + .Where(x => x.Status != "register") + .Select(c => new + { + Id = c.Id, + Status = c.Status, + CitizenId = c.CitizenId, + FullName = $"{c.PrefixName}{c.FirstName} {c.LastName}", + Nationality = c.Nationality, + DateOfBirth = c.DateOfBirth == null ? "" : c.DateOfBirth.Value.Date.ToThaiShortDate(), + Age = c.DateOfBirth == null ? 0 : DateTime.Now.Date.Year - c.DateOfBirth.Value.Date.Year, + ReligionName = c.ReligionName, + Telephone = c.Telephone, + MobilePhone = c.MobilePhone, + Email = c.Email, + Knowledge = c.Knowledge, + RegistAddress = c.RegistAddress, + RegistProvinceName = c.RegistProvinceName, + RegistDistrictName = c.RegistDistrictName, + RegistSubDistrictName = c.RegistSubDistrictName, + RegistZipCode = c.RegistZipCode, + CurrentAddress = c.CurrentAddress, + CurrentProvinceName = c.CurrentProvinceName, + CurrentDistrictName = c.CurrentDistrictName, + CurrentSubDistrictName = c.CurrentSubDistrictName, + CurrentZipCode = c.CurrentZipCode, + OccupationOrg = c.OccupationOrg, + OccupationPile = c.OccupationPile, + OccupationGroup = c.OccupationGroup, + OccupationSalary = c.OccupationSalary, + OccupationPosition = c.OccupationPosition, + OccupationPositionType = c.OccupationPositionType, + OccupationTelephone = c.OccupationTelephone, + Number = c.Number, + ExamIdenNumber = c.ExamIdenNumber, + SeatNumber = c.SeatNumber, + PointTotalA = c.PointTotalA, + PointPath1A = c.PointPath1A, + PointPath2A = c.PointPath2A, + PointPath3A = c.PointPath3A, + PointA = c.PointA, + PointPerA = c.PointPerA, + ResultA = c.ResultA, + PointTotalB = c.PointTotalB, + PointB = c.PointB, + PointPerB = c.PointPerB, + ResultB = c.ResultB, + PointTotalC = c.PointTotalC, + PointPath1C = c.PointPath1C, + PointPath2C = c.PointPath2C, + PointC = c.PointC, + PointPerC = c.PointPerC, + ResultC = c.ResultC, + Pass = c.Pass, + ExamReason = c.ExamReason, + CreatedAt = c.CreatedAt, + }) + .ToListAsync(); + + var educations = new List(); + var careers = new List(); + var ages = new { + one = "๐", + two = "๐", + three = "๐", + four = "๐", + five = "๐", + six = "๐", + }; + var educationsCount = 0; + var careersCount = 0; + if (candidates.Count > 0) + { + educations = await _context.Educations + .AsQueryable() + .Where(x => x.Candidate.PeriodExam == periodExam) + .Where(x => x.Candidate.Status != "register") + .GroupBy(x => x.EducationLevelExamName) + .Select(x => (object)new + { + Name = x.Key, + ToTal = x.Count(), + Count = x.Count().ToString().ToThaiNumber(), + }) + .ToListAsync(); + + educationsCount = educations.Sum(x => ((dynamic)x).ToTal); + + careers = await _context.Careers + .AsQueryable() + .Where(x => x.Candidate.PeriodExam == periodExam) + .Where(x => x.Candidate.Status != "register") + .GroupBy(x => x.Position) + .Select(x => (object)new + { + Name = x.Key, + Total = x.Count(), + Count = x.Count().ToString().ToThaiNumber(), + }) + .ToListAsync(); + + careersCount = careers.Sum(x => ((dynamic)x).Total); + + ages = new + { + one = candidates.Where(x => x.Age >= 1 && x.Age <= 20).Count().ToString().ToThaiNumber(), + two = candidates.Where(x => x.Age >= 21 && x.Age <= 45).Count().ToString().ToThaiNumber(), + three = candidates.Where(x => x.Age >= 46 && x.Age <= 60).Count().ToString().ToThaiNumber(), + four = candidates.Where(x => x.Age >= 61 && x.Age <= 70).Count().ToString().ToThaiNumber(), + five = candidates.Where(x => x.Age >= 71 && x.Age <= 80).Count().ToString().ToThaiNumber(), + six = candidates.Where(x => x.Age >= 81).Count().ToString().ToThaiNumber(), + }; + } + + return new + { + template = "candidateDashboard", + reportName = $"สรุปข้อลการสมัครสอบ {periodExam.Name} ครั้งที่ {periodExam.Round}/{periodExam.Year.Value.ToThaiYear()}", + data = new + { + periodExamName = periodExam.Name.ToThaiNumber(), + periodExamRound = $"{periodExam.Round}/{periodExam.Year + 543}".ToThaiNumber(), + candidatesCount = candidates.Count().ToString().ToThaiNumber(), + educations = educations, + educationsCount = educationsCount.ToString().ToThaiNumber(), + careers = careers, + careersCount = careersCount.ToString().ToThaiNumber(), + ages = ages + } + }; + } + public async Task DownloadCandidatePaymentAllAsync(string examId) { var periodExam = await _context.PeriodExams.AsQueryable()