แก้บันทึกวันลา

This commit is contained in:
kittapath 2024-12-06 12:19:23 +07:00
parent b5fb9ac84d
commit 7cd06be198

View file

@ -108,13 +108,13 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
if (entity.LeaveDocument != null) if (entity.LeaveDocument != null)
{ {
foreach(var d in entity.LeaveDocument) foreach (var d in entity.LeaveDocument)
{ {
_dbContext.Attatch(d); _dbContext.Attatch(d);
} }
} }
if (entity.Type != null) if (entity.Type != null)
_dbContext.Attatch(entity.Type); _dbContext.Attatch(entity.Type);
@ -334,7 +334,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
return await rawData.ToListAsync(); return await rawData.ToListAsync();
} }
public async Task<LeaveRequest> ApproveCancelLeaveRequestAsync(LeaveRequest data,string Reason) public async Task<LeaveRequest> ApproveCancelLeaveRequestAsync(LeaveRequest data, string Reason)
{ {
try try
{ {
@ -365,7 +365,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
{ {
throw; throw;
} }
} }
@ -564,9 +564,9 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
leaveTypeId = rawData?.Type?.Id ?? null, leaveTypeId = rawData?.Type?.Id ?? null,
dateLeaveStart = rawData.LeaveStartDate, dateLeaveStart = rawData.LeaveStartDate,
dateLeaveEnd = rawData.LeaveEndDate, dateLeaveEnd = rawData.LeaveEndDate,
leaveDays = 0,//หน้า fe ไม่ได้ใช้ totalLeave = 0,//หน้า fe ไม่ได้ใช้
leaveCount = 0,//หน้า fe ไม่ได้ใช้ leaveCount = 0,//หน้า fe ไม่ได้ใช้
totalLeave = rawData.LeaveTotal, leaveDays = rawData.LeaveTotal,
status = "approve", status = "approve",
reason = rawData.LeaveDetail, reason = rawData.LeaveDetail,
}); });