Merge branch 'develop' into working
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m20s
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m20s
This commit is contained in:
commit
79e0fe7f1b
2 changed files with 258 additions and 36 deletions
|
|
@ -165,9 +165,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||
fullname = fullName,
|
||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
||||
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: profile.Position
|
||||
: profile.PosExecutiveName
|
||||
: string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||
? profile.Position
|
||||
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||
posExecutiveName = profile.PosExecutiveName,
|
||||
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||
leaveDetail = data.LeaveDetail.ToThaiNumber(),
|
||||
leaveDateStart = data.LeaveStartDate.Date.ToThaiShortDate().ToThaiNumber(),
|
||||
leaveDateEnd = data.LeaveEndDate.Date.ToThaiShortDate().ToThaiNumber(),
|
||||
|
|
@ -228,9 +247,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||
fullname = fullName,
|
||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
||||
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: profile.Position
|
||||
: profile.PosExecutiveName
|
||||
: string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||
? profile.Position
|
||||
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||
organizationName = profile!.Oc!.ToThaiNumber() ?? "",
|
||||
posExecutiveName = profile.PosExecutiveName,
|
||||
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||
wifeDayName = data.WifeDayName ?? "",
|
||||
wifeDayDateBorn = data.WifeDayDateBorn == null || data.WifeDayDateBorn == "" ? "" : DateTime.Parse(data.WifeDayDateBorn).ToThaiShortDate().ToThaiNumber(),
|
||||
leaveDateStart = data.LeaveStartDate.Date.ToThaiShortDate().ToThaiNumber(),
|
||||
|
|
@ -289,9 +327,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||
fullname = fullName,
|
||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
||||
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: profile.Position
|
||||
: profile.PosExecutiveName
|
||||
: string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||
? profile.Position
|
||||
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||
organizationName = profile!.Oc!.ToThaiNumber() ?? "",
|
||||
posExecutiveName = profile.PosExecutiveName,
|
||||
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||
|
||||
restDayOldTotal = extendLeave.ToString().ToThaiNumber(),
|
||||
restDayCurrentTotal = (10).ToString().ToThaiNumber(),
|
||||
|
|
@ -357,9 +414,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||
fullname = fullName,
|
||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
||||
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: profile.Position
|
||||
: profile.PosExecutiveName
|
||||
: string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||
? profile.Position
|
||||
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||
organizationName = profile!.Oc!.ToThaiNumber() ?? "",
|
||||
posExecutiveName = profile.PosExecutiveName,
|
||||
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||
|
||||
|
||||
leavegovernmentDate = data.LeaveGovernmentDate == null ? "" : data.LeaveGovernmentDate.Value.Date.ToThaiShortDate().ToThaiNumber(),
|
||||
|
|
@ -393,9 +469,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||
fullname = fullName,
|
||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
||||
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: profile.Position
|
||||
: profile.PosExecutiveName
|
||||
: string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||
? profile.Position
|
||||
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||
organizationName = profile!.Oc!.ToThaiNumber() ?? "",
|
||||
posExecutiveName = profile.PosExecutiveName,
|
||||
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||
|
||||
leavebirthDate = data.LeaveBirthDate == null ? "" : data.LeaveBirthDate.Value.Date.ToThaiShortDate().ToThaiNumber(),
|
||||
leavegovernmentDate = data.LeaveGovernmentDate == null ? "" : data.LeaveGovernmentDate.Value.Date.ToThaiShortDate().ToThaiNumber(),
|
||||
|
|
@ -454,9 +549,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||
fullname = fullName,
|
||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
||||
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: profile.Position
|
||||
: profile.PosExecutiveName
|
||||
: string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||
? profile.Position
|
||||
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||
organizationName = profile!.Oc!.ToThaiNumber() ?? "",
|
||||
posExecutiveName = profile.PosExecutiveName,
|
||||
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||
|
||||
absentDaySummon = data.AbsentDaySummon.ToThaiNumber(),
|
||||
absentDayLocation = data.AbsentDayLocation.ToThaiNumber(),
|
||||
|
|
@ -509,9 +623,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||
fullname = fullName,
|
||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
||||
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: profile.Position
|
||||
: profile.PosExecutiveName
|
||||
: string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||
? profile.Position
|
||||
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||
organizationName = profile!.Oc!.ToThaiNumber() ?? "",
|
||||
posExecutiveName = profile.PosExecutiveName,
|
||||
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||
|
||||
leavebirthDate = data.LeaveBirthDate == null ? "" : data.LeaveBirthDate.Value.Date.ToThaiShortDate().ToThaiNumber(),
|
||||
leavegovernmentDate = data.LeaveGovernmentDate == null ? "" : data.LeaveGovernmentDate.Value.Date.ToThaiShortDate().ToThaiNumber(),
|
||||
|
|
@ -587,9 +720,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||
fullname = fullName,
|
||||
fullnameEng = "",
|
||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
||||
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: profile.Position
|
||||
: profile.PosExecutiveName
|
||||
: string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||
? profile.Position
|
||||
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||
organizationName = profile!.Oc!.ToThaiNumber() ?? "",
|
||||
posExecutiveName = profile.PosExecutiveName,
|
||||
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||
|
||||
leaveDateStart = data.LeaveStartDate.Date.ToThaiShortDate().ToThaiNumber(),
|
||||
leaveDateEnd = data.LeaveEndDate.Date.ToThaiShortDate().ToThaiNumber(),
|
||||
|
|
@ -679,9 +831,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||
fullname = fullName,
|
||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
||||
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: profile.Position
|
||||
: profile.PosExecutiveName
|
||||
: string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||
? profile.Position
|
||||
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||
organizationName = profile!.Oc!.ToThaiNumber() ?? "",
|
||||
posExecutiveName = profile.PosExecutiveName,
|
||||
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||
|
||||
leaveSalary = data.LeaveSalary == null ? "" : data.LeaveSalary.Value.ToNumericText().ToThaiNumber(),
|
||||
leaveSalaryText = data.LeaveSalaryText.ToThaiNumber(),
|
||||
|
|
@ -748,9 +919,28 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
leaveSubTypeName = data.LeaveSubTypeName != null ? data.LeaveSubTypeName.ToThaiNumber() : "",
|
||||
dear = data.CommanderPosition == null ? data.Dear : data.CommanderPosition.ToThaiNumber(),
|
||||
fullname = fullName,
|
||||
positionName = profile!.Position == null ? "-" : profile!.Position.ToThaiNumber(),
|
||||
position = string.IsNullOrEmpty(profile.Position) ? "-" : profile.Position,
|
||||
positionName = (!string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: profile.Position
|
||||
: profile.PosExecutiveName
|
||||
: string.IsNullOrEmpty(profile.Position)
|
||||
? "-"
|
||||
: string.IsNullOrEmpty(profile.PositionLeaveName)
|
||||
? profile.Position
|
||||
: $"{profile.Position}{profile.PositionLeaveName}").ToThaiNumber(),
|
||||
positionLeaveName = profile!.PositionLeaveName == null ? "-" : profile!.PositionLeaveName.ToThaiNumber(),
|
||||
organizationName = profile!.Oc!.ToThaiNumber() ?? "",
|
||||
posExecutiveName = profile.PosExecutiveName,
|
||||
organizationName = profile!.Oc!.ToThaiNumber(),
|
||||
posExOrg = !string.IsNullOrEmpty(profile.PositionLeaveName) &&
|
||||
(profile.PositionLeaveName.Contains("อำนวยการ") || profile.PositionLeaveName.Contains("บริหาร"))
|
||||
? new[] { (profile!.Oc!.ToThaiNumber()) }
|
||||
: !string.IsNullOrEmpty(profile.PosExecutiveName)
|
||||
? new[] { (profile.PosExecutiveName.ToThaiNumber()), (profile!.Oc!.ToThaiNumber()) }
|
||||
: new[] { (profile!.Oc!.ToThaiNumber()) },
|
||||
|
||||
leaveDateStart = data.LeaveStartDate.Date.ToThaiShortDate().ToThaiNumber(),
|
||||
leaveDateEnd = data.LeaveEndDate.Date.ToThaiShortDate().ToThaiNumber(),
|
||||
|
|
@ -2606,11 +2796,12 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
{
|
||||
var _default = new
|
||||
{
|
||||
fullName = "......................",
|
||||
positionName = "......................",
|
||||
positionSign = "......................",
|
||||
updatedAt = "...... /...... /......",
|
||||
comment = "......................",
|
||||
fullName = "............................................",
|
||||
positionName = "............................................",
|
||||
posExOrg = Array.Empty<string>(),
|
||||
positionSign = "............................................",
|
||||
updatedAt = "............/............/............",
|
||||
comment = "......................................................................................................................................................................",
|
||||
approveType = ""
|
||||
};
|
||||
|
||||
|
|
@ -2618,37 +2809,61 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
.Select(x => new
|
||||
{
|
||||
fullName = $"{(x.Prefix ?? "")}{(x.FirstName ?? "")} {(x.LastName ?? "")}".Trim(),
|
||||
positionName = x.PositionName ?? "......................",
|
||||
positionSign = x.PositionSign ?? "......................",
|
||||
positionName = (!string.IsNullOrEmpty(x.PositionLevelName) &&
|
||||
(x.PositionLevelName.Contains("อำนวยการ") || x.PositionLevelName.Contains("บริหาร"))
|
||||
? string.IsNullOrEmpty(x.PosExecutiveName)
|
||||
? string.IsNullOrEmpty(x.PositionName)
|
||||
? "............................................"
|
||||
: x.PositionName
|
||||
: x.PosExecutiveName
|
||||
: string.IsNullOrEmpty(x.PositionName)
|
||||
? "............................................"
|
||||
: string.IsNullOrEmpty(x.PositionLevelName)
|
||||
? x.PositionName
|
||||
: $"{x.PositionName}{x.PositionLevelName}").ToThaiNumber(),
|
||||
posExOrg = !string.IsNullOrEmpty(x.PositionLevelName) &&
|
||||
(x.PositionLevelName.Contains("อำนวยการ") || x.PositionLevelName.Contains("บริหาร"))
|
||||
? new[] { (x!.OrganizationName!.ToThaiNumber()) }
|
||||
: !string.IsNullOrEmpty(x.PosExecutiveName)
|
||||
? new[] { (x.PosExecutiveName.ToThaiNumber()), (x!.OrganizationName!.ToThaiNumber()) }
|
||||
: new[] { (x!.OrganizationName!.ToThaiNumber()) },
|
||||
positionSign = !string.IsNullOrEmpty(x.PositionSign)
|
||||
? x.PositionSign.Replace("\r", "").Replace("\n", " ")
|
||||
: "............................................",
|
||||
updatedAt = x.LastUpdatedAt.HasValue
|
||||
? x.LastUpdatedAt.Value.Date.ToThaiShortDate().ToThaiNumber()
|
||||
: "...... /...... /......",
|
||||
: "............/............/............",
|
||||
comment = !string.IsNullOrEmpty(x.Comment)
|
||||
? x.Comment.Replace("\r", "").Replace("\n", "").Trim()
|
||||
: "......................",
|
||||
? x.Comment.Replace("\r", "").Replace("\n", " ").Trim()
|
||||
: "......................................................................................................................................................................",
|
||||
approveType = (x.ApproveType ?? "").Trim().ToUpper()
|
||||
})
|
||||
.ToList();
|
||||
|
||||
// การเจ้าหน้าที่
|
||||
var sender = approvers
|
||||
.FirstOrDefault(x => x.approveType == "SENDER")
|
||||
?? _default;
|
||||
|
||||
var approver = approvers
|
||||
.FirstOrDefault(x => x.approveType == "APPROVER")
|
||||
?? _default;
|
||||
|
||||
// ผู้บังคับบัญชา (มีได้มากกว่า 1 คน)
|
||||
var commanders = approvers
|
||||
.Where(x => x.approveType == "COMMANDER")
|
||||
.DefaultIfEmpty(_default)
|
||||
.ToList();
|
||||
|
||||
// ผู้มีอำนาจ
|
||||
var approver = approvers
|
||||
.FirstOrDefault(x => x.approveType == "APPROVER")
|
||||
?? _default;
|
||||
|
||||
return new
|
||||
{
|
||||
sign = "............................................",
|
||||
sender = sender,
|
||||
approver = approver,
|
||||
commanders = commanders
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,7 +166,14 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
ProfileId = r.ProfileId,
|
||||
KeycloakId = r.KeycloakId,
|
||||
ApproveStatus = "PENDING",
|
||||
ApproveType = type.Trim().ToUpper()
|
||||
ApproveType = type.Trim().ToUpper(),
|
||||
|
||||
CreatedFullName = FullName ?? "",
|
||||
CreatedUserId = UserId!,
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "",
|
||||
LastUpdateUserId = UserId!,
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -2033,7 +2040,7 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
Prefix = profile.Prefix ?? "",
|
||||
FirstName = profile.FirstName ?? "",
|
||||
LastName = profile.LastName ?? "",
|
||||
PositionName = $"{profile.Position ?? ""}{profile.PositionLeaveName ?? ""}",
|
||||
PositionName = $"{profile.Position ?? ""}",
|
||||
ProfileId = profile.Id,
|
||||
KeycloakId = Guid.Parse(UserId!),
|
||||
ApproveType = "SENDER",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue