From 5ef296851bcea93267b414c86aa295bdcea30d4d Mon Sep 17 00:00:00 2001 From: Bright Date: Thu, 24 Oct 2024 18:00:32 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=81=E0=B8=99?= =?UTF-8?q?=E0=B8=9A=E0=B8=97=E0=B9=89=E0=B8=B2=E0=B8=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlacementAppointmentController.cs | 76 +++++-- .../Controllers/PlacementController.cs | 185 ++++++++++++------ .../Controllers/PlacementOfficerController.cs | 12 +- .../Controllers/PlacementReceiveController.cs | 40 +++- .../PlacementTransferController.cs | 26 ++- .../Controllers/RetirementOtherController.cs | 64 +++--- 6 files changed, 282 insertions(+), 121 deletions(-) diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs index 8ab16fdc..c64be772 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs @@ -817,13 +817,33 @@ namespace BMA.EHR.Placement.Service.Controllers No = r.Sequence.ToString().ToThaiNumber(), FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", Education = p.EducationOld == null ? "-" : p.EducationOld, - OldOc = (p.OrganizationPositionOld == null ? "-" : p.OrganizationPositionOld) + "/" + (p.rootOld == null ? "" : p.rootOld), + OldOc = p.rootOld == null ? p.positionOld == null ? "-" : $"{p.positionOld}/-" : + p.child4Old != null + ? p.positionOld == null ? $"{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child3Old != null + ? p.positionOld == null ? $"{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child2Old != null + ? p.positionOld == null ? $"{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child1Old != null + ? p.positionOld == null ? $"{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child1Old}/{p.rootOld}" : + p.rootOld != null + ? p.positionOld == null ? $"{p.rootOld}" : $"{p.positionOld}/{p.rootOld}" : "-", OldPositionType = p.PositionTypeOld == null ? "-" : p.PositionTypeOld, OldPositionLevel = p.PositionLevelOld == null ? "-" : p.PositionLevelOld, OldPositionNumber = p.PositionNumberOld == null ? "-" : p.PositionNumberOld.ToThaiNumber(), - OldSalary = p.AmountOld == null ? "-" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), - LeaveDate = "", - NewOc = (p.position == null ? "" : p.position) + "/" + (p.root == null ? "" : p.root), + OldSalary = p.Amount == null ? "-" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), + LeaveDate = "-", + NewOc = p.root == null ? p.position == null ? "-" : $"{p.position}/-" : + p.node == 4 + ? p.position == null ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.position}/{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : + p.node == 3 + ? p.position == null ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.position}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : + p.node == 2 + ? p.position == null ? $"{p.child2}/{p.child1}/{p.root}" : $"{p.position}/{p.child2}/{p.child1}/{p.root}" : + p.node == 1 + ? p.position == null ? $"{p.child1}/{p.root}" : $"{p.position}/{p.child1}/{p.root}" : + p.node == 0 + ? p.position == null ? $"{p.root}" : $"{p.position}/{p.root}" : "-", NewPositionType = p.posTypeName == null ? "-" : p.posTypeName, NewPositionLevel = p.posLevelName == null ? "-" : p.posLevelName, NewPositionNumber = p.posMasterNo == null ? "-" : @@ -831,7 +851,7 @@ namespace BMA.EHR.Placement.Service.Controllers p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() : - p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "", + p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "-", NewSalary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), AppointDate = p.ReportingDate == null ? "-" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(), RemarkHorizontal = r.RemarkHorizontal, @@ -976,23 +996,43 @@ namespace BMA.EHR.Placement.Service.Controllers No = r.Sequence.ToString().ToThaiNumber(), FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", Education = p.EducationOld == null ? "-" : p.EducationOld, - OldOc = (p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld) + "/" + (p.rootOld == null ? "" : p.rootOld), - OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld, - OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld, - OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(), - OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), - LeaveDate = "", - NewOc = (p.position == null ? "" : p.position) + "/" + (p.root == null ? "" : p.root), - NewPositionType = p.posTypeName == null ? "" : p.posTypeName, - NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName, - NewPositionNumber = p.posMasterNo == null ? "" : + OldOc = p.rootOld == null ? p.positionOld == null ? "-" : $"{p.positionOld}/-" : + p.child4Old != null + ? p.positionOld == null ? $"{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child3Old != null + ? p.positionOld == null ? $"{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child2Old != null + ? p.positionOld == null ? $"{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child1Old != null + ? p.positionOld == null ? $"{p.child1Old}/{p.rootOld}" : $"{p.positionOld}/{p.child1Old}/{p.rootOld}" : + p.rootOld != null + ? p.positionOld == null ? $"{p.rootOld}" : $"{p.positionOld}/{p.rootOld}" : "-", + OldPositionType = p.PositionTypeOld == null ? "-" : p.PositionTypeOld, + OldPositionLevel = p.PositionLevelOld == null ? "-" : p.PositionLevelOld, + OldPositionNumber = p.PositionNumberOld == null ? "-" : p.PositionNumberOld.ToThaiNumber(), + OldSalary = p.AmountOld == null ? "-" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), + LeaveDate = "-", + NewOc = p.root == null ? p.position == null ? "-" : $"{p.position}/-" : + p.node == 4 + ? p.position == null ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.position}/{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : + p.node == 3 + ? p.position == null ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.position}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : + p.node == 2 + ? p.position == null ? $"{p.child2}/{p.child1}/{p.root}" : $"{p.position}/{p.child2}/{p.child1}/{p.root}" : + p.node == 1 + ? p.position == null ? $"{p.child1}/{p.root}" : $"{p.position}/{p.child1}/{p.root}" : + p.node == 0 + ? p.position == null ? $"{p.root}" : $"{p.position}/{p.root}" : "-", + NewPositionType = p.posTypeName == null ? "-" : p.posTypeName, + NewPositionLevel = p.posLevelName == null ? "-" : p.posLevelName, + NewPositionNumber = p.posMasterNo == null ? "-" : p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() : - p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "", - NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), - AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(), + p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "-", + NewSalary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), + AppointDate = p.ReportingDate == null ? "-" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(), RemarkHorizontal = r.RemarkHorizontal, RemarkVertical = r.RemarkVertical, }).ToList(); diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs index 459aee65..385725ee 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs @@ -1562,12 +1562,17 @@ namespace BMA.EHR.Placement.Service.Controllers PositionName = p.positionName == null ? "-" : p.positionName, ExamNumber = p.ExamNumber == null ? "-" : p.ExamNumber.Value.ToString().ToThaiNumber(), PlacementName = $"{p.Placement.Name.ToThaiNumber()} ครั้งที่ {p.Placement.Round.ToThaiNumber()}/{p.Placement.Year.ToThaiYear().ToString().ToThaiNumber()}", - Oc = p.root == null ? "" : - p.node == 4 ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : - p.node == 3 ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" : - p.node == 2 ? $"{p.child2}/{p.child1}/{p.root}" : - p.node == 1 ? $"{p.child1}/{p.root}" : - p.node == 0 ? $"{p.root}" : "", + Oc = p.root == null ? p.positionName == null ? "-" : $"{p.positionName}/-" : + p.node == 4 + ? p.positionName == null ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.positionName}/{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : + p.node == 3 + ? p.positionName == null ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.positionName}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : + p.node == 2 + ? p.positionName == null ? $"{p.child2}/{p.child1}/{p.root}" : $"{p.positionName}/{p.child2}/{p.child1}/{p.root}" : + p.node == 1 + ? p.positionName == null ? $"{p.child1}/{p.root}" : $"{p.positionName}/{p.child1}/{p.root}" : + p.node == 0 + ? p.positionName == null ? $"{p.root}" : $"{p.positionName}/{p.root}" : "-", PositionType = p.posTypeName == null ? "-" : p.posTypeName, PositionLevel = p.posLevelName == null ? "-" : p.posLevelName, PositionNumber = p.posMasterNo == null ? "-" : @@ -1575,13 +1580,24 @@ namespace BMA.EHR.Placement.Service.Controllers p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() : - p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "", + p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "-", Salary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber().ToThaiNumber(), AppointDate = p.ReportingDate == null ? "-" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(), + OccupationPosition = p.OccupationPosition == null ? "-" : p.OccupationPosition, //ตำแหน่งเก่าก่อนสอบ + PositionCandidate = p.PositionCandidate == null ? "-" : p.PositionCandidate.Name, //ตำแหน่งที่สอบแข่งขัน + OcCandidate = p.root == null ? p.PositionCandidate == null ? "-" : $"{p.PositionCandidate}/-" : + p.node == 4 + ? p.PositionCandidate.Name == null ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.PositionCandidate.Name}/{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : + p.node == 3 + ? p.PositionCandidate.Name == null ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.PositionCandidate.Name}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : + p.node == 2 + ? p.PositionCandidate.Name == null ? $"{p.child2}/{p.child1}/{p.root}" : $"{p.PositionCandidate.Name}/{p.child2}/{p.child1}/{p.root}" : + p.node == 1 + ? p.PositionCandidate.Name == null ? $"{p.child1}/{p.root}" : $"{p.PositionCandidate.Name}/{p.child1}/{p.root}" : + p.node == 0 + ? p.PositionCandidate.Name == null ? $"{p.root}" : $"{p.PositionCandidate.Name}/{p.root}" : "-", RemarkHorizontal = r.RemarkHorizontal, RemarkVertical = r.RemarkVertical, - OccupationPosition = p.OccupationPosition == null ? "-" : p.OccupationPosition, //ตำแหน่งเก่าก่อนสอบ - PositionCandidate = p.PositionCandidate == null ? "-" : p.PositionCandidate.Name //ตำแหน่งที่สอบแข่งขัน }).ToList(); return Success(report_data); } @@ -1830,12 +1846,17 @@ namespace BMA.EHR.Placement.Service.Controllers PositionName = p.positionName == null ? "-" : p.positionName, ExamNumber = p.ExamNumber == null ? "-" : p.ExamNumber.Value.ToString().ToThaiNumber(), PlacementName = $"{p.Placement.Name.ToThaiNumber()} ครั้งที่ {p.Placement.Round.ToThaiNumber()}/{p.Placement.Year.ToThaiYear().ToString().ToThaiNumber()}", - Oc = p.root == null ? "" : - p.node == 4 ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : - p.node == 3 ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" : - p.node == 2 ? $"{p.child2}/{p.child1}/{p.root}" : - p.node == 1 ? $"{p.child1}/{p.root}" : - p.node == 0 ? $"{p.root}" : "", + Oc = p.root == null ? p.positionName == null ? "-" : $"{p.positionName}/-" : + p.node == 4 + ? p.positionName == null ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.positionName}/{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : + p.node == 3 + ? p.positionName == null ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.positionName}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : + p.node == 2 + ? p.positionName == null ? $"{p.child2}/{p.child1}/{p.root}" : $"{p.positionName}/{p.child2}/{p.child1}/{p.root}" : + p.node == 1 + ? p.positionName == null ? $"{p.child1}/{p.root}" : $"{p.positionName}/{p.child1}/{p.root}" : + p.node == 0 + ? p.positionName == null ? $"{p.root}" : $"{p.positionName}/{p.root}" : "-", PositionType = p.posTypeName == null ? "-" : p.posTypeName, PositionLevel = p.posLevelName == null ? "-" : p.posLevelName, PositionNumber = p.posMasterNo == null ? "-" : @@ -1843,12 +1864,12 @@ namespace BMA.EHR.Placement.Service.Controllers p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() : - p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "", + p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "-", Salary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber().ToThaiNumber(), AppointDate = p.ReportingDate == null ? "-" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(), + PositionCandidate = p.PositionCandidate == null ? "-" : p.PositionCandidate.Name, RemarkHorizontal = r.RemarkHorizontal, RemarkVertical = r.RemarkVertical, - PositionCandidate = p.PositionCandidate == null ? "-" : p.PositionCandidate.Name }).ToList(); return Success(report_data); } @@ -2095,12 +2116,17 @@ namespace BMA.EHR.Placement.Service.Controllers FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "-" : p.PlacementEducations.FirstOrDefault().Degree, - OldOc = p.rootOld == null ? "" : - p.nodeOld == "4" ? $"{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : - p.nodeOld == "3" ? $"{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : - p.nodeOld == "2" ? $"{p.child2Old}/{p.child1Old}/{p.rootOld}" : - p.nodeOld == "1" ? $"{p.child1Old}/{p.rootOld}" : - p.nodeOld == "0" ? $"{p.rootOld}" : "", + OldOc = p.rootOld == null ? p.positionNameOld == null ? "-" : $"{p.positionNameOld}/-" : + p.nodeOld == "4" + ? p.positionNameOld == null ? $"{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionNameOld}/{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.nodeOld == "3" + ? p.positionNameOld == null ? $"{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionNameOld}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.nodeOld == "2" + ? p.positionNameOld == null ? $"{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionNameOld}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.nodeOld == "1" + ? p.positionNameOld == null ? $"{p.child1Old}/{p.rootOld}" : $"{p.positionNameOld}/{p.child1Old}/{p.rootOld}" : + p.nodeOld == "0" + ? p.positionNameOld == null ? $"{p.rootOld}" : $"{p.positionNameOld}/{p.rootOld}" : "-", OldPositionType = p.posTypeNameOld == null ? "-" : p.posTypeNameOld, OldPositionLevel = p.posLevelNameOld == null ? "-" : p.posLevelNameOld, OldPositionNumber = p.posMasterNoOld == null ? "-" : @@ -2108,15 +2134,20 @@ namespace BMA.EHR.Placement.Service.Controllers p.nodeOld == "3" ? $"{p.child3ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : p.nodeOld == "2" ? $"{p.child2ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : p.nodeOld == "1" ? $"{p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : - p.nodeOld == "0" ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "", - OldSalary = p.AmountOld == null ? "-" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), + p.nodeOld == "0" ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "-", + OldSalary = p.Amount == null ? "-" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), OldPosition = p.positionNameOld == null ? "-" : p.positionNameOld, - NewOc = p.root == null ? "" : - p.node == 4 ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : - p.node == 3 ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" : - p.node == 2 ? $"{p.child2}/{p.child1}/{p.root}" : - p.node == 1 ? $"{p.child1}/{p.root}" : - p.node == 0 ? $"{p.root}" : "", + NewOc = p.root == null ? p.positionName == null ? "-" : $"{p.positionName}/-" : + p.node == 4 + ? p.positionName == null ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.positionName}/{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : + p.node == 3 + ? p.positionName == null ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.positionName}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : + p.node == 2 + ? p.positionName == null ? $"{p.child2}/{p.child1}/{p.root}" : $"{p.positionName}/{p.child2}/{p.child1}/{p.root}" : + p.node == 1 + ? p.positionName == null ? $"{p.child1}/{p.root}" : $"{p.positionName}/{p.child1}/{p.root}" : + p.node == 0 + ? p.positionName == null ? $"{p.root}" : $"{p.positionName}/{p.root}" : "-", NewPosition = p.positionName == null ? "-" : p.positionName, NewPositionType = p.posTypeName == null ? "-" : p.posTypeName, NewPositionLevel = p.posLevelName == null ? "-" : p.posLevelName, @@ -2125,7 +2156,7 @@ namespace BMA.EHR.Placement.Service.Controllers p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() : - p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "", + p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "-", NewSalary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), AppointDate = p.ReportingDate == null ? "-" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(), RemarkHorizontal = r.RemarkHorizontal, @@ -2279,12 +2310,17 @@ namespace BMA.EHR.Placement.Service.Controllers FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "-" : p.PlacementEducations.FirstOrDefault().Degree, - OldOc = p.rootOld == null ? "" : - p.nodeOld == "4" ? $"{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : - p.nodeOld == "3" ? $"{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : - p.nodeOld == "2" ? $"{p.child2Old}/{p.child1Old}/{p.rootOld}" : - p.nodeOld == "1" ? $"{p.child1Old}/{p.rootOld}" : - p.nodeOld == "0" ? $"{p.rootOld}" : "", + OldOc = p.rootOld == null ? p.positionNameOld == null ? "-" : $"{p.positionNameOld}/-" : + p.nodeOld == "4" + ? p.positionNameOld == null ? $"{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionNameOld}/{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.nodeOld == "3" + ? p.positionNameOld == null ? $"{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionNameOld}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.nodeOld == "2" + ? p.positionNameOld == null ? $"{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionNameOld}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.nodeOld == "1" + ? p.positionNameOld == null ? $"{p.child1Old}/{p.rootOld}" : $"{p.positionNameOld}/{p.child1Old}/{p.rootOld}" : + p.nodeOld == "0" + ? p.positionNameOld == null ? $"{p.rootOld}" : $"{p.positionNameOld}/{p.rootOld}" : "-", OldPosition = p.positionNameOld == null ? "-" : p.positionNameOld, OldPositionType = p.posTypeNameOld == null ? "-" : p.posTypeNameOld, OldPositionLevel = p.posLevelNameOld == null ? "-" : p.posLevelNameOld, @@ -2293,14 +2329,19 @@ namespace BMA.EHR.Placement.Service.Controllers p.nodeOld == "3" ? $"{p.child3ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : p.nodeOld == "2" ? $"{p.child2ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : p.nodeOld == "1" ? $"{p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : - p.nodeOld == "0" ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "", - OldSalary = p.AmountOld == null ? "-" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), - NewOc = p.root == null ? "" : - p.node == 4 ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : - p.node == 3 ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" : - p.node == 2 ? $"{p.child2}/{p.child1}/{p.root}" : - p.node == 1 ? $"{p.child1}/{p.root}" : - p.node == 0 ? $"{p.root}" : "", + p.nodeOld == "0" ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "-", + OldSalary = p.Amount == null ? "-" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), + NewOc = p.root == null ? p.positionName == null ? "-" : $"{p.positionName}/-" : + p.node == 4 + ? p.positionName == null ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.positionName}/{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : + p.node == 3 + ? p.positionName == null ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.positionName}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : + p.node == 2 + ? p.positionName == null ? $"{p.child2}/{p.child1}/{p.root}" : $"{p.positionName}/{p.child2}/{p.child1}/{p.root}" : + p.node == 1 + ? p.positionName == null ? $"{p.child1}/{p.root}" : $"{p.positionName}/{p.child1}/{p.root}" : + p.node == 0 + ? p.positionName == null ? $"{p.root}" : $"{p.positionName}/{p.root}" : "-", NewPosition = p.positionName == null ? "-" : p.positionName, NewPositionType = p.posTypeName == null ? "-" : p.posTypeName, NewPositionLevel = p.posLevelName == null ? "-" : p.posLevelName, @@ -2309,7 +2350,7 @@ namespace BMA.EHR.Placement.Service.Controllers p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() : - p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "", + p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "-", NewSalary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), AppointDate = p.ReportingDate == null ? "-" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(), RemarkHorizontal = r.RemarkHorizontal, @@ -2454,30 +2495,50 @@ namespace BMA.EHR.Placement.Service.Controllers { No = r.Sequence.ToString().ToThaiNumber(), FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", - Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "" : + Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "-" : p.PlacementEducations.FirstOrDefault().Degree, - OldOc = (p.positionNameOld == null ? "" : p.positionNameOld) + "/" + (p.rootOld == null ? "" : p.rootOld), - OldPositionType = p.posTypeNameOld == null ? "" : p.posTypeNameOld, - OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld, - OldPositionNumber = p.posMasterNoOld == null ? "" : + OldOc = p.rootOld == null ? p.positionNameOld == null ? "-" : $"{p.positionNameOld}/-" : + p.nodeOld == "4" + ? p.positionNameOld == null ? $"{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionNameOld}/{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.nodeOld == "3" + ? p.positionNameOld == null ? $"{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionNameOld}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.nodeOld == "2" + ? p.positionNameOld == null ? $"{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.positionNameOld}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.nodeOld == "1" + ? p.positionNameOld == null ? $"{p.child1Old}/{p.rootOld}" : $"{p.positionNameOld}/{p.child1Old}/{p.rootOld}" : + p.nodeOld == "0" + ? p.positionNameOld == null ? $"{p.rootOld}" : $"{p.positionNameOld}/{p.rootOld}" : "-", + OldPositionType = p.posTypeNameOld == null ? "-" : p.posTypeNameOld, + OldPositionLevel = p.posLevelNameOld == null ? "-" : p.posLevelNameOld, + OldPositionNumber = p.posMasterNoOld == null ? "-" : p.nodeOld == "4" ? $"{p.child4ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : p.nodeOld == "3" ? $"{p.child3ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : p.nodeOld == "2" ? $"{p.child2ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : p.nodeOld == "1" ? $"{p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : - p.nodeOld == "0" ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "", - OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), - LeaveDate = "", - NewOc = (p.positionName == null ? "" : p.positionName) + "/" + (p.root == null ? "" : p.root), - NewPositionType = p.posTypeName == null ? "" : p.posTypeName, - NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName, - NewPositionNumber = p.posMasterNo == null ? "" : + p.nodeOld == "0" ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "-", + OldSalary = p.Amount == null ? "-" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), + LeaveDate = "-", + NewOc = p.root == null ? p.positionName == null ? "-" : $"{p.positionName}/-" : + p.node == 4 + ? p.positionName == null ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.positionName}/{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : + p.node == 3 + ? p.positionName == null ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.positionName}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : + p.node == 2 + ? p.positionName == null ? $"{p.child2}/{p.child1}/{p.root}" : $"{p.positionName}/{p.child2}/{p.child1}/{p.root}" : + p.node == 1 + ? p.positionName == null ? $"{p.child1}/{p.root}" : $"{p.positionName}/{p.child1}/{p.root}" : + p.node == 0 + ? p.positionName == null ? $"{p.root}" : $"{p.positionName}/{p.root}" : "-", + NewPositionType = p.posTypeName == null ? "-" : p.posTypeName, + NewPositionLevel = p.posLevelName == null ? "-" : p.posLevelName, + NewPositionNumber = p.posMasterNo == null ? "-" : p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() : - p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "", - NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), - AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(), + p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "-", + NewSalary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), + AppointDate = p.ReportingDate == null ? "-" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(), RemarkHorizontal = r.RemarkHorizontal, RemarkVertical = r.RemarkVertical, }).ToList(); diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs index 9bb194ac..1278de12 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs @@ -642,7 +642,17 @@ namespace BMA.EHR.Placement.Service.Controllers { No = r.Sequence.ToString().ToThaiNumber(), FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", - PositionName = p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld, + PositionName = p.rootOld == null ? p.PositionOld == null ? "-" : $"{p.PositionOld}/-" : + p.child4Old != null + ? p.PositionOld == null ? $"{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child3Old != null + ? p.PositionOld == null ? $"{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child2Old != null + ? p.PositionOld == null ? $"{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child1Old != null + ? p.PositionOld == null ? $"{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child1Old}/{p.rootOld}" : + p.rootOld != null + ? p.PositionOld == null ? $"{p.rootOld}" : $"{p.PositionOld}/{p.rootOld}" : "-", Organization = p.Organization == null ? "" : p.Organization, StartDate = p.DateStart == null ? "" : p.DateStart.Value.ToThaiShortDate2().ToThaiNumber(), EndDate = p.DateEnd == null ? "" : p.DateEnd.Value.ToThaiShortDate2().ToThaiNumber(), diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs index 5b9085e7..4c3c330e 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs @@ -953,21 +953,41 @@ namespace BMA.EHR.Placement.Service.Controllers No = r.Sequence.ToString().ToThaiNumber(), FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", Education = p.EducationOld == null ? "-" : p.EducationOld, - OldOc = p.OrganizationPositionOld ?? "", - OldPositionType = p.PositionTypeOld ?? "", - OldPositionLevel = p.PositionLevelOld ?? "", - OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), - NewOc = (p.position == null ? "" : p.position) + "/" + (p.root == null ? "" : p.root), - NewPositionType = p.posTypeName == null ? "" : p.posTypeName, - NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName, - NewPositionNumber = p.posMasterNo == null ? "" : + OldOc = p.rootOld == null ? p.PositionOld == null ? "-" : $"{p.PositionOld}/-" : + p.child4Old != null + ? p.PositionOld == null ? $"{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child3Old != null + ? p.PositionOld == null ? $"{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child2Old != null + ? p.PositionOld == null ? $"{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child1Old != null + ? p.PositionOld == null ? $"{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child1Old}/{p.rootOld}" : + p.rootOld != null + ? p.PositionOld == null ? $"{p.rootOld}" : $"{p.PositionOld}/{p.rootOld}" : "-", + OldPositionType = p.PositionTypeOld ?? "-", + OldPositionLevel = p.PositionLevelOld ?? "-", + OldSalary = p.Amount == null ? "-" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), + NewOc = p.root == null ? p.position == null ? "-" : $"{p.position}/-" : + p.node == 4 + ? p.position == null ? $"{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.position}/{p.child4}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : + p.node == 3 + ? p.position == null ? $"{p.child3}/{p.child2}/{p.child1}/{p.root}" : $"{p.position}/{p.child3}/{p.child2}/{p.child1}/{p.root}" : + p.node == 2 + ? p.position == null ? $"{p.child2}/{p.child1}/{p.root}" : $"{p.position}/{p.child2}/{p.child1}/{p.root}" : + p.node == 1 + ? p.position == null ? $"{p.child1}/{p.root}" : $"{p.position}/{p.child1}/{p.root}" : + p.node == 0 + ? p.position == null ? $"{p.root}" : $"{p.position}/{p.root}" : "-", + NewPositionType = p.posTypeName == null ? "-" : p.posTypeName, + NewPositionLevel = p.posLevelName == null ? "-" : p.posLevelName, + NewPositionNumber = p.posMasterNo == null ? "-" : p.node == 4 ? $"{p.child4ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 3 ? $"{p.child3ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 2 ? $"{p.child2ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 1 ? $"{p.child1ShortName}{p.posMasterNo}".ToThaiNumber() : p.node == 0 ? $"{p.rootShortName}{p.posMasterNo}".ToThaiNumber() : "", - NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), - AppointDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(), + NewSalary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), + AppointDate = p.ReportingDate == null ? "-" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(), RemarkHorizontal = r.RemarkHorizontal, RemarkVertical = r.RemarkVertical, }).ToList(); diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs index 282f08e3..607b88aa 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs @@ -845,14 +845,24 @@ namespace BMA.EHR.Placement.Service.Controllers { No = r.Sequence.ToString().ToThaiNumber(), FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", - Oc = (p.PositionOld == null ? "" : p.PositionOld) + "/" + (p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld), - PositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld, - PositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld, - PositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(), - Salary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), - ReceiveOrganizationName = p.Organization == null ? "" : p.Organization, - ActiveDate = p.Date == null ? "" : p.Date.Value.ToThaiShortDate2().ToThaiNumber(), - Reason = p.Reason ?? "", + OldOc = p.rootOld == null ? p.PositionOld == null ? "-" : $"{p.PositionOld}/-" : + p.child4Old != null + ? p.PositionOld == null ? $"{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child3Old != null + ? p.PositionOld == null ? $"{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child2Old != null + ? p.PositionOld == null ? $"{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child1Old != null + ? p.PositionOld == null ? $"{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child1Old}/{p.rootOld}" : + p.rootOld != null + ? p.PositionOld == null ? $"{p.rootOld}" : $"{p.PositionOld}/{p.rootOld}" : "-", + PositionType = p.PositionTypeOld == null ? "-" : p.PositionTypeOld, + PositionLevel = p.PositionLevelOld == null ? "-" : p.PositionLevelOld, + PositionNumber = p.PositionNumberOld == null ? "-" : p.PositionNumberOld.ToThaiNumber(), + Salary = p.AmountOld == null ? "-" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), + ReceiveOrganizationName = p.Organization == null ? "-" : p.Organization, + ActiveDate = p.Date == null ? "-" : p.Date.Value.ToThaiShortDate2().ToThaiNumber(), + Reason = p.Reason ?? "-", RemarkHorizontal = r.RemarkHorizontal, RemarkVertical = r.RemarkVertical, }).ToList(); diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs index 263d33ab..81452701 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs @@ -699,17 +699,17 @@ namespace BMA.EHR.Retirement.Service.Controllers FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", Education = p.EducationOld == null ? "-" : p.EducationOld, OldOc = (p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld) + "/" + (p.rootOld == null ? "" : p.rootOld), - OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld, - OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld, - OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(), - OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), - LeaveDate = "", + OldPositionType = p.PositionTypeOld == null ? "-" : p.PositionTypeOld, + OldPositionLevel = p.PositionLevelOld == null ? "-" : p.PositionLevelOld, + OldPositionNumber = p.PositionNumberOld == null ? "-" : p.PositionNumberOld.ToThaiNumber(), + OldSalary = p.Amount == null ? "-" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), + LeaveDate = p.LeaveDate == null ? "-" : p.LeaveDate.ToString(), NewOc = (p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld) + "/" + (p.rootOld == null ? "" : p.rootOld), - NewPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld, - NewPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld, - NewPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(), - NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), - AppointDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(), + NewPositionType = p.PositionTypeOld == null ? "-" : p.PositionTypeOld, + NewPositionLevel = p.PositionLevelOld == null ? "-" : p.PositionLevelOld, + NewPositionNumber = p.PositionNumberOld == null ? "-" : p.PositionNumberOld.ToThaiNumber(), + NewSalary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), + AppointDate = p.PositionDate == null ? "-" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(), RemarkHorizontal = r.RemarkHorizontal, RemarkVertical = r.RemarkVertical, }).ToList(); @@ -850,19 +850,39 @@ namespace BMA.EHR.Retirement.Service.Controllers No = r.Sequence.ToString().ToThaiNumber(), FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", Education = p.EducationOld == null ? "-" : p.EducationOld, - OldOc = (p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld) + "/" + (p.rootOld == null ? "" : p.rootOld), - OldPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld, - OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld, - OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(), - OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), + OldOc = p.rootOld == null ? p.PositionOld == null ? "-" : $"{p.PositionOld}/-" : + p.child4Old != null + ? p.PositionOld == null ? $"{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child3Old != null + ? p.PositionOld == null ? $"{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child2Old != null + ? p.PositionOld == null ? $"{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child1Old != null + ? p.PositionOld == null ? $"{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child1Old}/{p.rootOld}" : + p.rootOld != null + ? p.PositionOld == null ? $"{p.rootOld}" : $"{p.PositionOld}/{p.rootOld}" : "-", + OldPositionType = p.PositionTypeOld == null ? "-" : p.PositionTypeOld, + OldPositionLevel = p.PositionLevelOld == null ? "-" : p.PositionLevelOld, + OldPositionNumber = p.PositionNumberOld == null ? "-" : p.PositionNumberOld.ToThaiNumber(), + OldSalary = p.Amount == null ? "-" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), LeaveDate = p.LeaveDate == null ? "-" : p.LeaveDate.ToString(), - MilitaryDate = p.MilitaryDate == null ? "" : p.MilitaryDate.Value.ToThaiShortDate2().ToThaiNumber(), - NewOc = (p.OrganizationPositionOld == null ? "" : p.OrganizationPositionOld) + "/" + (p.rootOld == null ? "" : p.rootOld), - NewPositionType = p.PositionTypeOld == null ? "" : p.PositionTypeOld, - NewPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld, - NewPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(), - NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), - AppointDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(), + MilitaryDate = p.MilitaryDate == null ? "-" : p.MilitaryDate.Value.ToThaiShortDate2().ToThaiNumber(), + NewOc = p.rootOld == null ? p.PositionOld == null ? "-" : $"{p.PositionOld}/-" : + p.child4Old != null + ? p.PositionOld == null ? $"{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child4Old}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child3Old != null + ? p.PositionOld == null ? $"{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child3Old}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child2Old != null + ? p.PositionOld == null ? $"{p.child2Old}/{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child2Old}/{p.child1Old}/{p.rootOld}" : + p.child1Old != null + ? p.PositionOld == null ? $"{p.child1Old}/{p.rootOld}" : $"{p.PositionOld}/{p.child1Old}/{p.rootOld}" : + p.rootOld != null + ? p.PositionOld == null ? $"{p.rootOld}" : $"{p.PositionOld}/{p.rootOld}" : "-", + NewPositionType = p.PositionTypeOld == null ? "-" : p.PositionTypeOld, + NewPositionLevel = p.PositionLevelOld == null ? "-" : p.PositionLevelOld, + NewPositionNumber = p.PositionNumberOld == null ? "-" : p.PositionNumberOld.ToThaiNumber(), + NewSalary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), + AppointDate = p.PositionDate == null ? "-" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(), RemarkHorizontal = r.RemarkHorizontal, RemarkVertical = r.RemarkVertical, }).ToList();