fix code leave and insignia

This commit is contained in:
Suphonchai Phoonsawat 2024-08-26 11:58:42 +07:00
parent 5a208ebb17
commit 5319aa607b
10 changed files with 597 additions and 16 deletions

View file

@ -993,7 +993,7 @@ namespace BMA.EHR.Leave.Service.Controllers
{
Id = d.Id,
//FullName = _userProfileRepository.GetUserFullName(d.KeycloakUserId, AccessToken),
FullName = $"{d.Prefix}{d.FirstName} {d.LastName}",
FullName = $"{d.Prefix ?? ""}{d.FirstName ?? ""} {d.LastName ?? ""}",
CheckInDate = d.CheckIn.Date,
CheckInTime = d.CheckIn.ToString("HH:mm:ss"),
@ -1006,7 +1006,7 @@ namespace BMA.EHR.Leave.Service.Controllers
IsLocationCheckIn = d.IsLocationCheckIn,
CheckInLocationName = d.CheckInLocationName ?? "",
CheckOutDate = d.CheckOut == null ? null : d.CheckOut.Value.Date,
CheckOutDate = d.CheckOut?.Date,
CheckOutTime = d.CheckOut == null ? "" : d.CheckOut.Value.ToString("HH:mm:ss"),
CheckOutLocation = d.CheckOut == null ? "" : d.CheckOutPOI,
CheckOutLat = d.CheckOut == null ? null : d.CheckOutLat,
@ -1201,7 +1201,7 @@ namespace BMA.EHR.Leave.Service.Controllers
data.Add(new CheckInProcessHistoryForAdminDto
{
Id = d.Id,
FullName = $"{d.Prefix}{d.FirstName} {d.LastName}",
FullName = $"{d.Prefix ?? ""}{d.FirstName ?? ""} {d.LastName ?? ""}",
CheckInDate = d.CheckIn.Date,
CheckInTime = d.CheckIn.ToString("HH:mm"),
CheckInLocation = d.CheckInPOI,
@ -1217,10 +1217,10 @@ namespace BMA.EHR.Leave.Service.Controllers
"LATE" :
"NORMAL",
CheckInIsLocation = d.IsLocationCheckIn,
CheckInLocationName = d.CheckInLocationName,
CheckInLocationName = d.CheckInLocationName ?? "",
//CheckInImageUrl = $"{imgUrl}/{d.CheckInImageUrl}",
CheckOutDate = d.CheckOut == null ? null : d.CheckOut.Value.Date,
CheckOutDate = d.CheckOut?.Date,
CheckOutTime = d.CheckOut == null ? "" : d.CheckOut.Value.ToString("HH:mm"),
CheckOutLocation = d.CheckOut == null ? "" : d.CheckOutPOI,
CheckOutLat = d.CheckOut == null ? null : d.CheckOutLat,
@ -1234,7 +1234,7 @@ namespace BMA.EHR.Leave.Service.Controllers
"ABSENT" :
"NORMAL",
CheckOutIsLocation = d.IsLocationCheckOut,
CheckOutLocationName = d.CheckOutLocationName
CheckOutLocationName = d.CheckOutLocationName ?? ""
//CheckOutImageUrl = d.CheckOut == null ? "" : $"{imgUrl}/{d.CheckOutImageUrl}",
});
}