ต่อ api บุคคลที่สามารถติดต่อได้

This commit is contained in:
Kittapath 2023-10-06 01:28:37 +07:00
parent 20b031c29f
commit b8f12139e1
11 changed files with 3384 additions and 64 deletions

View file

@ -480,7 +480,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
Positions = x.PositionExam.OrderBy(x => x.CreatedAt).Select(s => new HomePageLinkResponseItem
{
Id = s.Id.ToString(),
Title = s.PositionName == null ? x.Name : s.PositionName,
Title = $"{(s.PositionName == null ? x.Name : s.PositionName)}{(s.PositionLevelName == null ? "" : s.PositionLevelName)}",
Level = s.PositionLevelName == null ? "-" : s.PositionLevelName,
HighDegree = s.HighDegree == true ? "ปริญญาบัตรขึ้นไป" : "ต่ำกว่าปริญญาบัตร",
Path = $"{x.Id}/{s.Id}",
@ -489,7 +489,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
PositionsTrue = x.PositionExam.OrderBy(x => x.CreatedAt).Where(x => x.HighDegree == true).Select(s => new HomePageLinkResponseItem
{
Id = s.Id.ToString(),
Title = s.PositionName == null ? x.Name : s.PositionName,
Title = $"{(s.PositionName == null ? x.Name : s.PositionName)}{(s.PositionLevelName == null ? "" : s.PositionLevelName)}",
Level = s.PositionLevelName == null ? "-" : s.PositionLevelName,
HighDegree = s.HighDegree == true ? "ปริญญาบัตรขึ้นไป" : "ต่ำกว่าปริญญาบัตร",
Path = $"{x.Id}/{s.Id}",
@ -498,7 +498,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
PositionsFalse = x.PositionExam.OrderBy(x => x.CreatedAt).Where(x => x.HighDegree == false).Select(s => new HomePageLinkResponseItem
{
Id = s.Id.ToString(),
Title = s.PositionName == null ? x.Name : s.PositionName,
Title = $"{(s.PositionName == null ? x.Name : s.PositionName)}{(s.PositionLevelName == null ? "" : s.PositionLevelName)}",
Level = s.PositionLevelName == null ? "-" : s.PositionLevelName,
HighDegree = s.HighDegree == true ? "ปริญญาบัตรขึ้นไป" : "ต่ำกว่าปริญญาบัตร",
Path = $"{x.Id}/{s.Id}",

View file

@ -323,6 +323,51 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
}
}
public async Task<CandidateContactResponseItem?> GetsAsyncContact(string examId, string positionId)
{
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 (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);
return await _context.Candidates.AsQueryable()
.Where(x => x.PeriodExam == exam && x.UserId == UserId && x.PositionExam == position)
.Select(x => new CandidateContactResponseItem
{
ContactPrefixId = x.ContactPrefixId,
ContactFirstname = x.ContactFirstname,
ContactLastname = x.ContactLastname,
ContactRelations = x.ContactRelations,
ContactTel = x.ContactTel,
})
.FirstOrDefaultAsync();
}
else
{
return await _context.Candidates.AsQueryable()
.Where(x => x.PeriodExam == exam && x.UserId == UserId)
.Select(x => new CandidateContactResponseItem
{
ContactPrefixId = x.ContactPrefixId,
ContactFirstname = x.ContactFirstname,
ContactLastname = x.ContactLastname,
ContactRelations = x.ContactRelations,
ContactTel = x.ContactTel,
})
.FirstOrDefaultAsync();
}
}
public async Task<IEnumerable<Career?>> GetsAsyncCareer(string examId, string positionId)
{
var exam = await _context.PeriodExams.AsQueryable()
@ -1348,6 +1393,35 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
await _context.SaveChangesAsync();
}
public async Task UpdateAsyncContact(string examId, string positionId, CandidateContactResponseItem updated)
{
var candidateId = await CreateAsyncCandidate(examId, positionId);
var candidate = await _context.Candidates.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == Guid.Parse(candidateId));
if (candidate == null)
throw new Exception(GlobalMessages.ExamNotFound);
if (updated.ContactPrefixId != null)
{
var prefix = await _contextMetadata.Prefixes.AsQueryable()
.FirstOrDefaultAsync(x => x.Id == updated.ContactPrefixId);
if (prefix == null)
throw new Exception(GlobalMessages.PrefixNotFound);
candidate.ContactPrefixId = prefix.Id;
candidate.ContactPrefixName = prefix.Name;
}
candidate.ContactFirstname = updated.ContactFirstname;
candidate.ContactLastname = updated.ContactLastname;
candidate.ContactRelations = updated.ContactRelations;
candidate.ContactTel = updated.ContactTel;
await _context.SaveChangesAsync();
}
public async Task UpdateAsyncDocument(string examId, string positionId, IFormFile file)
{
var candidateId = await CreateAsyncCandidate(examId, positionId);
@ -1748,6 +1822,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
throw new Exception("หมดเวลาช่วงสมัครสอบ");
var candidate = await _context.Candidates.AsQueryable()
.Include(x => x.PositionExam)
.Include(x => x.PeriodExam)
.FirstOrDefaultAsync(x => x.PeriodExam == exam && x.UserId == UserId);
if (positionId != "00000000-0000-0000-0000-000000000000")
@ -1774,10 +1850,21 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
if (status == "checkRegister")
{
var subject = "แจ้งผลการสมัครสอบคัดเลือก " + exam.Name;
var body = candidate.FirstName + " " + candidate.LastName + " สถานะการสมัครสอบ: รอเจ้าหน้าที่ตรวจสอบข้อมูล";
var body = candidate.FirstName + " " + candidate.LastName + " สถานะการสมัครสอบ: รอยืนยันสถานะการสมัคร";
if (candidate.Email != null && candidate.Email != "") _mailService.SendMailToUser(subject, body, candidate.Email);
if (candidate.RegisterDate == null)
candidate.RegisterDate = DateTime.Now;
var periodExam = await _context.Candidates.AsQueryable()
.Where(x => x.PeriodExam == candidate.PeriodExam && x.PositionExam == candidate.PositionExam && x.ExamIdenNumber != null)
.OrderByDescending(d => d.CreatedAt)
.ToListAsync();
if (periodExam == null)
throw new Exception(GlobalMessages.ExamNotFound);
var num = periodExam.Count() + 1;
candidate.ExamIdenNumber = candidate.PositionExam == null ? num.ToString() : candidate.PositionExam.Code + num.ToString("D5");
}
if (status == "checkPayment")
{
@ -1831,11 +1918,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
else if (status == "payment" && candidate.PeriodExam.Fee == 0)
{
var subject = "แจ้งผลการสมัครสอบคัดเลือก " + candidate.PeriodExam.Name;
var body = candidate.FirstName + " " + candidate.LastName + " สถานะการสมัครสอบ: รอเจ้าหน้าที่จัดที่นั่งสอบ";
var body = candidate.FirstName + " " + candidate.LastName + " สถานะการสมัครสอบ: ได้รับใบสมัครแล้ว";
if (candidate.Email != null && candidate.Email != "") _mailService.SendMailToUser(subject, body, candidate.Email);
candidate.Status = "checkSeat";
var num = periodExam.Count() + 1;
candidate.ExamIdenNumber = candidate.PositionExam == null ? num.ToString() : candidate.PositionExam.Code + num;
// var num = periodExam.Count() + 1;
// candidate.ExamIdenNumber = candidate.PositionExam == null ? num.ToString() : candidate.PositionExam.Code + num;
}
else if (status == "payment" && candidate.PeriodExam.Fee != 0)
{
@ -1846,10 +1933,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
if (candidate.Status == "checkSeat")
{
var subject = "แจ้งผลการสมัครสอบคัดเลือก " + candidate.PeriodExam.Name;
var body = candidate.FirstName + " " + candidate.LastName + " สถานะการสมัครสอบ: รอเจ้าหน้าที่จัดที่นั่งสอบ";
var body = candidate.FirstName + " " + candidate.LastName + " สถานะการสมัครสอบ: ได้รับใบสมัครแล้ว";
if (candidate.Email != null && candidate.Email != "") _mailService.SendMailToUser(subject, body, candidate.Email);
var num = periodExam.Count() + 1;
candidate.ExamIdenNumber = candidate.PositionExam == null ? num.ToString() : candidate.PositionExam.Code + num;
// var num = periodExam.Count() + 1;
// candidate.ExamIdenNumber = candidate.PositionExam == null ? num.ToString() : candidate.PositionExam.Code + num;
candidate.PaymentDate = DateTime.Now;
}
}
@ -1893,7 +1980,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
if (candidate.PeriodExam.Fee == 0)
{
var subject = "แจ้งผลการสมัครสอบคัดเลือก " + candidate.PeriodExam.Name;
var body = candidate.FirstName + " " + candidate.LastName + " สถานะการสมัครสอบ: รอเจ้าหน้าที่จัดที่นั่งสอบ";
var body = candidate.FirstName + " " + candidate.LastName + " สถานะการสมัครสอบ: ได้รับใบสมัครแล้ว";
if (candidate.Email != null && candidate.Email != "") _mailService.SendMailToUser(subject, body, candidate.Email);
candidate.Status = "checkSeat";
var num = periodExam.Count() + 1 + _num;

View file

@ -793,6 +793,21 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
.FirstOrDefaultAsync();
}
public async Task<CandidateContactResponseItem?> GetsAsyncContact(string candidateId)
{
return await _context.Candidates.AsQueryable()
.Where(x => x.Id == Guid.Parse(candidateId))
.Select(x => new CandidateContactResponseItem
{
ContactPrefixId = x.ContactPrefixId,
ContactFirstname = x.ContactFirstname,
ContactLastname = x.ContactLastname,
ContactRelations = x.ContactRelations,
ContactTel = x.ContactTel,
})
.FirstOrDefaultAsync();
}
public async Task<CandidateAddressResponseItem?> GetsAsyncAddress(string candidateId)
{
return await _context.Candidates.AsQueryable()
@ -1063,7 +1078,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
candidate.Number = item.Number;
var subject = "แจ้งผลการสมัครสอบคัดเลือก " + periodExam.Name;
var body = candidate.FirstName + " " + candidate.LastName + " สถานะการสมัครสอบ: สอบคัดเลือกสำเร็จ";
// if (candidate.Email != null&& candidate.Email != "") _mailService.SendMailToUser(subject, body, candidate.Email);
if (candidate.Email != null && candidate.Email != "") _mailService.SendMailToUser(subject, body, candidate.Email);
candidate.Status = "done";
}
else
@ -1072,7 +1087,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
{
var subject = "แจ้งผลการสมัครสอบคัดเลือก " + periodExam.Name;
var body = candidate.FirstName + " " + candidate.LastName + " สถานะการสมัครสอบ: สละสิทธิ์สอบ";
// if (candidate.Email != null&& candidate.Email != "") _mailService.SendMailToUser(subject, body, candidate.Email);
if (candidate.Email != null && candidate.Email != "") _mailService.SendMailToUser(subject, body, candidate.Email);
}
// candidate.Status = "waiver";
}
@ -1083,7 +1098,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
{
var subject = "แจ้งผลการสมัครสอบคัดเลือก " + periodExam.Name;
var body = candidate.FirstName + " " + candidate.LastName + " สถานะการสมัครสอบ: สละสิทธิ์สอบ";
// if (candidate.Email != null&& candidate.Email != "") _mailService.SendMailToUser(subject, body, candidate.Email);
if (candidate.Email != null && candidate.Email != "") _mailService.SendMailToUser(subject, body, candidate.Email);
}
// candidate.Status = "waiver";
}
@ -1287,37 +1302,37 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
{
Id = 3,
Name = "จำนวนผู้มีสิทธิ์เข้ารับคัดเลือกทั้งหมด",
Count = periodExam.Candidate.Where(x=>x.ExamIdenNumber != null).Count()
Count = periodExam.Candidate.Where(x=>x.Status!="register").Where(x=>x.ExamIdenNumber != null).Count()
},
new DashboardResponseItem
{
Id = 4,
Name = "จำนวนผู้เข้ารับการคัดเลือกทั้งหมด",
Count = periodExam.Candidate.Where(x=>x.SeatNumber != null).Count()
Count = periodExam.Candidate.Where(x=>x.Status!="register").Where(x=>x.SeatNumber != null).Count()
},
new DashboardResponseItem
{
Id = 5,
Name = "ผ่านการสอบ",
Count = periodExam.Candidate.Where(x=>x.Pass=="ผ่าน" || x.Pass=="ได้").Count()
Count = periodExam.Candidate.Where(x=>x.Status!="register").Where(x=>x.Pass=="ผ่าน" || x.Pass=="ได้").Count()
},
new DashboardResponseItem
{
Id = 6,
Name = "ไม่ผ่านการสอบ",
Count = periodExam.Candidate.Where(x=>x.Pass!=null && x.Pass!="ผ่าน" && x.Pass!="ได้").Count()
Count = periodExam.Candidate.Where(x=>x.Status!="register").Where(x=>x.Pass!=null && x.Pass!="ผ่าน" && x.Pass!="ได้").Count()
},
new DashboardResponseItem
{
Id = 7,
Name = "เพศชาย",
Count = periodExam.Candidate.Where(x=>x.PrefixName != null && x.PrefixName=="นาย").Count()
Count = periodExam.Candidate.Where(x=>x.Status!="register").Where(x=>x.PrefixName != null && x.PrefixName=="นาย").Count()
},
new DashboardResponseItem
{
Id = 8,
Name = "เพศหญิง",
Count = periodExam.Candidate.Where(x=>x.PrefixName != null && (x.PrefixName=="นาง" || x.PrefixName=="นางสาว")).Count()
Count = periodExam.Candidate.Where(x=>x.Status!="register").Where(x=>x.PrefixName != null && (x.PrefixName=="นาง" || x.PrefixName=="นางสาว")).Count()
},
// new DashboardResponseItem
// {
@ -1670,8 +1685,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
var candidates = await _context.Candidates
.AsQueryable()
.OrderBy(x => x.ExamIdenNumber)
.Where(x => x.CreatedAt.Date <= item.DateEnd.Date)
.Where(x => x.CreatedAt.Date >= item.DateStart.Date)
// .Where(x => x.CreatedAt.Date <= item.DateEnd.Date)
// .Where(x => x.CreatedAt.Date >= item.DateStart.Date)
.Where(x => x.PeriodExam == periodExam)
.Where(x => x.Status != "register")
.Select(c => new
@ -1738,26 +1753,26 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
summarySheet.TabColor = System.Drawing.Color.Black;
// summarySheet.DefaultRowHeight = 17;
summarySheet.Column(1).Style.Font.Bold = true;
summarySheet.Row(4).Style.Font.Bold = true;
summarySheet.Row(4).Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
summarySheet.Row(5).Style.Font.Bold = true;
summarySheet.Row(5).Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
summarySheet.Row(6).Style.Font.Bold = true;
summarySheet.Cells[1, 3].Style.Font.Bold = true;
int rowName = 2;
int rowCount = 2;
int fixMerge = 2;
summarySheet.Cells[1, 1].Value = "ตั้งแต่";
summarySheet.Cells[1, 2].Value = item.DateStart.Date.ToThaiShortDate();
summarySheet.Cells[1, 3].Value = "ถึง";
summarySheet.Cells[1, 4].Value = item.DateEnd.Date.ToThaiShortDate();
summarySheet.Cells[2, 1].Value = "ชื่อรอบการสอบ/ชื่อประกาศ";
summarySheet.Cells[2, 2].Value = periodExam.Name;
summarySheet.Cells[3, 1].Value = "ครั้งที่";
summarySheet.Cells[3, 2].Value = $"{periodExam.Round}/{periodExam.Year + 543}";
summarySheet.Cells[4, 1].Value = "จำนวนผู้สมัคร";
summarySheet.Cells[4, 2].Value = candidates.Count().ToString();
// summarySheet.Cells[1, 1].Value = "ตั้งแต่";
// summarySheet.Cells[1, 2].Value = item.DateStart.Date.ToThaiShortDate();
// summarySheet.Cells[1, 3].Value = "ถึง";
// summarySheet.Cells[1, 4].Value = item.DateEnd.Date.ToThaiShortDate();
summarySheet.Cells[1, 1].Value = "ชื่อรอบการสอบ/ชื่อประกาศ";
summarySheet.Cells[1, 2].Value = periodExam.Name;
summarySheet.Cells[2, 1].Value = "ครั้งที่";
summarySheet.Cells[2, 2].Value = $"{periodExam.Round}/{periodExam.Year + 543}";
summarySheet.Cells[3, 1].Value = "จำนวนผู้สมัคร";
summarySheet.Cells[3, 2].Value = candidates.Count().ToString();
if (candidates.Count() > 0)
{
summarySheet.Cells[7, 1].Value = "จำนวน";
summarySheet.Cells[6, 1].Value = "จำนวน";
// summarySheet.Cells[1, 6].Value = "คะแนนภาค ข";
// summarySheet.Cells[1, 7].Value = "ผลสอบภาค ข";
// summarySheet.Cells[1, 8].Value = "คะแนนเต็มภาค ค";
@ -1767,8 +1782,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
var educations = await _context.Educations
.AsQueryable()
.Where(x => x.Candidate.PeriodExam == periodExam)
.Where(x => x.Candidate.CreatedAt.Date <= item.DateEnd.Date)
.Where(x => x.Candidate.CreatedAt.Date >= item.DateStart.Date)
.Where(x => x.Candidate.Status != "register")
// .Where(x => x.Candidate.CreatedAt.Date <= item.DateEnd.Date)
// .Where(x => x.Candidate.CreatedAt.Date >= item.DateStart.Date)
.GroupBy(x => x.EducationLevelExamName)
.Select(x => new
{
@ -1779,22 +1795,23 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
foreach (var education in educations)
{
summarySheet.Cells[6, rowName].Value = education.Name;
summarySheet.Cells[7, rowCount].Value = education.Count;
summarySheet.Cells[5, rowName].Value = education.Name;
summarySheet.Cells[6, rowCount].Value = education.Count;
rowName++;
rowCount++;
}
if (educations.Count() != 0)
{
summarySheet.Cells[5, fixMerge, 5, rowName - 1].Value = "วุฒิที่ใช้สมัครสอบ";
summarySheet.Cells[5, fixMerge, 5, rowName - 1].Merge = true;
summarySheet.Cells[4, fixMerge, 4, rowName - 1].Value = "วุฒิที่ใช้สมัครสอบ";
summarySheet.Cells[4, fixMerge, 4, rowName - 1].Merge = true;
fixMerge = rowCount;
}
var careers = await _context.Careers
.AsQueryable()
.Where(x => x.Candidate.PeriodExam == periodExam)
.Where(x => x.Candidate.CreatedAt.Date <= item.DateEnd.Date)
.Where(x => x.Candidate.CreatedAt.Date >= item.DateStart.Date)
.Where(x => x.Candidate.Status != "register")
// .Where(x => x.Candidate.CreatedAt.Date <= item.DateEnd.Date)
// .Where(x => x.Candidate.CreatedAt.Date >= item.DateStart.Date)
.GroupBy(x => x.Position)
.Select(x => new
{
@ -1804,47 +1821,47 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
.ToListAsync();
foreach (var career in careers)
{
summarySheet.Cells[6, rowName].Value = career.Name;
summarySheet.Cells[7, rowCount].Value = career.Count;
summarySheet.Cells[5, rowName].Value = career.Name;
summarySheet.Cells[6, rowCount].Value = career.Count;
rowName++;
rowCount++;
}
if (careers.Count() != 0)
{
summarySheet.Cells[5, fixMerge, 5, rowName - 1].Value = "สถานที่ทำงาน/ฝึกงาน";
summarySheet.Cells[5, fixMerge, 5, rowName - 1].Merge = true;
summarySheet.Cells[4, fixMerge, 4, rowName - 1].Value = "สถานที่ทำงาน/ฝึกงาน";
summarySheet.Cells[4, fixMerge, 4, rowName - 1].Merge = true;
fixMerge = rowCount;
}
summarySheet.Cells[6, rowName].Value = "อายุ 1-20 ปี";
summarySheet.Cells[7, rowCount].Value = candidates.Where(x => x.Age >= 1 && x.Age <= 20).Count();
summarySheet.Cells[5, rowName].Value = "อายุ 1-20 ปี";
summarySheet.Cells[6, rowCount].Value = candidates.Where(x => x.Age >= 1 && x.Age <= 20).Count();
rowName++;
rowCount++;
summarySheet.Cells[6, rowName].Value = "อายุ 21-45 ปี";
summarySheet.Cells[7, rowCount].Value = candidates.Where(x => x.Age >= 21 && x.Age <= 45).Count();
summarySheet.Cells[5, rowName].Value = "อายุ 21-45 ปี";
summarySheet.Cells[6, rowCount].Value = candidates.Where(x => x.Age >= 21 && x.Age <= 45).Count();
rowName++;
rowCount++;
summarySheet.Cells[6, rowName].Value = "อายุ 46-60 ปี";
summarySheet.Cells[7, rowCount].Value = candidates.Where(x => x.Age >= 46 && x.Age <= 60).Count();
summarySheet.Cells[5, rowName].Value = "อายุ 46-60 ปี";
summarySheet.Cells[6, rowCount].Value = candidates.Where(x => x.Age >= 46 && x.Age <= 60).Count();
rowName++;
rowCount++;
summarySheet.Cells[6, rowName].Value = "อายุ 61-70 ปี";
summarySheet.Cells[7, rowCount].Value = candidates.Where(x => x.Age >= 61 && x.Age <= 70).Count();
summarySheet.Cells[5, rowName].Value = "อายุ 61-70 ปี";
summarySheet.Cells[6, rowCount].Value = candidates.Where(x => x.Age >= 61 && x.Age <= 70).Count();
rowName++;
rowCount++;
summarySheet.Cells[6, rowName].Value = "อายุ 71-80 ปี";
summarySheet.Cells[7, rowCount].Value = candidates.Where(x => x.Age >= 71 && x.Age <= 80).Count();
summarySheet.Cells[5, rowName].Value = "อายุ 71-80 ปี";
summarySheet.Cells[6, rowCount].Value = candidates.Where(x => x.Age >= 71 && x.Age <= 80).Count();
rowName++;
rowCount++;
summarySheet.Cells[6, rowName].Value = "อายุ 80 ปีขึ้นไป";
summarySheet.Cells[7, rowCount].Value = candidates.Where(x => x.Age >= 81).Count();
summarySheet.Cells[5, rowName].Value = "อายุ 80 ปีขึ้นไป";
summarySheet.Cells[6, rowCount].Value = candidates.Where(x => x.Age >= 81).Count();
rowName++;
rowCount++;
summarySheet.Cells[5, fixMerge, 5, rowName - 1].Value = "ช่วงอายุ";
summarySheet.Cells[5, fixMerge, 5, rowName - 1].Merge = true;
summarySheet.Cells[4, fixMerge, 4, rowName - 1].Value = "ช่วงอายุ";
summarySheet.Cells[4, fixMerge, 4, rowName - 1].Merge = true;
}
else
{
summarySheet.Cells[7, 1].Value = "ไม่มีผู้สมัครสอบในช่วงเวลานี้";
summarySheet.Cells[6, 1].Value = "ไม่มีผู้สมัครสอบในช่วงเวลานี้";
}
summarySheet.Cells[summarySheet.Dimension.Address].AutoFitColumns();
package.Save();