fix bug แก้ไขใบลา

This commit is contained in:
Suphonchai Phoonsawat 2024-01-09 15:06:48 +07:00
parent c01ed73e7e
commit 7cae86e577

View file

@ -69,6 +69,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
{
var data = await _dbContext.Set<LeaveRequest>().AsQueryable()
.Include(x => x.LeaveDocument)
.ThenInclude(x => x.Document)
.Include(x => x.LeaveDraftDocument)
.Include(x => x.LeaveCancelDocument)
.Include(x => x.Type)
@ -85,8 +86,8 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
if (entity.LeaveDraftDocument != null)
_dbContext.Attatch(entity.LeaveDraftDocument);
if (entity.LeaveDocument != null)
_dbContext.Attatch(entity.LeaveDocument);
// if (entity.LeaveDocument != null)
// _dbContext.Attatch(entity.LeaveDocument);
if (entity.Type != null)
_dbContext.Attatch(entity.Type);
@ -102,8 +103,8 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
if (entity.LeaveDraftDocument != null)
_dbContext.Attatch(entity.LeaveDraftDocument);
if (entity.LeaveDocument != null)
_dbContext.Attatch(entity.LeaveDocument);
// if (entity.LeaveDocument != null)
// _dbContext.Attatch(entity.LeaveDocument);
if (entity.Type != null)
_dbContext.Attatch(entity.Type);