From 62a0099edd32af1370cf20605c34b131f425420b Mon Sep 17 00:00:00 2001 From: kittapath Date: Wed, 29 Jan 2025 11:41:15 +0700 Subject: [PATCH] no message --- Services/PeriodExamService.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Services/PeriodExamService.cs b/Services/PeriodExamService.cs index 215dca4..2d6fa6a 100644 --- a/Services/PeriodExamService.cs +++ b/Services/PeriodExamService.cs @@ -1145,6 +1145,34 @@ namespace BMA.EHR.Recurit.Exam.Service.Services Pass = worksheet.Cells[row, 23].Value != null ? (worksheet.Cells[row, 23].Value.ToString()) : null, ExamReason = worksheet.Cells[row, 27].Value != null ? (worksheet.Cells[row, 27].Value.ToString()) : null, }); + if (!int.TryParse(worksheet.Cells[row, 9].Value != null ? worksheet.Cells[row, 9].Value.ToString() : "0", out _)) + throw new Exception("กรอกจำนวนคะแนนไม่ถูกต้อง"); + if (!int.TryParse(worksheet.Cells[row, 10].Value != null ? worksheet.Cells[row, 10].Value.ToString() : "0", out _)) + throw new Exception("กรอกจำนวนคะแนนไม่ถูกต้อง"); + if (!int.TryParse(worksheet.Cells[row, 11].Value != null ? worksheet.Cells[row, 11].Value.ToString() : "0", out _)) + throw new Exception("กรอกจำนวนคะแนนไม่ถูกต้อง"); + if (!int.TryParse(worksheet.Cells[3, 12].Value != null ? worksheet.Cells[3, 12].Value.ToString()?.Split(" ")[0] : "0", out _)) + throw new Exception("กรอกจำนวนคะแนนไม่ถูกต้อง"); + if (!int.TryParse(worksheet.Cells[row, 12].Value != null ? worksheet.Cells[row, 12].Value.ToString() : "0", out _)) + throw new Exception("กรอกจำนวนคะแนนไม่ถูกต้อง"); + if (!int.TryParse(worksheet.Cells[row, 13].Value != null ? worksheet.Cells[row, 13].Value.ToString() : "0", out _)) + throw new Exception("กรอกจำนวนคะแนนไม่ถูกต้อง"); + if (!int.TryParse(worksheet.Cells[3, 15].Value != null ? worksheet.Cells[3, 15].Value.ToString()?.Split(" ")[0] : "0", out _)) + throw new Exception("กรอกจำนวนคะแนนไม่ถูกต้อง"); + if (!int.TryParse(worksheet.Cells[row, 15].Value != null ? worksheet.Cells[row, 15].Value.ToString() : "0", out _)) + throw new Exception("กรอกจำนวนคะแนนไม่ถูกต้อง"); + if (!int.TryParse(worksheet.Cells[row, 16].Value != null ? worksheet.Cells[row, 16].Value.ToString() : "0", out _)) + throw new Exception("กรอกจำนวนคะแนนไม่ถูกต้อง"); + if (!int.TryParse(worksheet.Cells[row, 18].Value != null ? worksheet.Cells[row, 18].Value.ToString() : "0", out _)) + throw new Exception("กรอกจำนวนคะแนนไม่ถูกต้อง"); + if (!int.TryParse(worksheet.Cells[row, 19].Value != null ? worksheet.Cells[row, 19].Value.ToString() : "0", out _)) + throw new Exception("กรอกจำนวนคะแนนไม่ถูกต้อง"); + if (!int.TryParse(worksheet.Cells[3, 20].Value != null ? worksheet.Cells[3, 20].Value.ToString()?.Split(" ")[0] : "0", out _)) + throw new Exception("กรอกจำนวนคะแนนไม่ถูกต้อง"); + if (!int.TryParse(worksheet.Cells[row, 20].Value != null ? worksheet.Cells[row, 20].Value.ToString() : "0", out _)) + throw new Exception("กรอกจำนวนคะแนนไม่ถูกต้อง"); + if (!int.TryParse(worksheet.Cells[row, 21].Value != null ? worksheet.Cells[row, 21].Value.ToString() : "0", out _)) + throw new Exception("กรอกจำนวนคะแนนไม่ถูกต้อง"); // } } }