This commit is contained in:
Bright 2025-07-15 15:54:50 +07:00
parent 86e594df09
commit a352ec6578
2 changed files with 79 additions and 3 deletions

View file

@ -1081,7 +1081,8 @@ namespace BMA.EHR.Recruit.Service.Controllers
r.National = workSheet?.Cells[row, 9]?.GetValue<string>() ?? "";
r.Race = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "";
r.Religion = workSheet?.Cells[row, 10]?.GetValue<string>() ?? "";
r.DateOfBirth = DateTime.TryParseExact(workSheet?.Cells[row, 11]?.GetValue<string>()?.Trim(), "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out var dob) && dob.Year > 2500 ? dob.AddYears(-543) : DateTime.MinValue;
//r.DateOfBirth = DateTime.TryParseExact(workSheet?.Cells[row, 11]?.GetValue<string>()?.Trim(), "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out var dob) && dob.Year > 2500 ? dob.AddYears(-543) : DateTime.MinValue;
r.DateOfBirth = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, 11]?.GetValue<string>()) ? _recruitService.CheckDateTime(workSheet?.Cells[row, 11]?.GetValue<string>() ?? "", "dd/MM/yyyy") : DateTime.MinValue;
r.Marry = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "";
r.Isspecial = "N";
r.CitizenCardIssuer = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "";
@ -1108,7 +1109,7 @@ namespace BMA.EHR.Recruit.Service.Controllers
GPA = (double)workSheet?.Cells[row, 26]?.GetValue<double>(),
Specialist = workSheet?.Cells[row, 9999]?.GetValue<string>() ?? "",
HighDegree = workSheet?.Cells[row, 27]?.GetValue<string>() ?? "",
BachelorDate = DateTime.TryParseExact(workSheet?.Cells[row, 25]?.GetValue<string>()?.Trim(), "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out var bachelorDob) && bachelorDob.Year > 2500 ? bachelorDob.AddYears(-543) : DateTime.MinValue,
BachelorDate = !string.IsNullOrWhiteSpace(workSheet?.Cells[row, 25]?.GetValue<string>()) ? _recruitService.CheckDateTime(workSheet?.Cells[row, 11]?.GetValue<string>() ?? "", "dd/MM/yyyy") : DateTime.MinValue,
CreatedAt = DateTime.Now,
CreatedUserId = UserId ?? "",
CreatedFullName = FullName ?? "System Administrator",
@ -1494,7 +1495,8 @@ namespace BMA.EHR.Recruit.Service.Controllers
majorgroup = dr["majorgroup"].ToString(),
certificateNo = dr["certificateno"].ToString(),
certificateIssueDate = dr["certificateIssueDate"] == null || Convert.ToDateTime(dr["certificateIssueDate"]) == DateTime.MinValue ? "" : Convert.ToDateTime(dr["certificateIssueDate"]).ToThaiShortDate(),
ExamScore = dr["score"] == null ? 0 : dr["score"].ToString().ToInteger(),
//ExamScore = dr["score"] == null ? 0 : dr["score"].ToString().ToInteger(),
ExamScore = string.IsNullOrWhiteSpace(dr["score"]?.ToString()) ? 0 : decimal.Parse(dr["score"]?.ToString()),
ExamResult = dr["result"].ToString(),
ExamAttribute = dr["examAttribute"].ToString(),
Remark = dr["remark"].ToString(),