This commit is contained in:
parent
a299c07b48
commit
dcbb845c0e
1 changed files with 5 additions and 3 deletions
|
|
@ -2744,7 +2744,9 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
|
||||
if (old != null)
|
||||
{
|
||||
return Error(new Exception("ไม่สามารถทำรายการได้ เนื่องจากมีการกำหนดรอบการทำงานในวันที่นี้ไว้แล้ว"), StatusCodes.Status400BadRequest);
|
||||
// ลบของเก่าออกเพื่อใส่ของใหม่
|
||||
await _userDutyTimeRepository.DeleteAsync(old);
|
||||
//return Error(new Exception("ไม่สามารถทำรายการได้ เนื่องจากมีการกำหนดรอบการทำงานในวันที่นี้ไว้แล้ว"), StatusCodes.Status400BadRequest);
|
||||
}
|
||||
|
||||
var data = new UserDutyTime
|
||||
|
|
@ -2801,8 +2803,8 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
|
||||
if (old != null)
|
||||
{
|
||||
continue; // move to next item if already exist, not return error
|
||||
//return Error(new Exception($"กำหนดรอบลงเวลาของ {req.FirstName} {req.LastName} ผิดพลาด เนื่องจากมีการกำหนดรอบการทำงานในวันที่นี้ไว้แล้ว"), StatusCodes.Status400BadRequest);
|
||||
// ลบของเก่าออก เพื่อที่จะใส่รายการใหม่
|
||||
await _userDutyTimeRepository.DeleteAsync(old);
|
||||
}
|
||||
|
||||
var data = new UserDutyTime
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue