แก้ไขหมาย้หตุคำสั่ง

This commit is contained in:
Kittapath 2023-10-02 19:51:38 +07:00
parent a76ba4270f
commit ccf19c5683
21 changed files with 16530 additions and 70 deletions

View file

@ -315,8 +315,9 @@ namespace BMA.EHR.Application.Repositories.Commands
orderby r.Sequence
select new CommandType03Response
{
Education = pf.Educations == null || pf.Educations.Count == 0 ? "" :
pf.Educations.OrderByDescending(x => x.StartDate).FirstOrDefault().Degree,
// Education = pf.Educations == null || pf.Educations.Count == 0 ? "" :
// pf.Educations.OrderByDescending(x => x.StartDate).FirstOrDefault().Degree,
Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId,
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
@ -325,14 +326,16 @@ namespace BMA.EHR.Application.Repositories.Commands
OldPositionLevel = pf.PositionLevel == null ? "" : pf.PositionLevel.Name,
OldPositionType = pf.PositionType == null ? "" : pf.PositionType.Name,
OldPositionNumber = pf.PosNo == null ? "" : pf.PosNo.Name.ToThaiNumber(),
OldSalary = pf.Salaries == null || pf.Salaries.Count == 0 ? "" : pf.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
// OldSalary = pf.Salaries == null || pf.Salaries.Count == 0 ? "" : pf.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
NewOc = _organizationCommonRepository.GetOrganizationNameFullPath(p.OrganizationPosition!.Organization!.Id, false, false, "/"),
NewPositionName = p.PositionPath == null ? "" : p.PositionPath!.Name,
NewPositionLevel = p.PositionLevel == null ? "" : p.PositionLevel.Name,
NewPositionType = p.PositionType == null ? "" : p.PositionType.Name,
NewPositionNumber = p.PositionNumber == null ? "" : p.PositionNumber.Name.ToThaiNumber(),
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.RecruitDate == null ? "" : p.RecruitDate.Value.ToThaiShortDate2().ToThaiNumber()
AppointDate = p.RecruitDate == null ? "" : p.RecruitDate.Value.ToThaiShortDate2().ToThaiNumber(),
Reason = p.Reason == null ? "-" : p.Reason,
})
.ToList();
@ -377,8 +380,9 @@ namespace BMA.EHR.Application.Repositories.Commands
orderby r.Sequence
select new CommandType03Response
{
Education = pf.Educations == null || pf.Educations.Count == 0 ? "" :
pf.Educations.OrderByDescending(x => x.StartDate).FirstOrDefault().Degree,
// Education = pf.Educations == null || pf.Educations.Count == 0 ? "" :
// pf.Educations.OrderByDescending(x => x.StartDate).FirstOrDefault().Degree,
Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId,
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
@ -387,14 +391,16 @@ namespace BMA.EHR.Application.Repositories.Commands
OldPositionLevel = pf.PositionLevel == null ? "" : pf.PositionLevel.Name,
OldPositionType = pf.PositionType == null ? "" : pf.PositionType.Name,
OldPositionNumber = pf.PosNo == null ? "" : pf.PosNo.Name.ToThaiNumber(),
OldSalary = pf.Salaries == null || pf.Salaries.Count == 0 ? "" : pf.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
// OldSalary = pf.Salaries == null || pf.Salaries.Count == 0 ? "" : pf.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
NewOc = _organizationCommonRepository.GetOrganizationNameFullPath(p.OrganizationPosition!.Organization!.Id, false, false, "/"),
NewPositionName = p.PositionPath == null ? "" : p.PositionPath!.Name,
NewPositionLevel = p.PositionLevel == null ? "" : p.PositionLevel.Name,
NewPositionType = p.PositionType == null ? "" : p.PositionType.Name,
NewPositionNumber = p.PositionNumber == null ? "" : p.PositionNumber.Name.ToThaiNumber(),
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.RecruitDate == null ? "" : p.RecruitDate.Value.ToThaiShortDate2().ToThaiNumber()
AppointDate = p.RecruitDate == null ? "" : p.RecruitDate.Value.ToThaiShortDate2().ToThaiNumber(),
Reason = p.Reason == null ? "-" : p.Reason,
})
.ToList();
@ -431,9 +437,8 @@ namespace BMA.EHR.Application.Repositories.Commands
.ThenInclude(x => x.PositionType)
.Include(x => x.Profile)
.ThenInclude(x => x.PosNo)
.Include(x => x.Profile)
.Include(x => x.Profile)
.ThenInclude(x => x.Educations)
.Include(x => x.OrganizationPosition)
.ThenInclude(x => x.Organization)
.Include(x => x.PositionPath)
@ -444,8 +449,9 @@ namespace BMA.EHR.Application.Repositories.Commands
orderby r.Sequence
select new CommandType03Response
{
Education = p.Profile.Educations == null || p.Profile.Educations.Count == 0 ? "" :
p.Profile.Educations.OrderByDescending(x => x.StartDate).FirstOrDefault().Degree,
// Education = p.Profile.Educations == null || p.Profile.Educations.Count == 0 ? "" :
// p.Profile.Educations.OrderByDescending(x => x.StartDate).FirstOrDefault().Degree,
Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId,
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
@ -454,14 +460,17 @@ namespace BMA.EHR.Application.Repositories.Commands
OldPositionLevel = p.Profile.PositionLevel == null ? "" : p.Profile.PositionLevel.Name,
OldPositionType = p.Profile.PositionType == null ? "" : p.Profile.PositionType.Name,
OldPositionNumber = p.Profile.PosNo == null ? "" : p.Profile.PosNo.Name.ToThaiNumber(),
OldSalary = p.Profile.Salaries == null || p.Profile.Salaries.Count == 0 ? "" : p.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
// OldSalary = p.Profile.Salaries == null || p.Profile.Salaries.Count == 0 ? "" : p.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
NewOc = p.OrganizationPosition == null ? "" : _organizationCommonRepository.GetOrganizationNameFullPath(p.OrganizationPosition!.Organization!.Id, false, false, "/"),
NewPositionName = p.PositionPath == null ? "" : p.PositionPath!.Name,
NewPositionLevel = p.PositionLevel == null ? "" : p.PositionLevel.Name,
NewPositionType = p.PositionType == null ? "" : p.PositionType.Name,
NewPositionNumber = p.PositionNumber == null ? "" : p.PositionNumber.Name.ToThaiNumber(),
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.RecruitDate == null ? "" : p.RecruitDate.Value.ToThaiShortDate2().ToThaiNumber()
AppointDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
LeaveDate = p.Profile.LeaveDate == null ? "" : p.Profile.LeaveDate.Value.ToThaiShortDate2().ToThaiNumber(),
Reason = p.Reason == null ? "-" : p.Reason,
})
.ToList();
@ -500,7 +509,6 @@ namespace BMA.EHR.Application.Repositories.Commands
.ThenInclude(x => x.PosNo)
.Include(x => x.Profile)
.ThenInclude(x => x.Educations)
.Include(x => x.OrganizationPosition)
.ThenInclude(x => x.Organization)
.Include(x => x.PositionPath)
@ -511,8 +519,9 @@ namespace BMA.EHR.Application.Repositories.Commands
orderby r.Sequence
select new CommandType03Response
{
Education = p.Profile.Educations == null || p.Profile.Educations.Count == 0 ? "" :
p.Profile.Educations.OrderByDescending(x => x.StartDate).FirstOrDefault().Degree,
// Education = p.Profile.Educations == null || p.Profile.Educations.Count == 0 ? "" :
// p.Profile.Educations.OrderByDescending(x => x.StartDate).FirstOrDefault().Degree,
Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId,
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
@ -521,14 +530,18 @@ namespace BMA.EHR.Application.Repositories.Commands
OldPositionLevel = p.Profile.PositionLevel == null ? "" : p.Profile.PositionLevel.Name,
OldPositionType = p.Profile.PositionType == null ? "" : p.Profile.PositionType.Name,
OldPositionNumber = p.Profile.PosNo == null ? "" : p.Profile.PosNo.Name.ToThaiNumber(),
OldSalary = p.Profile.Salaries == null || p.Profile.Salaries.Count == 0 ? "" : p.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
// OldSalary = p.Profile.Salaries == null || p.Profile.Salaries.Count == 0 ? "" : p.Profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
OldSalary = p.AmountOld == null ? "" : p.AmountOld.Value.ToNumericNoDecimalText().ToThaiNumber(),
NewOc = p.OrganizationPosition == null ? "" : _organizationCommonRepository.GetOrganizationNameFullPath(p.OrganizationPosition!.Organization!.Id, false, false, "/"),
NewPositionName = p.PositionPath == null ? "" : p.PositionPath!.Name,
NewPositionLevel = p.PositionLevel == null ? "" : p.PositionLevel.Name,
NewPositionType = p.PositionType == null ? "" : p.PositionType.Name,
NewPositionNumber = p.PositionNumber == null ? "" : p.PositionNumber.Name.ToThaiNumber(),
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.RecruitDate == null ? "" : p.RecruitDate.Value.ToThaiShortDate2().ToThaiNumber()
AppointDate = p.PositionDate == null ? "" : p.PositionDate.Value.ToThaiShortDate2().ToThaiNumber(),
LeaveDate = p.Profile.LeaveDate == null ? "" : p.Profile.LeaveDate.Value.ToThaiShortDate2().ToThaiNumber(),
MilitaryDate = p.MilitaryDate == null ? "" : p.MilitaryDate.Value.ToThaiShortDate2().ToThaiNumber(),
Reason = p.Reason == null ? "-" : p.Reason,
})
.ToList();
@ -683,6 +696,7 @@ namespace BMA.EHR.Application.Repositories.Commands
orderby r.Sequence
select new CommandType03Response
{
Education = p.EducationOld == null ? "-" : p.EducationOld,
Seq = r.Sequence.ToString().ToThaiNumber(),
CitizenId = r.CitizenId,
FullName = $"{r.Prefix}{r.FirstName} {r.LastName}",
@ -698,7 +712,8 @@ namespace BMA.EHR.Application.Repositories.Commands
NewPositionType = p.PositionType == null ? "" : p.PositionType.Name,
NewPositionNumber = p.PositionNumber == null ? "" : p.PositionNumber.Name.ToThaiNumber(),
NewSalary = r.Amount == null ? "" : r.Amount.Value.ToNumericNoDecimalText().ToThaiNumber(),
AppointDate = p.RecruitDate == null ? "" : p.RecruitDate.Value.ToThaiShortDate2().ToThaiNumber()
AppointDate = p.RecruitDate == null ? "" : p.RecruitDate.Value.ToThaiShortDate2().ToThaiNumber(),
Reason = p.Reason == null ? "-" : p.Reason,
})
.ToList();

