Esempio n. 1
0
        public override IQueryable <Gebruiker> Filter(IQueryable <Gebruiker> query, SearchBase <Gebruiker> searchCriteria)
        {
            if (searchCriteria.GetType().Equals(typeof(GebruikerSearch)))
            {
                GebruikerSearch criteria = (GebruikerSearch)searchCriteria;

                if (!string.IsNullOrWhiteSpace(criteria.Email))
                {
                    query = query.Where(x => x.Email == criteria.Email);
                }
                if (!string.IsNullOrEmpty(criteria.Rol))
                {
                    Rol rol;
                    if (Enum.TryParse <Rol>(criteria.Rol, out rol))
                    {
                        query = query.Where(x => x.Rol == rol);
                    }
                }
                if (criteria.MinionOfId.HasValue)
                {
                    query = query.Where(x => x.VerantwoordelijkeId == criteria.MinionOfId.Value);
                }
            }

            return(base.Filter(query, searchCriteria));
        }
        public override IQueryable <ExtraInfo> Filter(IQueryable <ExtraInfo> query, SearchBase <ExtraInfo> searchCriteria)
        {
            if (searchCriteria.GetType().Equals(typeof(ExtraInfoSearch)))
            {
                ExtraInfoSearch criteria = (ExtraInfoSearch)searchCriteria;

                if (criteria.IssueStatusId.HasValue)
                {
                    query = query.Where(x => x.IssueStatusId == criteria.IssueStatusId);
                }
            }

            return(base.Filter(query, searchCriteria));
        }
Esempio n. 3
0
        public override IQueryable <Issue> Filter(IQueryable <Issue> query, SearchBase <Issue> searchCriteria)
        {
            if (searchCriteria.GetType().Equals(typeof(IssueSearch)))
            {
                IssueSearch criteria = (IssueSearch)searchCriteria;

                if (!string.IsNullOrWhiteSpace(criteria.GebruikerEmail))
                {
                    query = query.Where(x => x.Gebruiker.Email == criteria.GebruikerEmail);
                }

                if (!string.IsNullOrWhiteSpace(criteria.VerantwoordelijkeEmail))
                {
                    query = query.Where(x => x.Gebruiker.Verantwoordelijke.Email == criteria.VerantwoordelijkeEmail);
                }
                if (criteria.GebruikerId.HasValue)
                {
                    query = query.Where(x => x.GebruikerId == criteria.GebruikerId.Value);
                }
            }

            return(base.Filter(query, searchCriteria));
        }