From bcb7c7781c763179e81f6d25b1fc199bfa1838cb Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Wed, 26 Mar 2025 17:12:46 +0700 Subject: [PATCH] #111 , #1271 --- .../PlacementAppointmentController.cs | 48 ++++++------------- .../PlacementAppointmentEmployeeController.cs | 2 +- .../Controllers/PlacementController.cs | 8 ++++ .../Controllers/PlacementOfficerController.cs | 9 +--- .../Controllers/PlacementReceiveController.cs | 12 +++-- .../PlacementRepatriationController.cs | 10 ++-- .../PlacementTransferController.cs | 17 +++---- .../Controllers/RetirementOtherController.cs | 10 ++-- .../Controllers/RetirementOutController.cs | 4 +- .../Controllers/RetirementResignController.cs | 5 +- 10 files changed, 51 insertions(+), 74 deletions(-) diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs index 55406e64..546a5aac 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs @@ -461,7 +461,7 @@ namespace BMA.EHR.Placement.Service.Controllers (org.result.child2 == null ? "" : org.result.child2 + "\n") + (org.result.child1 == null ? "" : org.result.child1 + "\n") + (org.result.root == null ? "" : org.result.root); - placementAppointment.OrganizationPositionOld = org.result.position + "\n" + placementAppointment.OrganizationOld; + placementAppointment.OrganizationPositionOld = org.result.position + "\n" + (placementAppointment.PositionExecutiveOld == null ? "" : placementAppointment.PositionExecutiveOld + "\n") + placementAppointment.OrganizationOld; placementAppointment.AmountOld = org.result.salary; } await _context.PlacementAppointments.AddAsync(placementAppointment); @@ -812,18 +812,14 @@ 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.positionOld == null ? "" : $"{p.positionOld}\n") + - (p.child4Old == null ? "" : $"{p.child4Old}\n") + - (p.child3Old == null ? "" : $"{p.child3Old}\n") + - (p.child2Old == null ? "" : $"{p.child2Old}\n") + - (p.child1Old == null ? "" : $"{p.child1Old}\n") + - (p.rootOld == null ? "" : $"{p.rootOld}"), + OldOc = p.OrganizationPositionOld, 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}\n") + + (p.PositionExecutive == null ? "" : $"{p.PositionExecutive}\n") + (p.child4 == null ? "" : $"{p.child4}\n") + (p.child3 == null ? "" : $"{p.child3}\n") + (p.child2 == null ? "" : $"{p.child2}\n") + @@ -1026,18 +1022,14 @@ 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.positionOld == null ? "" : $"{p.positionOld}\n") + - (p.child4Old == null ? "" : $"{p.child4Old}\n") + - (p.child3Old == null ? "" : $"{p.child3Old}\n") + - (p.child2Old == null ? "" : $"{p.child2Old}\n") + - (p.child1Old == null ? "" : $"{p.child1Old}\n") + - (p.rootOld == null ? "" : $"{p.rootOld}"), + OldOc = p.OrganizationPositionOld, 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}\n") + + NewOc =(p.position == null ? "" : $"{p.position}\n") + + (p.PositionExecutive == null ? "" : $"{p.PositionExecutive}\n") + (p.child4 == null ? "" : $"{p.child4}\n") + (p.child3 == null ? "" : $"{p.child3}\n") + (p.child2 == null ? "" : $"{p.child2}\n") + @@ -1242,16 +1234,12 @@ namespace BMA.EHR.Placement.Service.Controllers { No = r.Sequence.ToString().ToThaiNumber(), FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", - OldOrganization = (p.positionOld == null ? "" : $"{p.positionOld}\n") + - (p.child4Old == null ? "" : $"{p.child4Old}\n") + - (p.child3Old == null ? "" : $"{p.child3Old}\n") + - (p.child2Old == null ? "" : $"{p.child2Old}\n") + - (p.child1Old == null ? "" : $"{p.child1Old}\n") + - (p.rootOld == null ? "" : $"{p.rootOld}"), + OldOrganization = p.OrganizationPositionOld, OldPositionLevel = p.PositionLevelOld == null ? "-" : p.PositionLevelOld.ToThaiNumber(), OldPositionNumber = p.PositionNumberOld == null ? "-" : p.PositionNumberOld.ToThaiNumber(), OldSalary = p.AmountOld == null ? "-" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), NewOc = (p.position == null ? "" : $"{p.position}\n") + + (p.PositionExecutive == null ? "" : $"{p.PositionExecutive}\n") + (p.child4 == null ? "" : $"{p.child4}\n") + (p.child3 == null ? "" : $"{p.child3}\n") + (p.child2 == null ? "" : $"{p.child2}\n") + @@ -1446,13 +1434,8 @@ namespace BMA.EHR.Placement.Service.Controllers { No = r.Sequence.ToString().ToThaiNumber(), FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", - OldOc = (p.positionOld == null ? "" : $"{p.positionOld}\n") + - (p.child4Old == null ? "" : $"{p.child4Old}\n") + - (p.child3Old == null ? "" : $"{p.child3Old}\n") + - (p.child2Old == null ? "" : $"{p.child2Old}\n") + - (p.child1Old == null ? "" : $"{p.child1Old}\n") + - (p.rootOld == null ? "" : $"{p.rootOld}"), - OldPositionNumber = p.posMasterNoOld == null ? "-" : + OldOc = p.OrganizationPositionOld, + OldPositionNumber = p.posMasterNoOld == null ? "-" : p.child4Old != null ? $"{p.child4ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : p.child3Old != null ? $"{p.child3ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : p.child2Old != null ? $"{p.child2ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : @@ -1460,6 +1443,7 @@ namespace BMA.EHR.Placement.Service.Controllers p.rootOld != null ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "-", OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), NewOc = (p.position == null ? "" : $"{p.position}\n") + + (p.PositionExecutive == null ? "" : $"{p.PositionExecutive}\n") + (p.child4 == null ? "" : $"{p.child4}\n") + (p.child3 == null ? "" : $"{p.child3}\n") + (p.child2 == null ? "" : $"{p.child2}\n") + @@ -1661,12 +1645,7 @@ 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.positionOld == null ? "" : $"{p.positionOld}\n") + - (p.child4Old == null ? "" : $"{p.child4Old}\n") + - (p.child3Old == null ? "" : $"{p.child3Old}\n") + - (p.child2Old == null ? "" : $"{p.child2Old}\n") + - (p.child1Old == null ? "" : $"{p.child1Old}\n") + - (p.rootOld == null ? "" : $"{p.rootOld}"), + OldOc = p.OrganizationPositionOld, OldPositionType = p.posTypeNameOld == null ? "-" : p.posTypeNameOld, OldPositionLevel = p.posLevelNameOld == null ? "-" : p.posLevelNameOld, OldPositionNumber = p.posMasterNoOld == null ? "-" : @@ -1677,7 +1656,8 @@ namespace BMA.EHR.Placement.Service.Controllers p.rootOld != null ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "-", OldSalary = p.AmountOld == null ? "-" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), PositionDate = p.PositionDate == null ? "-" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(), - NewOc = (p.position == null ? "" : $"{p.position}\n") + + NewOc = (p.position == null ? "" : $"{p.position}\n") + + (p.PositionExecutive == null ? "" : $"{p.PositionExecutive}\n") + (p.child4 == null ? "" : $"{p.child4}\n") + (p.child3 == null ? "" : $"{p.child3}\n") + (p.child2 == null ? "" : $"{p.child2}\n") + diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs index 227448d9..d3fc40a7 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentEmployeeController.cs @@ -488,7 +488,7 @@ namespace BMA.EHR.Placement.Service.Controllers (org.result.child2 == null ? "" : org.result.child2 + "\n") + (org.result.child1 == null ? "" : org.result.child1 + "\n") + (org.result.root == null ? "" : org.result.root); - placementAppointment.OrganizationPositionOld = org.result.position + "\n" + placementAppointment.OrganizationOld; + placementAppointment.OrganizationPositionOld = org.result.position + "\n" + (placementAppointment.PositionExecutiveOld == null ? "" : placementAppointment.PositionExecutiveOld + "\n") + placementAppointment.OrganizationOld; } await _context.PlacementAppointments.AddAsync(placementAppointment); await _context.SaveChangesAsync(); diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs index f47673e8..761fa022 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementController.cs @@ -1629,6 +1629,7 @@ namespace BMA.EHR.Placement.Service.Controllers 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.positionName == null ? "" : $"{p.positionName}\n") + + (p.PositionExecutive == null ? "" : $"{p.PositionExecutive}\n") + (p.child4 == null ? "" : $"{p.child4}\n") + (p.child3 == null ? "" : $"{p.child3}\n") + (p.child2 == null ? "" : $"{p.child2}\n") + @@ -1959,6 +1960,7 @@ namespace BMA.EHR.Placement.Service.Controllers 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.positionName == null ? "" : $"{p.positionName}\n") + + (p.PositionExecutive == null ? "" : $"{p.PositionExecutive}\n") + (p.child4 == null ? "" : $"{p.child4}\n") + (p.child3 == null ? "" : $"{p.child3}\n") + (p.child2 == null ? "" : $"{p.child2}\n") + @@ -2282,6 +2284,7 @@ namespace BMA.EHR.Placement.Service.Controllers Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "-" : p.PlacementEducations.FirstOrDefault().Degree, OldOc = (p.positionNameOld == null ? "" : $"{p.positionNameOld}\n") + + (p.PositionExecutiveOld == null ? "" : $"{p.PositionExecutiveOld}\n") + (p.child4Old == null ? "" : $"{p.child4Old}\n") + (p.child3Old == null ? "" : $"{p.child3Old}\n") + (p.child2Old == null ? "" : $"{p.child2Old}\n") + @@ -2298,6 +2301,7 @@ namespace BMA.EHR.Placement.Service.Controllers OldSalary = p.AmountOld == null ? "-" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), OldPosition = p.positionNameOld == null ? "-" : p.positionNameOld, NewOc = (p.positionName == null ? "" : $"{p.positionName}\n") + + (p.PositionExecutive == null ? "" : $"{p.PositionExecutive}\n") + (p.child4 == null ? "" : $"{p.child4}\n") + (p.child3 == null ? "" : $"{p.child3}\n") + (p.child2 == null ? "" : $"{p.child2}\n") + @@ -2512,6 +2516,7 @@ namespace BMA.EHR.Placement.Service.Controllers Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "-" : p.PlacementEducations.FirstOrDefault().Degree, OldOc = (p.positionNameOld == null ? "" : $"{p.positionNameOld}\n") + + (p.PositionExecutiveOld == null ? "" : $"{p.PositionExecutiveOld}\n") + (p.child4Old == null ? "" : $"{p.child4Old}\n") + (p.child3Old == null ? "" : $"{p.child3Old}\n") + (p.child2Old == null ? "" : $"{p.child2Old}\n") + @@ -2528,6 +2533,7 @@ namespace BMA.EHR.Placement.Service.Controllers p.nodeOld == "0" ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "-", OldSalary = p.AmountOld == null ? "-" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), NewOc = (p.positionName == null ? "" : $"{p.positionName}\n") + + (p.PositionExecutive == null ? "" : $"{p.PositionExecutive}\n") + (p.child4 == null ? "" : $"{p.child4}\n") + (p.child3 == null ? "" : $"{p.child3}\n") + (p.child2 == null ? "" : $"{p.child2}\n") + @@ -2731,6 +2737,7 @@ namespace BMA.EHR.Placement.Service.Controllers Education = p.PlacementEducations == null || p.PlacementEducations.Count == 0 ? "-" : p.PlacementEducations.FirstOrDefault().Degree, OldOc = (p.positionNameOld == null ? "" : $"{p.positionNameOld}\n") + + (p.PositionExecutiveOld == null ? "" : $"{p.PositionExecutiveOld}\n") + (p.child4Old == null ? "" : $"{p.child4Old}\n") + (p.child3Old == null ? "" : $"{p.child3Old}\n") + (p.child2Old == null ? "" : $"{p.child2Old}\n") + @@ -2747,6 +2754,7 @@ namespace BMA.EHR.Placement.Service.Controllers OldSalary = p.Amount == null ? "-" : p.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), LeaveDate = "-", NewOc = (p.positionName == null ? "" : $"{p.positionName}\n") + + (p.PositionExecutive == null ? "" : $"{p.PositionExecutive}\n") + (p.child4 == null ? "" : $"{p.child4}\n") + (p.child3 == null ? "" : $"{p.child3}\n") + (p.child2 == null ? "" : $"{p.child2}\n") + diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs index bd34d64a..9e14cb5a 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementOfficerController.cs @@ -411,7 +411,7 @@ namespace BMA.EHR.Placement.Service.Controllers (org.result.child2 == null ? "" : org.result.child2 + "\n") + (org.result.child1 == null ? "" : org.result.child1 + "\n") + (org.result.root == null ? "" : org.result.root); - placementOfficer.OrganizationPositionOld = org.result.position + "\n" + placementOfficer.OrganizationOld; + placementOfficer.OrganizationPositionOld = org.result.position + "\n" + (placementOfficer.PositionExecutiveOld == null ? "" : placementOfficer.PositionExecutiveOld + "\n") + placementOfficer.OrganizationOld; } await _context.PlacementOfficers.AddAsync(placementOfficer); await _context.SaveChangesAsync(); @@ -614,12 +614,7 @@ namespace BMA.EHR.Placement.Service.Controllers { No = r.Sequence.ToString().ToThaiNumber(), FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", - PositionName = (p.PositionOld == null ? "" : $"{p.PositionOld}\n") + - (p.child4Old == null ? "" : $"{p.child4Old}\n") + - (p.child3Old == null ? "" : $"{p.child3Old}\n") + - (p.child2Old == null ? "" : $"{p.child2Old}\n") + - (p.child1Old == null ? "" : $"{p.child1Old}\n") + - (p.rootOld == null ? "" : $"{p.rootOld}"), + PositionName = p.OrganizationPositionOld, 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 99bf35eb..16384f30 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementReceiveController.cs @@ -501,12 +501,12 @@ namespace BMA.EHR.Placement.Service.Controllers placementReceive.PositionLevelOld = org.result.posLevelName; placementReceive.PositionTypeOld = org.result.posTypeName; placementReceive.PositionNumberOld = org.result.nodeShortName + org.result.posMasterNo; - placementReceive.OrganizationOld = (org.result.child4 == null ? "" : org.result.child4 + " ") + - (org.result.child3 == null ? "" : org.result.child3 + " ") + - (org.result.child2 == null ? "" : org.result.child2 + " ") + - (org.result.child1 == null ? "" : org.result.child1 + " ") + + placementReceive.OrganizationOld = (org.result.child4 == null ? "" : org.result.child4 + "\n") + + (org.result.child3 == null ? "" : org.result.child3 + "\n") + + (org.result.child2 == null ? "" : org.result.child2 + "\n") + + (org.result.child1 == null ? "" : org.result.child1 + "\n") + (org.result.root == null ? "" : org.result.root); - placementReceive.OrganizationPositionOld = org.result.position + "\n" + placementReceive.OrganizationOld; + placementReceive.OrganizationPositionOld = org.result.position + "\n" + (placementReceive.PositionExecutiveOld == null ? "" : placementReceive.PositionExecutiveOld + "\n") + placementReceive.OrganizationOld; } } await _context.PlacementReceives.AddAsync(placementReceive); @@ -940,6 +940,7 @@ namespace BMA.EHR.Placement.Service.Controllers Education = p.EducationOld == null ? "-" : p.EducationOld, OldOrg = p.OrganizationPositionOld ?? "-", OldOc = (p.PositionOld == null ? "" : $"{p.PositionOld}\n") + + (p.PositionExecutiveOld == null ? "" : $"{p.PositionExecutiveOld}\n") + (p.child4Old == null ? "" : $"{p.child4Old}\n") + (p.child3Old == null ? "" : $"{p.child3Old}\n") + (p.child2Old == null ? "" : $"{p.child2Old}\n") + @@ -949,6 +950,7 @@ namespace BMA.EHR.Placement.Service.Controllers OldPositionLevel = p.PositionLevelOld ?? "-", OldSalary = p.AmountOld == null ? "-" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), NewOc = (p.position == null ? "" : $"{p.position}\n") + + (p.PositionExecutive == null ? "" : $"{p.PositionExecutive}\n") + (p.child4 == null ? "" : $"{p.child4}\n") + (p.child3 == null ? "" : $"{p.child3}\n") + (p.child2 == null ? "" : $"{p.child2}\n") + diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs index ab55e124..da1b3256 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementRepatriationController.cs @@ -283,12 +283,12 @@ namespace BMA.EHR.Placement.Service.Controllers placementRepatriation.PositionLevelOld = org.result.posLevelName; placementRepatriation.PositionTypeOld = org.result.posTypeName; placementRepatriation.PositionNumberOld = org.result.nodeShortName + org.result.posMasterNo; - placementRepatriation.OrganizationOld = (org.result.child4 == null ? "" : org.result.child4 + " ") + - (org.result.child3 == null ? "" : org.result.child3 + " ") + - (org.result.child2 == null ? "" : org.result.child2 + " ") + - (org.result.child1 == null ? "" : org.result.child1 + " ") + + placementRepatriation.OrganizationOld = (org.result.child4 == null ? "" : org.result.child4 + "\n") + + (org.result.child3 == null ? "" : org.result.child3 + "\n") + + (org.result.child2 == null ? "" : org.result.child2 + "\n") + + (org.result.child1 == null ? "" : org.result.child1 + "\n") + (org.result.root == null ? "" : org.result.root); - placementRepatriation.OrganizationPositionOld = org.result.position + "\n" + placementRepatriation.OrganizationOld; + placementRepatriation.OrganizationPositionOld = org.result.position + "\n" + (placementRepatriation.PositionExecutiveOld == null ? "" : placementRepatriation.PositionExecutiveOld + "\n") + placementRepatriation.OrganizationOld; } await _context.PlacementRepatriations.AddAsync(placementRepatriation); await _context.SaveChangesAsync(); diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs index eb8c5315..c1d1e7d4 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementTransferController.cs @@ -541,12 +541,12 @@ namespace BMA.EHR.Placement.Service.Controllers placementTransfer.PositionLevelOld = org.result.posLevelName; placementTransfer.PositionTypeOld = org.result.posTypeName; placementTransfer.PositionNumberOld = org.result.nodeShortName + org.result.posMasterNo; - placementTransfer.OrganizationOld = (org.result.child4 == null ? "" : org.result.child4 + " ") + - (org.result.child3 == null ? "" : org.result.child3 + " ") + - (org.result.child2 == null ? "" : org.result.child2 + " ") + - (org.result.child1 == null ? "" : org.result.child1 + " ") + + placementTransfer.OrganizationOld = (org.result.child4 == null ? "" : org.result.child4 + "\n") + + (org.result.child3 == null ? "" : org.result.child3 + "\n") + + (org.result.child2 == null ? "" : org.result.child2 + "\n") + + (org.result.child1 == null ? "" : org.result.child1 + "\n") + (org.result.root == null ? "" : org.result.root); - placementTransfer.OrganizationPositionOld = org.result.position + "\n" + placementTransfer.OrganizationOld; + placementTransfer.OrganizationPositionOld = org.result.position + "\n" + (placementTransfer.PositionExecutiveOld == null ? "" : placementTransfer.PositionExecutiveOld + "\n") + placementTransfer.OrganizationOld; } await _context.PlacementTransfers.AddAsync(placementTransfer); await _context.SaveChangesAsync(); @@ -805,12 +805,7 @@ namespace BMA.EHR.Placement.Service.Controllers { No = r.Sequence.ToString().ToThaiNumber(), FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", - OldOc = (p.PositionOld == null ? "" : $"{p.PositionOld}\n") + - (p.child4Old == null ? "" : $"{p.child4Old}\n") + - (p.child3Old == null ? "" : $"{p.child3Old}\n") + - (p.child2Old == null ? "" : $"{p.child2Old}\n") + - (p.child1Old == null ? "" : $"{p.child1Old}\n") + - (p.rootOld == null ? "" : $"{p.rootOld}"), + OldOc = p.OrganizationPositionOld, PositionType = p.PositionTypeOld == null ? "-" : p.PositionTypeOld, PositionLevel = p.PositionLevelOld == null ? "-" : p.PositionLevelOld, PositionNumber = p.PositionNumberOld == null ? "-" : p.PositionNumberOld.ToThaiNumber(), diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs index 61608786..4c4f4d7c 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOtherController.cs @@ -330,7 +330,7 @@ namespace BMA.EHR.Retirement.Service.Controllers (org.result.child2 == null ? "" : org.result.child2 + "\n") + (org.result.child1 == null ? "" : org.result.child1 + "\n") + (org.result.root == null ? "" : org.result.root); - retirementOther.OrganizationPositionOld = org.result.position + "\n" + retirementOther.OrganizationOld; + retirementOther.OrganizationPositionOld = org.result.position + "\n" + (retirementOther.PositionExecutiveOld == null ? "" : retirementOther.PositionExecutiveOld + "\n") + retirementOther.OrganizationOld; retirementOther.EducationOld = org.result.education; retirementOther.AmountOld = org.result.salary; } @@ -825,12 +825,7 @@ 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.PositionOld == null ? "" : $"{p.PositionOld}\n") + - (p.child4Old == null ? "" : $"{p.child4Old}\n") + - (p.child3Old == null ? "" : $"{p.child3Old}\n") + - (p.child2Old == null ? "" : $"{p.child2Old}\n") + - (p.child1Old == null ? "" : $"{p.child1Old}\n") + - (p.rootOld == null ? "" : $"{p.rootOld}"), + OldOc = p.OrganizationPositionOld, OldPositionType = p.PositionTypeOld == null ? "-" : p.PositionTypeOld, OldPositionLevel = p.PositionLevelOld == null ? "-" : p.PositionLevelOld, OldPositionNumber = p.PositionNumberOld == null ? "-" : p.PositionNumberOld.ToThaiNumber(), @@ -838,6 +833,7 @@ namespace BMA.EHR.Retirement.Service.Controllers LeaveDate = p.LeaveDate == null ? "-" : p.LeaveDate.Value.ToThaiShortDate2().ToThaiNumber(), MilitaryDate = p.MilitaryDate == null ? "-" : p.MilitaryDate.Value.ToThaiShortDate2().ToThaiNumber(), NewOc = (p.PositionOld == null ? "" : $"{p.PositionOld}\n") + + (p.PositionExecutiveOld == null ? "" : $"{p.PositionExecutiveOld}\n") + (p.child4Old == null ? "" : $"{p.child4Old}\n") + (p.child3Old == null ? "" : $"{p.child3Old}\n") + (p.child2Old == null ? "" : $"{p.child2Old}\n") + diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs index 356ee3eb..21c6290f 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementOutController.cs @@ -307,7 +307,7 @@ namespace BMA.EHR.Retirement.Service.Controllers (org.result.child2 == null ? "" : org.result.child2 + "\n") + (org.result.child1 == null ? "" : org.result.child1 + "\n") + (org.result.root == null ? "" : org.result.root); - retirementOut.OrganizationPositionOld = org.result.position + "\n" + retirementOut.OrganizationOld; + retirementOut.OrganizationPositionOld = org.result.position + "\n" + (retirementOut.PositionExecutiveOld == null ? "" : retirementOut.PositionExecutiveOld + "\n") + retirementOut.OrganizationOld; retirementOut.AmountOld = org.result.salary; } } @@ -362,7 +362,7 @@ namespace BMA.EHR.Retirement.Service.Controllers (org.result.child2 == null ? "" : org.result.child2 + "\n") + (org.result.child1 == null ? "" : org.result.child1 + "\n") + (org.result.root == null ? "" : org.result.root); - retirementOut.OrganizationPositionOld = org.result.position + "\n" + retirementOut.OrganizationOld; + retirementOut.OrganizationPositionOld = org.result.position + "\n" + (retirementOut.PositionExecutiveOld == null ? "" : retirementOut.PositionExecutiveOld + "\n") + retirementOut.OrganizationOld; retirementOut.AmountOld = org.result.salary; } } diff --git a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs index eec2d627..28c379a7 100644 --- a/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs +++ b/BMA.EHR.Retirement.Service/Controllers/RetirementResignController.cs @@ -948,7 +948,7 @@ namespace BMA.EHR.Retirement.Service.Controllers (org.result.child2 == null ? "" : org.result.child2 + "\n") + (org.result.child1 == null ? "" : org.result.child1 + "\n") + (org.result.root == null ? "" : org.result.root); - retirementResign.OrganizationPositionOld = org.result.position + "\n" + retirementResign.OrganizationOld; + retirementResign.OrganizationPositionOld = org.result.position + "\n" + (retirementResign.PositionExecutiveOld == null ? "" : retirementResign.PositionExecutiveOld + "\n") + retirementResign.OrganizationOld; } await _context.RetirementResigns.AddAsync(retirementResign); await _context.SaveChangesAsync(); @@ -2357,7 +2357,8 @@ namespace BMA.EHR.Retirement.Service.Controllers FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", PositionName = p.PositionOld ?? "-", Organization = p.OrganizationPositionOld ?? "-", - Oc = (p.PositionOld == null ? "" : $"{p.PositionOld}\n") + + Oc = (p.PositionOld == null ? "" : $"{p.PositionOld}\n") + + (p.PositionExecutiveOld == null ? "" : $"{p.PositionExecutiveOld}\n") + (p.child4Old == null ? "" : $"{p.child4Old}\n") + (p.child3Old == null ? "" : $"{p.child3Old}\n") + (p.child2Old == null ? "" : $"{p.child2Old}\n") +