diff --git a/Controllers/DisableController.cs b/Controllers/DisableController.cs index 346c459..883f395 100644 --- a/Controllers/DisableController.cs +++ b/Controllers/DisableController.cs @@ -2216,7 +2216,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers : "" : "", ExamResult = sr == null ? "" : sr.ExamStatus, - ExamAttribute = _disableService.CheckValidCertificate(p.Certificates.First().IssueDate, 5) ? "มีคุณสมบัติ" : "ไม่มีคุณสมบัติ", + ExamAttribute = p.Certificates.Count > 0 ? + _disableService.CheckValidCertificate(p.Certificates.First().IssueDate, 5) + ? "มีคุณสมบัติ" + : "ไม่มีคุณสมบัติ" + : "ไม่มีคุณสมบัติ", IsSpecial = p.Isspecial, Remark = p.Remark, University = p.Educations.First().University, diff --git a/Services/PeriodExamService.cs b/Services/PeriodExamService.cs index d206a1f..e0794e2 100644 --- a/Services/PeriodExamService.cs +++ b/Services/PeriodExamService.cs @@ -3098,7 +3098,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Services // 🚀 Prepare batch inserts var placementProfiles = new List(); var placementEducations = new List(); - var placementCertificates = new List(); + /*Comment ข้อมูลใบประกอบวิชาชีพ เพราะในไฟล์นำเข้ายังไม่มีคอลัมน์ที่ระบุข้อมูลส่วนนี้*/ + //var placementCertificates = new List(); foreach (var candidate in candidates) { @@ -3252,28 +3253,29 @@ namespace BMA.EHR.Recurit.Exam.Service.Services LastUpdateFullName = FullName ?? "", }; placementEducations.Add(placementEducation); - - var placementCertificate = new PlacementCertificate - { - PlacementProfile = placementProfile, - CertificateNo = firstCertificate?.CertificateNo ?? "", - IssueDate = firstCertificate?.IssueDate, - ExpireDate = firstCertificate?.ExpiredDate, - CertificateType = firstCertificate?.Description ?? "", - CreatedAt = DateTime.Now, - CreatedUserId = UserId ?? "", - LastUpdatedAt = DateTime.Now, - LastUpdateUserId = UserId ?? "", - CreatedFullName = FullName ?? "", - LastUpdateFullName = FullName ?? "", - }; - placementCertificates.Add(placementCertificate); + /*Comment ข้อมูลใบประกอบวิชาชีพ เพราะในไฟล์นำเข้ายังไม่มีคอลัมน์ที่ระบุข้อมูลส่วนนี้*/ + //var placementCertificate = new PlacementCertificate + //{ + // PlacementProfile = placementProfile, + // CertificateNo = firstCertificate?.CertificateNo ?? "", + // IssueDate = firstCertificate?.IssueDate, + // ExpireDate = firstCertificate?.ExpiredDate, + // CertificateType = firstCertificate?.Description ?? "", + // CreatedAt = DateTime.Now, + // CreatedUserId = UserId ?? "", + // LastUpdatedAt = DateTime.Now, + // LastUpdateUserId = UserId ?? "", + // CreatedFullName = FullName ?? "", + // LastUpdateFullName = FullName ?? "", + //}; + //placementCertificates.Add(placementCertificate); } // 🚀 Batch insert all records await _contextMetadata.PlacementProfiles.AddRangeAsync(placementProfiles); await _contextMetadata.PlacementEducations.AddRangeAsync(placementEducations); - await _contextMetadata.PlacementCertificates.AddRangeAsync(placementCertificates); + /*Comment ข้อมูลใบประกอบวิชาชีพ เพราะในไฟล์นำเข้ายังไม่มีคอลัมน์ที่ระบุข้อมูลส่วนนี้*/ + //await _contextMetadata.PlacementCertificates.AddRangeAsync(placementCertificates); // 🚀 Single SaveChanges at the end await _contextMetadata.SaveChangesAsync();