diff --git a/Services/CandidateService.cs b/Services/CandidateService.cs index e760bbe..4a07e37 100644 --- a/Services/CandidateService.cs +++ b/Services/CandidateService.cs @@ -685,10 +685,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Services if (exam == null) throw new Exception(GlobalMessages.ExamNotFound); - if (exam.RegisterStartDate != null && exam.RegisterStartDate.Value.Date > DateTime.Now.Date) + if (exam.RegisterStartDate != null && exam.RegisterStartDate.Value > DateTime.Now) throw new Exception("ยังไม่ถึงช่วงเวลาสมัครสอบ"); - if (exam.RegisterEndDate != null && exam.RegisterEndDate.Value.Date < DateTime.Now.Date) + if (exam.RegisterEndDate != null && exam.RegisterEndDate.Value < DateTime.Now) throw new Exception("หมดเวลาช่วงสมัครสอบ"); var _candidate = await _context.Candidates.AsQueryable() @@ -1985,10 +1985,10 @@ namespace BMA.EHR.Recurit.Exam.Service.Services if (exam == null) throw new Exception(GlobalMessages.ExamNotFound); - if (exam.RegisterStartDate != null && exam.RegisterStartDate.Value.Date > DateTime.Now.Date) + if (exam.RegisterStartDate != null && exam.RegisterStartDate.Value > DateTime.Now) throw new Exception("ยังไม่ถึงช่วงเวลาสมัครสอบ"); - if (exam.RegisterEndDate != null && exam.RegisterEndDate.Value.Date < DateTime.Now.Date) + if (exam.RegisterEndDate != null && exam.RegisterEndDate.Value < DateTime.Now) throw new Exception("หมดเวลาช่วงสมัครสอบ"); var candidate = await _context.Candidates.AsQueryable()