enhanced the get team based on project
This commit is contained in:
parent
522deae8f7
commit
000cef3bb7
@ -2823,9 +2823,14 @@ namespace Marco.Pms.Services.Service
|
|||||||
public async Task<List<ProjectAllocation>> GetTeamByProject(Guid TenantId, Guid ProjectId, Guid? OrganizationId, bool IncludeInactive)
|
public async Task<List<ProjectAllocation>> GetTeamByProject(Guid TenantId, Guid ProjectId, Guid? OrganizationId, bool IncludeInactive)
|
||||||
{
|
{
|
||||||
var projectAllocationQuery = _context.ProjectAllocations
|
var projectAllocationQuery = _context.ProjectAllocations
|
||||||
|
.Include(pa => pa.Project)
|
||||||
.Include(pa => pa.Employee)
|
.Include(pa => pa.Employee)
|
||||||
.ThenInclude(e => e!.Organization)
|
.ThenInclude(e => e!.Organization)
|
||||||
.Where(pa => pa.TenantId == TenantId && pa.ProjectId == ProjectId);
|
.Include(pa => pa.Employee)
|
||||||
|
.ThenInclude(e => e!.JobRole)
|
||||||
|
.Where(pa => pa.TenantId == TenantId &&
|
||||||
|
pa.ProjectId == ProjectId && pa.Project != null &&
|
||||||
|
pa.Employee != null && pa.Employee.Organization != null && pa.Employee.JobRole != null);
|
||||||
if (!IncludeInactive)
|
if (!IncludeInactive)
|
||||||
{
|
{
|
||||||
projectAllocationQuery = projectAllocationQuery.Where(pa => pa.IsActive);
|
projectAllocationQuery = projectAllocationQuery.Where(pa => pa.IsActive);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user