Exemplo n.º 1
0
 public static SearchFilter CreateNumAll(string fieldName, IEnumerable <object> values)
 {
     return(new SearchFilter
     {
         Field = new SearchField(fieldName),
         SearchType = "COND_NUM2_ALL",
         Values = values.Select(x => x == null ? SearchValue.Null : SearchValue.CreateConst(x))
     });
 }
Exemplo n.º 2
0
 public static SearchFilter CreateNum(string fieldName, string op, object value)
 {
     return(new SearchFilter
     {
         Field = new SearchField(fieldName),
         SearchType = "COND_NUM2",
         Operator = op,
         Value = value == null ? SearchValue.Null : SearchValue.CreateConst(value)
     });
 }
Exemplo n.º 3
0
 public static SearchFilter CreateText(string fieldName, string op, object value, string lang)
 {
     return(new SearchFilter
     {
         Field = new SearchField(fieldName),
         SearchType = "COND_TEXT",
         Operator = op,
         Lang = lang,
         Value = value == null ? SearchValue.Null : SearchValue.CreateConst(value)
     });
 }
Exemplo n.º 4
0
 public static SearchFilter CreateNumMinMax(string fieldName, object min, object max)
 {
     return(new SearchFilter
     {
         Field = new SearchField(fieldName),
         Operator = "BETWEEN",
         SearchType = "COND_NUM3",
         Min = min == null ? SearchValue.Null : SearchValue.CreateConst(min),
         Max = max == null ? SearchValue.Null : SearchValue.CreateConst(max)
     });
 }
Exemplo n.º 5
0
 public static SearchFilter CreateFreeword(string op, string lang, string splitmode, string area, object value)
 {
     return(new SearchFilter
     {
         SearchType = "COND_FREEWORD",
         Operator = op,
         Lang = lang,
         SplitMode = splitmode,
         Area = area,
         Value = value == null ? SearchValue.Null : SearchValue.CreateConst(value)
     });
 }
Exemplo n.º 6
0
        public static SearchValue CreateSubquery(object resourceRoute, string fieldName, object condition, string orderField = null, string orderDirection = null)
        {
            var result = new SearchValue
            {
                Type          = "SUBQUERY",
                ResourceRoute = resourceRoute,
                Select        = new SearchField {
                    Route = fieldName
                },
                Value = condition
            };

            if (orderField != null || orderDirection != null)
            {
                result.OrderBy = new[] { new SearchConditions.SearchOrdering {
                                             Direction = orderDirection, Route = orderField
                                         } };
            }
            return(result);
        }
Exemplo n.º 7
0
 public static SearchFilter CreateDateMinMax(string fieldName, string timezone, string op, SearchValue min, SearchValue max)
 {
     return(new SearchFilter
     {
         Field = new SearchField(fieldName),
         SearchType = "COND_DATE3",
         Timezone = timezone,
         Operator = op,
         Min = min,
         Max = max
     });
 }