diff --git a/BMA.EHR.Application/Repositories/Commands/CommandReportRepository.cs b/BMA.EHR.Application/Repositories/Commands/CommandReportRepository.cs index e94eb692..440ca883 100644 --- a/BMA.EHR.Application/Repositories/Commands/CommandReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Commands/CommandReportRepository.cs @@ -754,7 +754,7 @@ namespace BMA.EHR.Application.Repositories.Commands Seq = r.Sequence.ToString().ToThaiNumber(), CitizenId = r.CitizenId, FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", - PositionName = p.OrganizationPositionOld, + PositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld, // PositionName = p.Profile.Position == null ? "" : p.Profile.Position.Name, Organization = p.Organization == null ? "" : p.Organization, StartDate = p.DateStart == null ? "" : p.DateStart.Value.ToThaiShortDate2().ToThaiNumber(), diff --git a/BMA.EHR.Application/Repositories/InsigniaPeriodsRepository.cs b/BMA.EHR.Application/Repositories/InsigniaPeriodsRepository.cs index a0dfdc6f..3bb279c2 100644 --- a/BMA.EHR.Application/Repositories/InsigniaPeriodsRepository.cs +++ b/BMA.EHR.Application/Repositories/InsigniaPeriodsRepository.cs @@ -5847,7 +5847,7 @@ namespace BMA.EHR.Application.Repositories FullName = $"{h.Profile.Prefix?.Name}{h.Profile.FirstName} {h.Profile.LastName}", Position = h.Profile.ProfileType == "officer" ? h.Profile.Position?.Name : h.Profile.PositionEmployeePosition?.Name, PosNo = h.Profile.ProfileType == "officer" ? h.Profile.PosNo?.Name : h.Profile.PosNoEmployee, - Rank = h.Profile.ProfileType == "officer" ? $"{h.Profile.PositionType?.Name}/{h.Profile.PositionLevel?.Name}" : $"-", + Rank = h.Profile.ProfileType == "officer" && (h.Profile.PositionType != null && h.Profile.PositionLevel != null) ? $"{h.Profile.PositionType?.Name}/{h.Profile.PositionLevel?.Name}" : $"-", Salary = h.Salary.ToString(), LastInsignia = h.Profile.Insignias.Count == 0 ? "" : h.Profile.Insignias.OrderByDescending(x => x.Year).FirstOrDefault().Insignia.Name, RequestInsignia = h.RequestInsignia.Name,