Beispiel #1
0
                public IRestriction GetRestrictionForType(Type t)
                {
                    if (IsEnabled)
                    {
                        switch (this.Type)
                        {
                        case RestrictionType.Equals:
                            return(RestrictionFactory.Eq(t, property, Value));

                            break;

                        case RestrictionType.Like:
                            string search = (!string.IsNullOrEmpty(Value))? Value.Trim('%', ' '):"";
                            search = "%" + search + "%";

                            return(RestrictionFactory.Like(t, property, search));

                            break;

                        case RestrictionType.BetweenDates:
                            return(RestrictionFactory.Btw(t, property, StartTime, EndTime));

                            break;

                        default:
                            break;
                        }
                    }
                    return(null);
                }
Beispiel #2
0
 private IRestriction fromDateRangeRestriction(DateRangeRestriction res)
 {
     return(RestrictionFactory.Btw(_configuredSearch.ObjectType, res.Property, res.StartDate, res.EndDate));
 }