public List <Guid> GetDayAssignIds(ITaskDataFilterModel filter) { var query = GetQuery(filter); var ids = Query.Where(query).Select(i => i.Id).ToList(); return(ids); }
private Expression <Func <DayAssign, bool> > GetQueryByWeek(ITaskDataFilterModel filter) { Expression <Func <DayAssign, bool> > query = i => true; if (filter.StartWeek.HasValue) { query = query.And(f => f.WeekNumber >= filter.StartWeek); } else if (filter.BiggerThanWeek.HasValue) { query = query.And(f => f.WeekNumber > filter.BiggerThanWeek); } else if (filter.Week.HasValue) { query = query.And(f => f.WeekNumber == filter.Week); } return(query); }
public Expression <Func <DayAssign, bool> > GetQuery(ITaskDataFilterModel filter, bool isNotAllowedEmptyDepartment) { Expression <Func <DayAssign, bool> > query = GetQueryByWeek(filter); if (filter.MemberIds.HasValue()) { query = query.And(GetQuery(filter.MemberIds)); } if (filter.JobState.HasValue && filter.Year.HasValue && filter.Week.HasValue) { query = query.And(GetQuery(filter.JobState.Value)); } if (filter.Year.HasValue) { query = query.And(f => f.Year == filter.Year); } if (filter.EndDate.HasValue) { query = query.And(f => f.Date <= filter.EndDate); } if (filter.JobStatuses.HasValue()) { query = query.And(f => filter.JobStatuses.Contains(f.StatusId)); } if (isNotAllowedEmptyDepartment) { query = query.And(f => filter.HousingDepartments.Contains(f.DepartmentId)); } else if (filter.HousingDepartments.HasValue()) { query = query.And(f => filter.HousingDepartments.Contains(f.DepartmentId)); } return(query); }
public IEnumerable <Guid> GetDayAssignIds(ITaskDataFilterModel filter) { var ids = dayAssignProvider.GetDayAssignIds(filter); return(ids); }