From 8f85d92a9cb0df484f56fb511ff12e9afcd4e979 Mon Sep 17 00:00:00 2001 From: Bright Date: Thu, 4 Sep 2025 16:30:15 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=83=E0=B8=8A=E0=B9=89=20Math.Round?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controllers/RecruitController.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Controllers/RecruitController.cs b/Controllers/RecruitController.cs index fb74b0e..7a2f04d 100644 --- a/Controllers/RecruitController.cs +++ b/Controllers/RecruitController.cs @@ -1414,23 +1414,22 @@ namespace BMA.EHR.Recruit.Service.Controllers // ภาคความรู้ความสามารถที่ใช้เฉพาะตำแหน่ง r.FullA = 200; - r.SumA = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 5]?.GetValue()) ? 0.00 : (double)workSheet?.Cells[row, 5]?.GetValue(); - r.PercentageA = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 6]?.GetValue()) ? 0.00 : (double)workSheet?.Cells[row, 6]?.GetValue(); + r.SumA = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 5]?.GetValue()) ? 0.00 : Math.Round(workSheet.Cells[row, 5].GetValue(), 2); + r.PercentageA = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 6]?.GetValue()) ? 0.00 : Math.Round(workSheet.Cells[row, 6].GetValue(), 2); r.AStatus = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 7]?.GetValue()) ? "" : workSheet?.Cells[row, 7]?.GetValue(); - r.SumAB = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 5]?.GetValue()) ? 0.00 : (double)workSheet?.Cells[row, 5]?.GetValue(); + r.SumAB = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 5]?.GetValue()) ? 0.00 : Math.Round(workSheet.Cells[row, 5].GetValue(), 2); r.ABStatus = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 7]?.GetValue()) ? "" : workSheet?.Cells[row, 7]?.GetValue(); // ภาคความเหมาะสมกับตำแหน่ง r.FullC = 50; - r.SumC = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 8]?.GetValue()) ? 0.00 : (double)workSheet?.Cells[row, 8]?.GetValue(); + r.SumC = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 8]?.GetValue()) ? 0.00 : Math.Round(workSheet.Cells[row, 8].GetValue(), 2); r.FullD = 50; - r.SumD = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 9]?.GetValue()) ? 0.00 : (double)workSheet?.Cells[row, 9]?.GetValue(); - r.SumCD = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 10]?.GetValue()) ? 0.00 : (double)workSheet?.Cells[row, 10]?.GetValue(); - r.PercentageC = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 11]?.GetValue()) ? 0.00 : (double)workSheet?.Cells[row, 11]?.GetValue(); + r.SumD = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 9]?.GetValue()) ? 0.00 : Math.Round(workSheet.Cells[row, 9].GetValue(), 2); + r.SumCD = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 10]?.GetValue()) ? 0.00 : Math.Round(workSheet.Cells[row, 10].GetValue(), 2); + r.PercentageC = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 11]?.GetValue()) ? 0.00 : Math.Round(workSheet.Cells[row, 11].GetValue(), 2); r.CStatus = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 12]?.GetValue()) ? "" : workSheet?.Cells[row, 12]?.GetValue(); - r.FullScore = 300; - r.TotalScore = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 13]?.GetValue()) ? 0.00 : (double)workSheet?.Cells[row, 13]?.GetValue(); ; + r.TotalScore = string.IsNullOrWhiteSpace(workSheet?.Cells[row, 13]?.GetValue()) ? 0.00 : Math.Round(workSheet.Cells[row, 13].GetValue(), 2); if (workSheet?.Cells[row, 7]?.GetValue() == "ขาดสอบ") {