예제 #1
0
        public List <Guid> GetDayAssignIds(ITaskDataFilterModel filter)
        {
            var query = GetQuery(filter);
            var ids   = Query.Where(query).Select(i => i.Id).ToList();

            return(ids);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        public IEnumerable <Guid> GetDayAssignIds(ITaskDataFilterModel filter)
        {
            var ids = dayAssignProvider.GetDayAssignIds(filter);

            return(ids);
        }