View file

@ -202,7 +202,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = item.Prefix!.Name,
FirstName = item.Firstname!,
LastName = item.Lastname!,
RefPlacementProfileId = item.Id
RefPlacementProfileId = item.Id,
};
seq++;
result.Add(receiver);
@ -267,7 +267,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = item.Prefix!.Name,
FirstName = item.Firstname!,
LastName = item.Lastname!,
RefPlacementProfileId = item.Id
RefPlacementProfileId = item.Id,
};
seq++;
@ -333,7 +333,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = item.Prefix!.Name,
FirstName = item.Firstname!,
LastName = item.Lastname!,
RefPlacementProfileId = item.Id
RefPlacementProfileId = item.Id,
};
seq++;
@ -398,7 +398,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = item.Prefix!.Name,
FirstName = item.Firstname!,
LastName = item.Lastname!,
RefPlacementProfileId = item.Id
RefPlacementProfileId = item.Id,
};
seq++;
@ -459,7 +459,8 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = item.Prefix!.Name,
FirstName = item.Firstname!,
LastName = item.Lastname!,
RefPlacementProfileId = item.Id
RefPlacementProfileId = item.Id,
Amount = item.AmountOld,
};
seq++;
@ -519,7 +520,8 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = item.Prefix!.Name,
FirstName = item.Firstname!,
LastName = item.Lastname!,
RefPlacementProfileId = item.Id
RefPlacementProfileId = item.Id,
Amount = item.AmountOld,
};
seq++;
@ -579,7 +581,8 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = item.Prefix!.Name,
FirstName = item.Firstname!,
LastName = item.Lastname!,
RefPlacementProfileId = item.Id
RefPlacementProfileId = item.Id,
Amount = item.AmountOld,
};
seq++;
@ -639,7 +642,8 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = item.Prefix!.Name,
FirstName = item.Firstname!,
LastName = item.Lastname!,
RefPlacementProfileId = item.Id
RefPlacementProfileId = item.Id,
Amount = item.AmountOld,
};
seq++;
@ -699,7 +703,8 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = item.Prefix!.Name,
FirstName = item.Firstname!,
LastName = item.Lastname!,
RefPlacementProfileId = item.Id
RefPlacementProfileId = item.Id,
Amount = item.AmountOld,
};
seq++;
@ -751,7 +756,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = p1.prefix!,
FirstName = p1.firstName!,
LastName = p1.lastName!,
RefPlacementProfileId = p1.profileId
RefPlacementProfileId = p1.profileId,
};
seq++;
result.Add(receiver);
@ -780,7 +785,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = p2.prefix!,
FirstName = p2.firstName!,
LastName = p2.lastName!,
RefPlacementProfileId = p2.profileId
RefPlacementProfileId = p2.profileId,
};
seq++;
result.Add(receiver);
@ -809,7 +814,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = p3.prefix!,
FirstName = p3.firstName!,
LastName = p3.lastName!,
RefPlacementProfileId = p3.profileId
RefPlacementProfileId = p3.profileId,
};
seq++;
result.Add(receiver);
@ -862,7 +867,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = pf.Prefix!.Name,
FirstName = pf.FirstName!,
LastName = pf.LastName!,
RefPlacementProfileId = pf.Id
RefPlacementProfileId = pf.Id,
};
seq++;
@ -920,7 +925,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = pf.Prefix!.Name,
FirstName = pf.FirstName!,
LastName = pf.LastName!,
RefPlacementProfileId = pf.Id
RefPlacementProfileId = pf.Id,
};
seq++;
@ -979,7 +984,8 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = item.Profile!.Prefix!.Name,
FirstName = item.Profile!.FirstName!,
LastName = item.Profile!.LastName!,
RefPlacementProfileId = item.Id
RefPlacementProfileId = item.Id,
Amount = item.AmountOld,
};
seq++;
@ -1037,7 +1043,8 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = item.Prefix!.Name,
FirstName = item.Firstname!,
LastName = item.Lastname!,
RefPlacementProfileId = item.Id
RefPlacementProfileId = item.Id,
Amount = item.AmountOld,
};
seq++;
@ -1094,7 +1101,8 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = item.Profile!.Prefix!.Name,
FirstName = item.Profile!.FirstName!,
LastName = item.Profile!.LastName!,
RefPlacementProfileId = item.Id
RefPlacementProfileId = item.Id,
Amount = item.AmountOld,
};
seq++;
@ -1151,7 +1159,8 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = item.Profile!.Prefix!.Name,
FirstName = item.Profile!.FirstName!,
LastName = item.Profile!.LastName!,
RefPlacementProfileId = item.Id
RefPlacementProfileId = item.Id,
Amount = item.AmountOld,
};
seq++;
@ -1208,7 +1217,8 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = item.Profile!.Prefix!.Name,
FirstName = item.Profile!.FirstName!,
LastName = item.Profile!.LastName!,
RefPlacementProfileId = item.Id
RefPlacementProfileId = item.Id,
Amount = item.AmountOld,
};
seq++;
@ -1265,7 +1275,8 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = item.Profile!.Prefix!.Name,
FirstName = item.Profile!.FirstName!,
LastName = item.Profile!.LastName!,
RefPlacementProfileId = item.Id
RefPlacementProfileId = item.Id,
Amount = item.AmountOld,
};
seq++;
@ -1322,7 +1333,8 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = item.Profile!.Prefix!.Name,
FirstName = item.Profile!.FirstName!,
LastName = item.Profile!.LastName!,
RefPlacementProfileId = item.Id
RefPlacementProfileId = item.Id,
Amount = item.AmountOld,
};
seq++;
@ -1379,7 +1391,8 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = item.Profile!.Prefix!.Name,
FirstName = item.Profile!.FirstName!,
LastName = item.Profile!.LastName!,
RefPlacementProfileId = item.Id
RefPlacementProfileId = item.Id,
Amount = item.AmountOld,
};
seq++;
@ -1436,7 +1449,7 @@ namespace BMA.EHR.Application.Repositories.Commands
Prefix = item.Profile!.Prefix!.Name,
FirstName = item.Profile!.FirstName!,
LastName = item.Profile!.LastName!,
RefPlacementProfileId = item.Id
RefPlacementProfileId = item.Id,
};
seq++;
@ -6644,21 +6657,18 @@ namespace BMA.EHR.Application.Repositories.Commands
double? PositionSalaryAmount = 0;
double? MonthSalaryAmount = 0;
if (profile != null && profile.Salaries.Count() > 0)
if (profile != null && profile.Salaries != null && profile.Salaries.Count() > 0)
{
SalaryAmount = cmdReceiver.Amount == null ? profile.Salaries == null ? 0 :
profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount != null ? profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value : 0 : 0;
PositionSalaryAmount = cmdReceiver.PositionSalaryAmount == null ? profile.Salaries == null ? 0 :
profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().PositionSalaryAmount != null ? profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().PositionSalaryAmount.Value : 0 : 0;
MonthSalaryAmount = cmdReceiver.MouthSalaryAmount == null ? profile.Salaries == null ? 0 :
profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().MouthSalaryAmount != null ? profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().MouthSalaryAmount.Value : 0 : 0;
SalaryAmount = profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount != null ? profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value : 0;
PositionSalaryAmount = profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().PositionSalaryAmount != null ? profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().PositionSalaryAmount.Value : 0;
MonthSalaryAmount = profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().MouthSalaryAmount != null ? profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().MouthSalaryAmount.Value : 0;
}
return new PlacementSalaryResponse
{
SalaryAmount = cmdReceiver.Amount != null ? cmdReceiver.Amount.Value : SalaryAmount ?? 0,
PositionSalaryAmount = cmdReceiver.PositionSalaryAmount != null ? cmdReceiver.PositionSalaryAmount.Value : PositionSalaryAmount ?? 0,
MonthSalaryAmount = cmdReceiver.MouthSalaryAmount != null ? cmdReceiver.MouthSalaryAmount.Value : MonthSalaryAmount ?? 0,
SalaryAmount = cmdReceiver.Amount != null && cmdReceiver.Amount != 0 ? cmdReceiver.Amount.Value : SalaryAmount ?? 0,
PositionSalaryAmount = cmdReceiver.PositionSalaryAmount != null && cmdReceiver.PositionSalaryAmount != 0 ? cmdReceiver.PositionSalaryAmount.Value : PositionSalaryAmount ?? 0,
MonthSalaryAmount = cmdReceiver.MouthSalaryAmount != null && cmdReceiver.MouthSalaryAmount != 0 ? cmdReceiver.MouthSalaryAmount.Value : MonthSalaryAmount ?? 0,
};
}
catch
@ -6685,16 +6695,16 @@ namespace BMA.EHR.Application.Repositories.Commands
Double MonthSalaryAmount = 0;
if (profile != null && profile.Salaries.Count() > 0)
{
SalaryAmount = placementProfile.Amount == null ? profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value : 0;
PositionSalaryAmount = placementProfile.PositionSalaryAmount == null ? profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().PositionSalaryAmount.Value : 0;
MonthSalaryAmount = placementProfile.MouthSalaryAmount == null ? profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().MouthSalaryAmount.Value : 0;
SalaryAmount = placementProfile.Amount == null || placementProfile.Amount == 0 ? profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().Amount.Value : 0;
PositionSalaryAmount = placementProfile.PositionSalaryAmount == null || placementProfile.PositionSalaryAmount == 0 ? profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().PositionSalaryAmount.Value : 0;
MonthSalaryAmount = placementProfile.MouthSalaryAmount == null || placementProfile.MouthSalaryAmount == 0 ? profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault().MouthSalaryAmount.Value : 0;
}
return new PlacementSalaryResponse
{
SalaryAmount = placementProfile.Amount != null ? placementProfile.Amount.Value : SalaryAmount,
PositionSalaryAmount = placementProfile.PositionSalaryAmount != null ? placementProfile.PositionSalaryAmount.Value : PositionSalaryAmount,
MonthSalaryAmount = placementProfile.MouthSalaryAmount != null ? placementProfile.MouthSalaryAmount.Value : MonthSalaryAmount,
SalaryAmount = placementProfile.Amount != null && placementProfile.Amount != 0 ? placementProfile.Amount.Value : SalaryAmount,
PositionSalaryAmount = placementProfile.PositionSalaryAmount != null && placementProfile.PositionSalaryAmount != 0 ? placementProfile.PositionSalaryAmount.Value : PositionSalaryAmount,
MonthSalaryAmount = placementProfile.MouthSalaryAmount != null && placementProfile.MouthSalaryAmount != 0 ? placementProfile.MouthSalaryAmount.Value : MonthSalaryAmount,
};
}

View file

@ -36,6 +36,9 @@ namespace BMA.EHR.Application.Responses.Reports
public string AppointDate { get; set; } = string.Empty;
public string Education { get; set;} = string.Empty;
public string Education { get; set; } = string.Empty;
public string? Reason { get; set; } = string.Empty;
public string? LeaveDate { get; set; } = string.Empty;
public string? MilitaryDate { get; set; } = string.Empty;
}
}