diff --git a/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs b/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs index 9bed8741..33db52c8 100644 --- a/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs +++ b/BMA.EHR.Discipline.Service/Controllers/DisciplineResultController.cs @@ -1022,7 +1022,8 @@ namespace BMA.EHR.DisciplineResult.Service.Controllers positionname = p.Position, positionno = p.PosNo, organizationname = p.Organization, - salary = r.Amount + salary = r.Amount, + RemarkHorizontal = r.RemarkHorizontal }).ToList(); var result = new List(); diff --git a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs index ef616479..b1dbc350 100644 --- a/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs +++ b/BMA.EHR.Placement.Service/Controllers/PlacementAppointmentController.cs @@ -1231,19 +1231,39 @@ namespace BMA.EHR.Placement.Service.Controllers { No = r.Sequence.ToString().ToThaiNumber(), FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", - OldOrganization = (p.positionOld == null ? "" : p.positionOld) + "/" + (p.OrganizationOld == null ? "" : p.OrganizationOld), - OldPositionLevel = p.PositionLevelOld == null ? "" : p.PositionLevelOld.ToThaiNumber(), - OldPositionNumber = p.PositionNumberOld == null ? null : p.PositionNumberOld.ToThaiNumber(), - OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), - NewOc = (p.position == null ? "" : p.position) + "/" + (p.root == null ? "" : p.root), - NewPositionLevel = p.posLevelName == null ? "" : p.posLevelName.ToThaiNumber(), - NewPositionNumber = p.posMasterNo == null ? "" : + OldOrganization = 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}" : "-", + 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.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}" : "-", + NewPositionLevel = p.posLevelName == null ? "-" : p.posLevelName.ToThaiNumber(), + 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(), + NewSalary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), RemarkHorizontal = r.RemarkHorizontal, RemarkVertical = r.RemarkVertical, }).ToList(); @@ -1407,17 +1427,43 @@ namespace BMA.EHR.Placement.Service.Controllers { No = r.Sequence.ToString().ToThaiNumber(), FullName = $"{r.Prefix}{r.FirstName} {r.LastName}", - OldOc = (p.positionOld == null ? "" : p.positionOld) + "/" + (p.OrganizationOld == null ? "" : p.OrganizationOld), - OldPositionNumber = p.PositionNumberOld == null ? null : p.PositionNumberOld.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}" : "-", + 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() : + p.child1Old != null ? $"{p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : + p.rootOld != null ? $"{p.rootShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : "-", OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(), - NewOc = (p.position == null ? "" : p.position) + "/" + (p.root == null ? "" : p.root), - NewPositionNumber = p.posMasterNo == null ? "" : + 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}" : "-", + 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(), + NewSalary = r.Amount == null ? "-" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(), + ReportingDate = p.ReportingDate == null ? "" : p.ReportingDate.Value.ToThaiShortDate2().ToThaiNumber(), RemarkHorizontal = r.RemarkHorizontal, RemarkVertical = r.RemarkVertical, }).ToList(); @@ -1584,23 +1630,49 @@ 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) + "/" + (p.rootOld == null ? "" : p.rootOld), - OldPositionType = p.posTypeNameOld == null ? "" : p.posTypeNameOld, - OldPositionLevel = p.posLevelNameOld == null ? "" : p.posLevelNameOld, - OldPositionNumber = p.PositionNumberOld == null ? "" : p.PositionNumberOld.ToThaiNumber(), - 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, + Education = p.EducationOld == null ? "-" : p.EducationOld, + 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.posTypeNameOld == null ? "-" : p.posTypeNameOld, + OldPositionLevel = p.posLevelNameOld == null ? "-" : p.posLevelNameOld, + 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() : + p.child1Old != null ? $"{p.child1ShortNameOld}{p.posMasterNoOld}".ToThaiNumber() : + 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.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();