Esempio n. 1
0
 public string TranslateGroup(FilterGroup group)
 {
     StringBuilder bulider = new StringBuilder();
     if (group == null) return " 1=1 ";
     var appended = false;
     bulider.Append(groupLeftToken);
     if (group.rules != null)
     {
         foreach (var rule in group.rules)
         {
             if (appended)
                 bulider.Append(GetOperatorQueryText(group.op));
             bulider.Append(TranslateRule(rule));
             appended = true;
         }
     }
     if (group.groups != null)
     {
         foreach (var subgroup in group.groups)
         {
             if (appended)
                 bulider.Append(GetOperatorQueryText(group.op));
             bulider.Append(TranslateGroup(subgroup));
             appended = true;
         }
     }
     bulider.Append(groupRightToken);
     if (appended == false) return " 1=1 ";
     return bulider.ToString();
 }
Esempio n. 2
0
 public FilterTranslator(FilterGroup group)
 {
     this.Group = group;
     this.Parms = new List<FilterParam>();
 }