This commit is contained in:
parent
ef9a42a97a
commit
8d7ca40e00
1 changed files with 21 additions and 36 deletions
|
|
@ -174,23 +174,17 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
// previousPosTypeName = profile.posTypeName;
|
||||
// bool isDuplicatePosLevel = profile.posLevelName == previousPosLevelName;
|
||||
// previousPosLevelName = profile.posLevelName;
|
||||
var _child = (profile.posExecutiveName == null ? "" : profile.posExecutiveName + "\n") +
|
||||
(profile.child4 == null ? "" : profile.child4 + "\n") +
|
||||
(profile.child3 == null ? "" : profile.child3 + "\n") +
|
||||
(profile.child2 == null ? "" : profile.child2 + "\n") +
|
||||
(profile.child1 == null ? "" : profile.child1 + "\n") +
|
||||
(profile.reason == null ? "" : profile.reason);
|
||||
int lastNewLinechild = _child.LastIndexOf('\n');
|
||||
if (lastNewLinechild != -1)
|
||||
{
|
||||
_child = _child.Remove(lastNewLinechild, 1);
|
||||
}
|
||||
return new ProfileRetireJsonRequest
|
||||
{
|
||||
order = $"{ (index + 1).ToString().ToThaiNumber() }. ลำดับที่ { (profile.order).ToString().ToThaiNumber() }",
|
||||
fullName = $"{profile.prefix}{profile.firstName} {profile.lastName}",
|
||||
root = "",
|
||||
child = _child,
|
||||
child = (profile.posExecutiveName == null ? "" : profile.posExecutiveName + "\n") +
|
||||
(profile.child4 == null ? "" : profile.child4 + "\n") +
|
||||
(profile.child3 == null ? "" : profile.child3 + "\n") +
|
||||
(profile.child2 == null ? "" : profile.child2 + "\n") +
|
||||
(profile.child1 == null ? "" : profile.child1 + "\n") +
|
||||
(profile.reason == null ? "" : profile.reason),
|
||||
position = profile.position != "" && profile.position != null ? profile.position : "-",
|
||||
posNo = profile.posNo != "" && profile.posNo != null ? profile.posNo?.ToThaiNumber() : "-",
|
||||
reason = profile.reason != "" && profile.reason != null ? profile.reason : "-",
|
||||
|
|
@ -300,38 +294,29 @@ namespace BMA.EHR.Application.Repositories.Reports
|
|||
}
|
||||
bool isDuplicateHospital = profile.child1 == previousChild1;
|
||||
previousChild1 = profile.child1;
|
||||
if (isDuplicateHospital == false)
|
||||
{
|
||||
previousPosTypeName = null;
|
||||
previousPosLevelName = null;
|
||||
}
|
||||
bool isDuplicatePosType = profile.posTypeName == previousPosTypeName;
|
||||
previousPosTypeName = profile.posTypeName;
|
||||
bool isDuplicatePosLevel = profile.posLevelName == previousPosLevelName;
|
||||
previousPosLevelName = profile.posLevelName;
|
||||
var _root = (isDuplicateRoot ? "" : profile.root + "\n") +
|
||||
(isDuplicateHospital || !hospital.ToObject<List<string>>().Contains(profile.child1)
|
||||
? ""
|
||||
: profile.child1 + "\n") +
|
||||
(isDuplicatePosType ? "" : $"ตำแหน่งประเภท{profile.posTypeName}" + "\n") +
|
||||
(isDuplicatePosLevel ? "" : $"ระดับ{profile.posLevelName}");
|
||||
int lastNewLineroot = _root.LastIndexOf('\n');
|
||||
if (lastNewLineroot != -1)
|
||||
{
|
||||
_root = _root.Remove(lastNewLineroot, 1);
|
||||
}
|
||||
var _child = (profile.posExecutiveName == null ? "" : profile.posExecutiveName + "\n") +
|
||||
(profile.child4 == null ? "" : profile.child4 + "\n") +
|
||||
(profile.child3 == null ? "" : profile.child3 + "\n") +
|
||||
(profile.child2 == null ? "" : profile.child2 + "\n") +
|
||||
(profile.child1 == null || hospital.ToObject<List<string>>().Contains(profile.child1) ? "" : profile.child1 + "\n") +
|
||||
(profile.reason == null ? "" : profile.reason);
|
||||
int lastNewLinechild = _child.LastIndexOf('\n');
|
||||
if (lastNewLinechild != -1)
|
||||
{
|
||||
_child = _child.Remove(lastNewLinechild, 1);
|
||||
}
|
||||
return new ProfileRetireJsonRequest
|
||||
{
|
||||
order = (index + 1).ToString().ToThaiNumber(),
|
||||
fullName = $"{profile.prefix}{profile.firstName} {profile.lastName}",
|
||||
root = _root,
|
||||
child = _child,
|
||||
root = (isDuplicateRoot ? "" : profile.root + "\n") +
|
||||
(isDuplicateHospital || !hospital.ToObject<List<string>>().Contains(profile.child1) ? "" : profile.child1 + "\n") +
|
||||
(isDuplicatePosType ? "" : $"ตำแหน่งประเภท{profile.posTypeName}" + "\n") +
|
||||
(isDuplicatePosLevel ? "" : $"ระดับ{profile.posLevelName}"),
|
||||
child = (profile.posExecutiveName == null ? "" : profile.posExecutiveName + "\n") +
|
||||
(profile.child4 == null ? "" : profile.child4 + "\n") +
|
||||
(profile.child3 == null ? "" : profile.child3 + "\n") +
|
||||
(profile.child2 == null ? "" : profile.child2 + "\n") +
|
||||
(profile.child1 == null || hospital.ToObject<List<string>>().Contains(profile.child1) ? "" : profile.child1 + "\n") +
|
||||
(profile.reason == null ? "" : profile.reason),
|
||||
position = profile.position != "" && profile.position != null ? profile.position : "-",
|
||||
posNo = profile.posNo != "" && profile.posNo != null ? profile.posNo?.ToThaiNumber() : "-",
|
||||
reason = profile.reason != "" && profile.reason != null ? profile.reason : "-",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue