Added the date filter while fetching data from database
This commit is contained in:
parent
b624e9ec62
commit
3fabadc380
@ -44,7 +44,7 @@ namespace Marco.Pms.Services.Controllers
|
|||||||
toDate = fromDate.AddDays(negativeDays);
|
toDate = fromDate.AddDays(negativeDays);
|
||||||
if (projectId == 0)
|
if (projectId == 0)
|
||||||
{
|
{
|
||||||
List<TaskAllocation> tasks = await _context.TaskAllocations.Where(t => t.AssignmentDate <= fromDate && t.AssignmentDate >= toDate && t.TenantId == tenantId).ToListAsync();
|
List<TaskAllocation> tasks = await _context.TaskAllocations.Where(t => t.AssignmentDate.Date <= fromDate.Date && t.AssignmentDate.Date >= toDate.Date && t.TenantId == tenantId).ToListAsync();
|
||||||
|
|
||||||
double flagDays = 0;
|
double flagDays = 0;
|
||||||
while (negativeDays < flagDays)
|
while (negativeDays < flagDays)
|
||||||
@ -85,7 +85,7 @@ namespace Marco.Pms.Services.Controllers
|
|||||||
List<WorkItem> workItems = await _context.WorkItems.Where(i => idList.Contains(i.WorkAreaId) && i.TenantId == tenantId).ToListAsync();
|
List<WorkItem> workItems = await _context.WorkItems.Where(i => idList.Contains(i.WorkAreaId) && i.TenantId == tenantId).ToListAsync();
|
||||||
idList = workItems.Select(i => i.Id).ToList();
|
idList = workItems.Select(i => i.Id).ToList();
|
||||||
|
|
||||||
List<TaskAllocation> tasks = await _context.TaskAllocations.Where(t => idList.Contains(t.WorkItemId) && t.AssignmentDate <= fromDate && t.AssignmentDate >= toDate && t.TenantId == tenantId).ToListAsync();
|
List<TaskAllocation> tasks = await _context.TaskAllocations.Where(t => idList.Contains(t.WorkItemId) && t.AssignmentDate.Date <= fromDate.Date && t.AssignmentDate.Date >= toDate.Date && t.TenantId == tenantId).ToListAsync();
|
||||||
if(project != null)
|
if(project != null)
|
||||||
{
|
{
|
||||||
double flagDays = 0;
|
double flagDays = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user