fix LV1_003 - ลบรอบการปฏิบัติงาน (ADMIN)#3

This commit is contained in:
Suphonchai Phoonsawat 2023-12-18 16:03:45 +07:00
parent 0a080b09e4
commit 7c2a4c0280
2 changed files with 11 additions and 1 deletions

View file

@ -277,7 +277,8 @@ namespace BMA.EHR.Leave.Service.Controllers
}
else
{
if (oldData.IsActive || oldData.IsDefault)
var inUseRound = _userDutyTimeRepository.GetFirstInUseRound(oldData.Id);
if (inUseRound != null || oldData.IsActive || oldData.IsDefault)
{
throw new Exception("ไม่สามารถลบรอบการปฏิบัติงานที่ยังใช้งานอยู่ได้");
}