diff --git a/BMA.EHR.Leave/Controllers/LeaveReportController.cs b/BMA.EHR.Leave/Controllers/LeaveReportController.cs index 55cb2378..e839af77 100644 --- a/BMA.EHR.Leave/Controllers/LeaveReportController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveReportController.cs @@ -2618,10 +2618,9 @@ namespace BMA.EHR.Leave.Service.Controllers updatedAt = x.LastUpdatedAt.HasValue ? x.LastUpdatedAt.Value.Date.ToThaiShortDate().ToThaiNumber() : "...... /...... /......", - comment = (x.Comment ?? "") - .Replace("\r", "") - .Replace("\n", "") - .Trim(), + comment = !string.IsNullOrEmpty(x.Comment) + ? x.Comment.Replace("\r", "").Replace("\n", "").Trim() + : "......................", approveType = (x.ApproveType ?? "").Trim().ToUpper() }) .ToList(); diff --git a/BMA.EHR.Leave/Controllers/LeaveRequestController.cs b/BMA.EHR.Leave/Controllers/LeaveRequestController.cs index 9233b374..cf17535f 100644 --- a/BMA.EHR.Leave/Controllers/LeaveRequestController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveRequestController.cs @@ -2027,10 +2027,10 @@ namespace BMA.EHR.Leave.Service.Controllers { new LeaveRequestApprover { - Prefix = profile.Prefix, - FirstName = profile.FirstName, - LastName = profile.LastName, - PositionName = profile.Position, + Prefix = profile.Prefix ?? "", + FirstName = profile.FirstName ?? "", + LastName = profile.LastName ?? "", + PositionName = $"{profile.Position ?? ""}{profile.PositionLeaveName ?? ""}", ProfileId = profile.Id, KeycloakId = Guid.Parse(UserId!), ApproveType = "SENDER",