Beispiel #1
0
        protected EntityList FetchBy(ClientTimeSpanCriteria criteria)
        {
            return(this.QueryList(q =>
            {
                q.Constrain(PurchaseOrder.DateProperty).GreaterEqual(criteria.From)
                .And().Constrain(PurchaseOrder.DateProperty).LessEqual(criteria.To);

                if (criteria.ClientInfoId.HasValue)
                {
                    q.And().Constrain(PurchaseOrder.SupplierIdProperty).Equal(criteria.ClientInfoId.Value);
                }
            }));
        }
Beispiel #2
0
        public PurchaseOrderList GetBy(ClientTimeSpanCriteria criteria)
        {
            var c = new CommonQueryCriteria
            {
                new PropertyMatch(PurchaseOrder.DateProperty, PropertyOperator.GreaterEqual, criteria.From),
                new PropertyMatch(PurchaseOrder.DateProperty, PropertyOperator.LessEqual, criteria.To),
            };

            if (criteria.ClientInfoId.HasValue)
            {
                c.Add(new PropertyMatch(PurchaseOrder.SupplierIdProperty, criteria.ClientInfoId.Value));
            }

            return(this.GetBy(c));
        }