แก้บั้กออกคำสั่งบรรจุ

This commit is contained in:
Suphonchai Phoonsawat 2023-08-20 11:07:18 +07:00
parent 7d88274dae
commit 99485f64e0
4 changed files with 33 additions and 10 deletions

View file

@ -28,7 +28,7 @@ namespace BMA.EHR.Application.Repositories
#region " Methods "
public string GetOrganizationNameFullPath(Guid id, bool showRoot = false, bool descending = false)
public string GetOrganizationNameFullPath(Guid id, bool showRoot = false, bool descending = false,string seperator = " ")
{
try
{
@ -39,7 +39,7 @@ namespace BMA.EHR.Application.Repositories
var ret = String.Empty;
foreach (var oc in ocList)
{
ret = oc.Name + " " + ret;
ret = oc.Name + seperator + ret;
}
if (ret.Length > 2)
ret = ret.Substring(0, ret.Length - 1);
@ -65,7 +65,7 @@ namespace BMA.EHR.Application.Repositories
{
Id = x.Id,
Name = x.OrganizationOrganization!.Name,
ParentId = x.Parent!.Id
ParentId = x.Parent == null ? Guid.Empty : x.Parent!.Id
})
.FirstOrDefault(x => x.Id == id);
@ -81,7 +81,7 @@ namespace BMA.EHR.Application.Repositories
//else
// ocList.Add(new OrganizationItem { Id = oc.OCId, Name = oc.OrganizationName });
if (ocData.ParentId != null)
if (ocData.ParentId != Guid.Empty)
{
ocList.AddRange(GetOCWithFullPath(ocData.ParentId, showRoot));
}