private static string OperatorString(ConditionOperator @operator)
        {
            if (@operator == ConditionOperator.Is)
                return "=";
            if (@operator == ConditionOperator.IsNot)
                return "<>";
            if (@operator == ConditionOperator.Contains)
                return "contains";
            if (@operator == ConditionOperator.NotContains)
                return "doesn't contain";
            if (@operator == ConditionOperator.StartsWith)
                return "starts with";
            if (@operator == ConditionOperator.EndsWith)
                return "ends with";
            if (@operator == ConditionOperator.GreaterThan)
                return ">";
            if (@operator == ConditionOperator.GreaterOrEqualThan)
                return ">=";
            if (@operator == ConditionOperator.LesserThan)
                return "<";
            if (@operator == ConditionOperator.LesserOrEqualsThan)
                return "<=";

            throw new NotSupportedException();
        }
 public ConditionValidateAttribute(object[] objArray,object objValue, ConditionOperator conditionOperator, string errorMessage) :
     base(errorMessage)
 {
     this.Values = objArray;
     this.Value = objValue;
     this.ConditionOperator = conditionOperator;
 }
Esempio n. 3
0
 /// <summary>
 /// Creates condition to concrete <see cref="ElementType"/>.
 /// </summary>
 /// <param name="fieldName">name of a field which mapped with table.</param>
 /// <param name="value"></param>
 /// <param name="condOperator"></param>
 /// <param name="elementType">defines filtering Entity.</param>
 public Condition(string fieldName, object value, ConditionOperator condOperator, Type elementType)
     : base(condOperator)
 {
     _fieldName = fieldName;
     _value = value;
     _elementType = elementType;
 }
 /// <summary>
 /// Creates <see cref="FieldCondition"/> 
 /// </summary>
 /// <param name="leftFieldName">field name for the left Entity.</param>
 /// <param name="rightFieldName">field name for the right Entity</param>
 /// <param name="condOperator"></param>
 /// <param name="leftElementType">type of left Entity.</param>
 /// <param name="rightElementType">type of right Entity.</param>
 public FieldCondition(string leftFieldName, ConditionOperator condOperator, string rightFieldName, Type leftElementType, Type rightElementType)
     : base(condOperator)
 {
     _leftFieldName = leftFieldName;
     _rightFieldName = rightFieldName;
     _leftElementType = leftElementType;
     _rightElementType = rightElementType;
 }
 public ApplyConditionToSumThenAssignToResultFilter(string propertyToVisit, object value, string assignee, string assigner, ConditionOperator op, string defaultAssigner = "[]")
     : base(propertyToVisit)
 {
     Value = value;
     Assignee = assignee;
     Assigner = assigner;
     Operator = op;
     DefaultAssigner = defaultAssigner;
 }
		public CPLEditorVM(CPLTextEditorVM p_temTextEditorVM, List<CplConditionEditor> p_lstCplConditionEditors, ConditionOperator p_copAllowedOperations)
		{
			TextEditorVM = p_temTextEditorVM;
			ConditionEditors = p_lstCplConditionEditors;

			IsAndOperationAllowed = (p_copAllowedOperations & ConditionOperator.And) > 0;
			IsOrOperationAllowed = (p_copAllowedOperations & ConditionOperator.Or) > 0;

			PluginStates = Enum.GetValues(typeof(PluginState));
		}
        public ZohoSearchCondition(string label, ConditionOperator @operator, object value)
        {
            if (label == null)
                throw new ArgumentNullException("label");
            if (value == null)
                throw new ArgumentNullException("value");

            Label = label;
            Operator = @operator;
            Value = value;
        }
        /// <summary>
        /// Compares two values with a given operator.
        /// </summary>
        /// <param name="leftOperand">
        /// The left operand.
        /// </param>
        /// <param name="conditionOperator">
        /// The condition operator.
        /// </param>
        /// <param name="rightOperand">
        /// The right operand.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/> result.
        /// </returns>
        internal static bool Compare(object leftOperand, ConditionOperator conditionOperator, object rightOperand)
        {
            if (leftOperand != null && rightOperand != null && leftOperand.GetType() != rightOperand.GetType())
            {
                try
                {
                    leftOperand = Convert.ChangeType(leftOperand, rightOperand.GetType());
                }
                catch (Exception ex)
                {
                    if (ex is FormatException || ex is InvalidCastException)
                    {
                        return conditionOperator == ConditionOperator.NotEquals;
                    }

                    throw;
                }
            }

            var comparableLeft = leftOperand as IComparable;
            var comparableRight = rightOperand as IComparable;
            if (comparableLeft != null && comparableRight != null)
            {
                int result = comparableLeft.CompareTo(comparableRight);
                switch (conditionOperator)
                {
                    case ConditionOperator.Equals:
                        return result == 0;
                    case ConditionOperator.NotEquals:
                        return result != 0;
                    case ConditionOperator.GreaterThan:
                        return result > 0;
                    case ConditionOperator.LessThan:
                        return result < 0;
                    case ConditionOperator.GreaterThanOrEqual:
                        return result >= 0;
                    case ConditionOperator.LessThanOrEqual:
                        return result <= 0;
                    default:
                        throw new InvalidOperationException("Unknown operator " + conditionOperator);
                }
            }

            switch (conditionOperator)
            {
                case ConditionOperator.Equals:
                    return object.Equals(leftOperand, rightOperand);
                case ConditionOperator.NotEquals:
                    return !object.Equals(leftOperand, rightOperand);
                default:
                    throw new InvalidOperationException(
                        "Unable to compare operands - when using operands other than Equals and NotEquals you must use types that implement IComparable and values that are not null.");
            }
        }
Esempio n. 9
0
 public Condition(Condition left, ConditionOperator op, Condition right)
 {
     if (op == ConditionOperator.And
         || op == ConditionOperator.Or)
     {
         Left = left;
         Right = right;
         MulOperate = op;
     }
     else
     {
         throw new Exception("two condition just can link by and ,or oper!");
     }
 }
Esempio n. 10
0
		public void AddCondition(ConditionOperator p_oprOperator, string p_strConditionCPL)
		{
			Int32 intCaretPosition = TextEditorVM.CaretPosition;
			Int32 intPreTextLength = TextEditorVM.Code.Substring(0, intCaretPosition).Trim().Length;
			Int32 intPostTextLength = TextEditorVM.Code.Substring(intCaretPosition).Trim().Length;
			string strPreOperator = null;
			string strPostOperator = null;
			if (intPreTextLength > 0)
				strPreOperator = (p_oprOperator == ConditionOperator.And) ? " AND " : " OR ";
			if (intPostTextLength > 0)
				strPostOperator = (p_oprOperator == ConditionOperator.And) ? " AND " : " OR ";
			string strExpression = String.Format("{0}{1}{2}", strPreOperator, p_strConditionCPL, strPostOperator);
			TextEditorVM.Code = TextEditorVM.Code.Insert(intCaretPosition, strExpression);
			TextEditorVM.ValidateCPL();
		}
        private void AssertResult(
            string location,
            string tagsKey,
            bool isEnabled,
            bool actionsNull,
            int actionsCount,
            double threshold,
            ConditionOperator conditionOperator,
            double totalMinutes,
            TimeAggregationOperator timeAggregationOperator,
            string metricName,
            string resourceUri)
        {
            Assert.Equal(Utilities.ResourceGroup, this.resourceGroup);
            Assert.Equal(location, this.alertRuleResource.Location);
            Assert.True(this.alertRuleResource.Tags.ContainsKey(tagsKey));

            Assert.NotNull(this.alertRuleResource);

            if (actionsNull)
            {
                Assert.Null(this.alertRuleResource.Actions);
            }
            else
            {
                Assert.NotNull(this.alertRuleResource.Actions);
                Assert.Equal(actionsCount, this.alertRuleResource.Actions.Count);
            }

            Assert.Equal(Utilities.Name, this.alertRuleResource.AlertRuleResourceName);
            Assert.Equal(isEnabled, this.alertRuleResource.IsEnabled);

            Assert.True(this.alertRuleResource.Condition is ThresholdRuleCondition);

            var condition = this.alertRuleResource.Condition as ThresholdRuleCondition;

            Assert.Equal(threshold, condition.Threshold);
            Assert.Equal(conditionOperator, condition.OperatorProperty);
            Assert.Equal(totalMinutes, ((TimeSpan)condition.WindowSize).TotalMinutes);
            Assert.Equal(timeAggregationOperator, condition.TimeAggregation);

            Assert.True(condition.DataSource is Management.Monitor.Models.RuleMetricDataSource);

            var dataSource = condition.DataSource as Management.Monitor.Models.RuleMetricDataSource;

            Assert.Equal(metricName, dataSource.MetricName);
            Assert.Equal(resourceUri, dataSource.ResourceUri);
        }
            public ConditionParser(String condition, FullTextSearchOptions options)
            {
                ConditionStream stream = new ConditionStream(condition, options);

                this.options = options;

                rootExpression    = new ConditionExpression(options);
                currentExpression = rootExpression;

                Reset();

                while (stream.Read())
                {
                    if (ConditionOperator.IsSymbol(stream.Current))
                    {
                        PutToken();
                        SetToken(stream.Current);
                        PutToken();
                        continue;
                    }
                    switch (stream.Current)
                    {
                    case ' ': PutToken(); continue;

                    case '(': PushExpression(); continue;

                    case ')': PopExpression(); continue;

                    case '"':
                        PutToken();
                        inQuotes = true;
                        SetToken(stream.ReadQuote());
                        PutToken();
                        inQuotes = false;
                        continue;
                    }
                    AddToken(stream.Current);
                }
                PutToken();

                if (!object.ReferenceEquals(rootExpression, currentExpression))
                {
                    if ((options & FullTextSearchOptions.ThrowOnUnbalancedParens) != 0)
                    {
                        throw new InvalidOperationException("Unbalanced parentheses.");
                    }
                }
            }
Esempio n. 13
0
 /// <summary>
 /// Condition Expression constructor.
 /// </summary>
 /// <param name="attributeName"></param>
 /// <param name="values"></param>
 /// <remarks>Need to handler collections differently. esp. Guid arrays.</remarks>
 public ConditionExpression(
     string attributeName,
     ConditionOperator conditionOperator,
     ICollection values)
 {
     AttributeName = attributeName;
     Operator      = conditionOperator;
     if (values != null)
     {
         _values = new DataCollection <object>();
         foreach (object obj in values)
         {
             _values.Add(obj);
         }
     }
 }
        public MetadataAssociationEndConstraint(string propertyName, string value, ConditionOperator @operator = ConditionOperator.Equal)
        {
            if (string.IsNullOrWhiteSpace(propertyName))
            {
                throw new ArgumentNullException("propertyName");
            }

            if (string.IsNullOrWhiteSpace(value))
            {
                throw new ArgumentNullException("value");
            }

            _propertyName = propertyName.Trim();
            _value        = value.Trim();
            _operator     = @operator;
        }
Esempio n. 15
0
        bool CheckOperator(ConditionOperator parOperator, float parValue1, float parValue2)
        {
            if (parOperator == ConditionOperator.Equal)
            {
                if (parValue1 == parValue2)
                {
                    return(true);
                }
            }
            else if (parOperator == ConditionOperator.Diff)
            {
                if (parValue1 != parValue2)
                {
                    return(true);
                }
            }
            else if (parOperator == ConditionOperator.Sup)
            {
                if (parValue1 > parValue2)
                {
                    return(true);
                }
            }
            else if (parOperator == ConditionOperator.SupOrEqual)
            {
                if (parValue1 >= parValue2)
                {
                    return(true);
                }
            }
            else if (parOperator == ConditionOperator.Under)
            {
                if (parValue1 < parValue2)
                {
                    return(true);
                }
            }
            else if (parOperator == ConditionOperator.UnderOrEqual)
            {
                if (parValue1 <= parValue2)
                {
                    return(true);
                }
            }

            return(false);
        }
        /// <summary>
        /// Reads the condition from the given node.
        /// </summary>
        /// <param name="p_xelCondition">The node from which to load the condition.</param>
        /// <returns>An <see cref="ICondition"/> representing the condition described in the given node.</returns>
        protected override ICondition LoadCondition(XElement p_xelCondition)
        {
            if (p_xelCondition == null)
            {
                return(null);
            }
            switch (p_xelCondition.GetSchemaInfo().SchemaType.Name)
            {
            case "compositeDependency":
                ConditionOperator      copOperator   = (ConditionOperator)Enum.Parse(typeof(ConditionOperator), p_xelCondition.Attribute("operator").Value);
                CompositeCondition     cpdCondition  = new CompositeCondition(copOperator);
                IEnumerable <XElement> xeeConditions = p_xelCondition.Elements();
                foreach (XElement xelCondition in xeeConditions)
                {
                    cpdCondition.Conditions.Add(LoadCondition(xelCondition));
                }
                return(cpdCondition);

            case "fileDependency":
                string      strCondition = p_xelCondition.Attribute("file").Value.ToLower();
                PluginState plsModState  = (PluginState)Enum.Parse(typeof(PluginState), p_xelCondition.Attribute("state").Value);
                return(new PluginCondition(strCondition, plsModState));

            case "flagDependency":
                string strFlagName = p_xelCondition.Attribute("flag").Value;
                string strValue    = p_xelCondition.Attribute("value").Value;
                return(new FlagCondition(strFlagName, strValue));

            case "versionDependency":
                switch (p_xelCondition.Name.LocalName)
                {
                case "falloutDependency":
                    Version verMinFalloutVersion = ParseVersion(p_xelCondition.Attribute("version").Value);
                    return(new GameVersionCondition(verMinFalloutVersion));

                case "fommDependency":
                    Version verMinFommVersion = ParseVersion(p_xelCondition.Attribute("version").Value);
                    return(new ModManagerCondition(verMinFommVersion));

                default:
                    throw new ParserException("Invalid plugin condition node: " + p_xelCondition.Name + ". At this point the config file has been validated against the schema, so there's something wrong with the parser.");
                }

            default:
                throw new ParserException("Invalid plugin condition node: " + p_xelCondition.Name + ". At this point the config file has been validated against the schema, so there's something wrong with the parser.");
            }
        }
        public static string GetKeyword(this ConditionOperator @operator)
        {
            switch (@operator)
            {
            case ConditionOperator.And:
                return("È");

            case ConditionOperator.Or:
                return("ÈËÈ");

            case ConditionOperator.Not:
                return("ÍÅ");

            default:
                throw new ArgumentOutOfRangeException(@operator.ToString(), @operator, null);
            }
        }
Esempio n. 18
0
		public static FilterExpression WhereExpression( string in_field, ConditionOperator in_operator, object[] in_values ) {
			FilterExpression filterExpression = new FilterExpression();
			filterExpression.FilterOperator = LogicalOperator.And;

			ConditionExpression ce = new ConditionExpression();
			ce.AttributeName = in_field;
			ce.Operator = in_operator;
#if CRM4
			ce.Values = in_values;
#else
            foreach (object item in in_values) {
                ce.Values.Add(item);
            }
#endif
			filterExpression.Conditions.Add( ce );
			return filterExpression;
		}
Esempio n. 19
0
 /// <summary>Initializes a new instance of the <see cref="T:Microsoft.Xrm.Sdk.Query.ConditionExpression"></see> class setting the attribute name, condition operator and a collection of values.</summary>
 /// <param name="conditionOperator">Type: <see cref="T:Microsoft.Xrm.Sdk.Query.ConditionOperator"></see>. The condition operator.</param>
 /// <param name="attributeName">Type: Returns_String. The logical name of the attribute in the condition expression.</param>
 /// <param name="values">Type: Returns_ICollection. The collection of attribute values.</param>
 public ConditionExpression(
     string attributeName,
     ConditionOperator conditionOperator,
     ICollection values)
 {
     this._attributeName     = attributeName;
     this._conditionOperator = conditionOperator;
     if (values == null)
     {
         return;
     }
     this._values = new DataCollection <object>();
     foreach (object obj in (IEnumerable)values)
     {
         this._values.Add(obj);
     }
 }
Esempio n. 20
0
        public QueryClause <TPrimaryEntity> OrWhere <TValue>(Expression <Func <TPrimaryEntity, TValue> > propertyName,
                                                             ConditionOperator condition,
                                                             TValue value)
        {
            propertyName.GuardAgainstNull(nameof(propertyName));
            if (!this.entities.Wheres.Any())
            {
                throw new InvalidOperationException(
                          "You cannot use an 'OrWhere' before a 'Where', or after a 'WhereAll'");
            }

            var fieldName = Reflector <TPrimaryEntity> .GetPropertyName(propertyName);

            this.entities.AddWhere(LogicalOperator.Or, fieldName, condition, value);

            return(new QueryClause <TPrimaryEntity>(this.entities));
        }
Esempio n. 21
0
        ///<summary>Returns a comparison clause that is capable of using the index on colName.</summary>
        public static string DateTConditionColumn(string colName, ConditionOperator compareType, DateTime dateTime)
        {
            //Oracle compatible.
            DateTime endDate = dateTime;          //dateTime can be DateTime.Max. In those cases we do not want to add any additional time.

            switch (compareType)
            {
            case ConditionOperator.Equals:
                if (dateTime != DateTime.MaxValue)
                {
                    endDate = endDate.Date.AddDays(1).AddSeconds(-1);
                }
                return(colName + " BETWEEN " + POut.DateT(dateTime.Date) + " AND " + POut.DateT(endDate));

            case ConditionOperator.NotEquals:
                if (dateTime != DateTime.MaxValue)
                {
                    endDate = endDate.Date.AddDays(1).AddSeconds(-1);
                }
                return(colName + " NOT BETWEEN " + POut.DateT(dateTime.Date) + " AND " + POut.DateT(endDate));

            case ConditionOperator.GreaterThan:
                if (dateTime != DateTime.MaxValue)
                {
                    endDate = endDate.Date.AddDays(1);
                }
                return(colName + ">=" + POut.DateT(endDate));

            case ConditionOperator.LessThan:
                return(colName + " < " + POut.DateT(dateTime.Date));

            case ConditionOperator.GreaterThanOrEqual:
                return(colName + ">=" + POut.DateT(dateTime.Date));

            case ConditionOperator.LessThanOrEqual:
                if (dateTime != DateTime.MaxValue)
                {
                    endDate = endDate.Date.AddDays(1).AddSeconds(-1);
                }
                return(colName + "<=" + POut.DateT(endDate));

            default:
                throw new NotImplementedException(compareType + " not implemented yet.");
            }
        }
        private static string OperatorString(ConditionOperator @operator)
        {
            if (@operator == ConditionOperator.Is)
            {
                return("=");
            }
            if (@operator == ConditionOperator.IsNot)
            {
                return("<>");
            }
            if (@operator == ConditionOperator.Contains)
            {
                return("contains");
            }
            if (@operator == ConditionOperator.NotContains)
            {
                return("doesn't contain");
            }
            if (@operator == ConditionOperator.StartsWith)
            {
                return("starts with");
            }
            if (@operator == ConditionOperator.EndsWith)
            {
                return("ends with");
            }
            if (@operator == ConditionOperator.GreaterThan)
            {
                return(">");
            }
            if (@operator == ConditionOperator.GreaterOrEqualThan)
            {
                return(">=");
            }
            if (@operator == ConditionOperator.LesserThan)
            {
                return("<");
            }
            if (@operator == ConditionOperator.LesserOrEqualsThan)
            {
                return("<=");
            }

            throw new NotSupportedException();
        }
		public ConditionalConverterContext(IConditional conditional, string[] names, Type type, object value, ConditionOperator? @operator = null, object defaultValue = null)
		{
			if(conditional == null)
				throw new ArgumentNullException("conditional");

			if(names == null || names.Length < 1)
				throw new ArgumentNullException("names");

			if(type == null)
				throw new ArgumentNullException("type");

			_conditional = conditional;
			_names = names;
			_type = type;
			_value = value;
			_operator = @operator;
			_defaultValue = defaultValue;
		}
Esempio n. 24
0
        internal static string ToSerializedValue(this ConditionOperator value)
        {
            switch (value)
            {
            case ConditionOperator.GreaterThan:
                return("GreaterThan");

            case ConditionOperator.GreaterThanOrEqual:
                return("GreaterThanOrEqual");

            case ConditionOperator.LessThan:
                return("LessThan");

            case ConditionOperator.LessThanOrEqual:
                return("LessThanOrEqual");
            }
            return(null);
        }
 private static Expression MakeComparisonExpression(
     Expression leftExpression,
     Expression rightExpression,
     ConditionOperator conditionOperator)
 {
     Expression body = null;
     switch (conditionOperator)
     {
         case ConditionOperator.EqualTo:
             body = Expression.Equal(leftExpression, rightExpression);
             break;
         case ConditionOperator.NotEqualTo:
             body = Expression.NotEqual(leftExpression, rightExpression);
             break;
         case ConditionOperator.GreaterThanOrEqualTo:
             body = Expression.GreaterThanOrEqual(leftExpression, rightExpression);
             break;
         case ConditionOperator.GreaterThan:
             body = Expression.GreaterThan(leftExpression, rightExpression);
             break;
         case ConditionOperator.LessThanOrEqualTo:
             body = Expression.LessThanOrEqual(leftExpression, rightExpression);
             break;
         case ConditionOperator.LessThan:
             body = Expression.LessThan(leftExpression, rightExpression);
             break;
         case ConditionOperator.StartsWith:
             body = Expression.Call(leftExpression,
                                    ExpressionHelper.StringType.GetMethod(MethodName.StartsWith, new[] { ExpressionHelper.StringType }),
                                    rightExpression);
             break;
         case ConditionOperator.Like:
             body = Expression.Call(leftExpression,
                                    ExpressionHelper.StringType.GetMethod(MethodName.Contains, new[] { ExpressionHelper.StringType }),
                                    rightExpression);
             break;
         case ConditionOperator.EndsWith:
             body = Expression.Call(leftExpression,
                                    ExpressionHelper.StringType.GetMethod(MethodName.EndsWith, new[] { ExpressionHelper.StringType }),
                                    rightExpression);
             break;
     }
     return body;
 }
        internal static ThresholdRuleCondition DeserializeThresholdRuleCondition(JsonElement element)
        {
            ConditionOperator   @operator  = default;
            double              threshold  = default;
            Optional <TimeSpan> windowSize = default;
            Optional <TimeAggregationOperator> timeAggregation = default;
            string odataType = default;
            Optional <RuleDataSource> dataSource = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("operator"))
                {
                    @operator = property.Value.GetString().ToConditionOperator();
                    continue;
                }
                if (property.NameEquals("threshold"))
                {
                    threshold = property.Value.GetDouble();
                    continue;
                }
                if (property.NameEquals("windowSize"))
                {
                    windowSize = property.Value.GetTimeSpan("P");
                    continue;
                }
                if (property.NameEquals("timeAggregation"))
                {
                    timeAggregation = property.Value.GetString().ToTimeAggregationOperator();
                    continue;
                }
                if (property.NameEquals("odata.type"))
                {
                    odataType = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("dataSource"))
                {
                    dataSource = RuleDataSource.DeserializeRuleDataSource(property.Value);
                    continue;
                }
            }
            return(new ThresholdRuleCondition(odataType, dataSource.Value, @operator, threshold, Optional.ToNullable(windowSize), Optional.ToNullable(timeAggregation)));
        }
        private static string ValueString(ConditionOperator @operator, object value)
        {
            string stringValue;
            if (value is string) {
                stringValue = (string) value;
            } else {
                stringValue = Convert.ToString(value);
            }

            if (@operator == ConditionOperator.Contains ||
                @operator == ConditionOperator.NotContains)
                return String.Format("*{0}*", stringValue);
            if (@operator == ConditionOperator.StartsWith)
                return String.Format("{0}*", stringValue);
            if (@operator == ConditionOperator.EndsWith)
                return String.Format("*{0}", stringValue);

            return stringValue;
        }
Esempio n. 28
0
        public ICondition GetCondition()
        {
            if (IsValid())
            {
                ConditionOperator condition = new ConditionOperator()
                {
                    Type = (ConditionOperatorType)cbType.SelectedItem
                };

                foreach (IConditionControl control in pnlCondition.Children)
                {
                    condition.Conditions.Add(control.GetCondition());
                }

                return(condition);
            }

            return(null);
        }
Esempio n. 29
0
 public bool Compare(UnityEngine.Object other, ConditionOperator operation)
 {
     switch (operation)
     {
     case ConditionOperator.Equals:
         IntReference otherAsRef = other as IntReference;
         if (otherAsRef != null)
         {
             return(this == otherAsRef);
         }
         IntVariable otherAsVar = other as IntVariable;
         if (otherAsVar != null)
         {
             return(Variable == otherAsVar);
         }
         break;
     }
     return(false);
 }
            public ConditionExpression AddSubexpression(ConditionOperator op)
            {
                ConditionOperator newOp = op;

                if (op == ConditionOperator.Near)
                {
                    if ((options & FullTextSearchOptions.ThrowOnInvalidNearUse) != 0)
                    {
                        throw new InvalidOperationException("Invalid near operator before subexpression.");
                    }
                    newOp = ConditionOperator.And;
                }

                ConditionExpression exp = new ConditionExpression(this, newOp);

                subexpressions.Add(exp);

                return(exp);
            }
Esempio n. 31
0
        private void LoadConditionTemplate(int ConditionID, int ConditionCodeVal, int ConditionTemplateType)
        {
            ConditionTemplateSectionPlaceHolder.Visible = ConditionTemplateAdditionalSectionPlaceHolder.Visible = ConditionTemplateAdvancedTimePeriodPlaceHolder.Visible = false;

            ConditionTemplateMainPlaceHolder.Visible = true;

            MovieSessionsPlaceHolder.Visible = false;

            if (ConditionTemplateType != 1)
            {
                ConditionTemplateSectionPlaceHolder.Visible = true;

                var conditionOperators = new ConditionOperator().ListConditionOperators(ConditionID);

                ManageConditionOperatorsAndValues(0, OperatorComboBox, ValueListHidden, conditionOperators, ConditionCodeVal);

                if (ConditionTemplateType == 3 || ConditionTemplateType == 5)
                {
                    ConditionTemplateAdditionalSectionPlaceHolder.Visible = true;

                    ManageConditionOperatorsAndValues(1, AdditionalOperatorComboBox, AdditionalValueListHidden, conditionOperators, ConditionCodeVal);
                }

                if (ConditionTemplateType == 4 || ConditionTemplateType == 5)
                {
                    ConditionTemplateAdvancedTimePeriodPlaceHolder.Visible = true;

                    AdvancedCalculationMethodComboBox.DataSource = new Dictionary().ListDictionaries(1, 22);
                    AdvancedTimePeriodTypeComboBox.DataSource    = new Dictionary().ListDictionaries(1, 23);

                    AdvancedCalculationMethodComboBox.DataBind();
                    AdvancedTimePeriodTypeComboBox.DataBind();

                    AdvancedCalculationMethodComboBox.SelectedIndex = 0;
                    AdvancedTimePeriodTypeComboBox.SelectedIndex    = 0;
                }

                if (ConditionTemplateType == 6)
                {
                    MovieSessionsPlaceHolder.Visible = true;
                }
            }
        }
Esempio n. 32
0
 private static bool IsCriteriaMatched(ref string stringValue, ref string entryText, ConditionOperator filterOperator)
 {
     if (IsNumber(ref stringValue))
     {
         double entryDouble;
         if (Double.TryParse(entryText, out entryDouble))
         {
             double doubleValue = Double.Parse(stringValue);
             switch (filterOperator)
             {
                 case ConditionOperator.Equals:
                     return doubleValue == entryDouble;
                 case ConditionOperator.GreaterThan:
                     return doubleValue > entryDouble;
                 case ConditionOperator.GreaterThanOrEqualsTo:
                     return doubleValue >= entryDouble;
                 case ConditionOperator.LessThan:
                     return doubleValue < entryDouble;
                 case ConditionOperator.LessThanOrEqualsTo:
                     return doubleValue <= entryDouble;
                 case ConditionOperator.NotEquals:
                     return doubleValue != entryDouble;
             }
         }
     }
     else
     {
         switch (filterOperator)
         {
             case ConditionOperator.Equals:
                 return stringValue.Equals(entryText, StringComparison.Ordinal);
             case ConditionOperator.StartsWith:
                 return stringValue.StartsWith(entryText, StringComparison.Ordinal);
             case ConditionOperator.Contains:
             case ConditionOperator.In:
                 return stringValue.Contains(entryText);
             case ConditionOperator.EndsWith:
                 return stringValue.EndsWith(entryText, StringComparison.Ordinal);
         }
     }
     return false;
 }
 public ConditionExpression(string attributeName, ConditionOperator conditionOperator, object value = null)
     : this()
 {
     this.AttributeName = attributeName;
     this.Operator      = conditionOperator;
     if (value != null)
     {
         if (value.GetType().IsArray)
         {
             foreach (var item in (Array)value)
             {
                 Values.Add(item);
             }
         }
         else
         {
             this.Values.Add(value);
         }
     }
 }
Esempio n. 34
0
        /// <summary>
        /// Returns a readable string representing the specified condition operator.
        /// </summary>
        /// <param name="op">The condition operator.</param>
        /// <returns>A readable string that represents the specified condition operator.</returns>
        public static string GetReadableConditionOperator(ConditionOperator op)
        {
            switch (op)
            {
            case ConditionOperator.LessThan:
                return("<");

            case ConditionOperator.LessThanOrEqualTo:
                return("<=");

            case ConditionOperator.EqualTo:
                return("==");

            case ConditionOperator.GreaterThanOrEqualTo:
                return(">=");

            default:
                return(">");
            }
        }
Esempio n. 35
0
        public static RecordTable Select(this RecordTable table, string entryText, ConditionOperator filterOperator, Predicate<SchemaInfo> columnMatch)
        {
            if (null != table && !String.IsNullOrWhiteSpace(entryText))
            {
                entryText = entryText.Trim().ToUpper();

                IList<SchemaInfo> filteredColumns = RecordTableExtensions.GetFilterColumns(table, columnMatch);
                if (0 == filteredColumns.Count)//means there is no valid columns.
                {
                    return null;
                }

                IList<Record> rows = table;
                Record row;
                object cellValue; string stringValue;
                int k;
                List<Record> filteredRows = new List<Record>();
                for (int j = 0; j < rows.Count; ++j)
                {
                    row = rows[j];
                    for (k = 0; k < filteredColumns.Count; ++k)
                    {
                        cellValue = row[filteredColumns[k].ColumnName];
                        if (null != cellValue)
                        {
                            stringValue = cellValue.ToString().ToUpper();
                            if (0 != stringValue.Length && IsCriteriaMatched(ref stringValue, ref entryText, filterOperator))
                            {
                                filteredRows.Add(row);
                                break;
                            }
                        }
                    }
                }
                if (filteredRows.Count > 0)
                {
                    return RecordTableExtensions.Clone(table, filteredRows);
                }
            }
            return null;
        }
Esempio n. 36
0
        public void AddCondition(ConditionOperator p_oprOperator, string p_strConditionCPL)
        {
            Int32  intCaretPosition  = TextEditorVM.CaretPosition;
            Int32  intPreTextLength  = TextEditorVM.Code.Substring(0, intCaretPosition).Trim().Length;
            Int32  intPostTextLength = TextEditorVM.Code.Substring(intCaretPosition).Trim().Length;
            string strPreOperator    = null;
            string strPostOperator   = null;

            if (intPreTextLength > 0)
            {
                strPreOperator = (p_oprOperator == ConditionOperator.And) ? " AND " : " OR ";
            }
            if (intPostTextLength > 0)
            {
                strPostOperator = (p_oprOperator == ConditionOperator.And) ? " AND " : " OR ";
            }
            string strExpression = String.Format("{0}{1}{2}", strPreOperator, p_strConditionCPL, strPostOperator);

            TextEditorVM.Code = TextEditorVM.Code.Insert(intCaretPosition, strExpression);
            TextEditorVM.ValidateCPL();
        }
Esempio n. 37
0
    private void SetValueBoxes(ReportDataType dataType, ConditionOperator op)
    {
        textValue.Visible  = false;
        dateValue1.Visible = false;
        dateValue2.Visible = false;
        numValue1.Visible  = false;
        numValue2.Visible  = false;
        cmbBool.Visible    = false;
        lblAnd.Visible     = false;

        switch (dataType)
        {
        case ReportDataType.String:
            textValue.Visible = true;
            break;

        case ReportDataType.Int:
            numValue1.Visible = true;
            numValue2.Visible = op == ConditionOperator.IsNotInBetween || op == ConditionOperator.IsInBetween;
            break;

        case ReportDataType.Float:
            numValue1.Visible = true;
            numValue2.Visible = op == ConditionOperator.IsNotInBetween || op == ConditionOperator.IsInBetween;
            break;

        case ReportDataType.DateTime:
            dateValue1.Visible = true;
            dateValue2.Visible = op == ConditionOperator.IsNotInBetween || op == ConditionOperator.IsInBetween;
            break;

        case ReportDataType.Boolean:
            cmbBool.Visible = true;
            break;

        default:
            break;
        }
        lblAnd.Visible = op == ConditionOperator.IsNotInBetween || op == ConditionOperator.IsInBetween;
    }
Esempio n. 38
0
		public CrmQuery Or( string in_field, ConditionOperator in_operator, object[] in_values ) {
			if( m_currentExpression != null ) {

				// TODO this logic is repeated in WhereExpression()
				ConditionExpression ce = new ConditionExpression();
				ce.AttributeName = in_field;
				ce.Operator = in_operator;
#if CRM4
				ce.Values = in_values;
#else
				foreach( object item in in_values ) {
					ce.Values.Add( item );
				}
#endif			
				m_currentExpression.AddCondition( ce );
				m_currentExpression.FilterOperator = LogicalOperator.Or;
			}
			else {
				throw new InvalidStateException( "Unable to add 'Or' condition: current filter expression is null" );
			}
			return this;
		}
 private void SetConditionExpressionValue(ConditionExpression condition, ConditionOperator conditionOperator, params object[] values)
 {
     condition.Operator = conditionOperator;
     if (values != null)
     {
         // is the literal a
         foreach (var value in values)
         {
             if (value is Array)
             {
                 foreach (var o in value as Array)
                 {
                     condition.Values.Add(o);
                 }
             }
             else
             {
                 condition.Values.Add(value);
             }
         }
     }
 }
Esempio n. 40
0
        private void addConditions <T>(ConditionOperator conditionOperator, T[] values)
        {
            if (values is null)
            {
                return;
            }

            if (values.Length == 1)
            {
                addConditionToFilter(conditionOperator, values[0], Parent);
                return;
            }

            var impliedOrFilter = new Filter <P>((IFilter <P>)Parent, LogicalOperator.Or);

            foreach (var v in values)
            {
                addConditionToFilter(conditionOperator, v, impliedOrFilter);
            }

            (Parent as IFilter).Filters.Add(impliedOrFilter.ToFilterExpression());
        }
            private ConditionExpression(ConditionExpression parent, ConditionOperator op, string term)
                : this(parent, op)
            {
                this.term = term;

                isTerm = true;

                isPhrase = (term.IndexOf(' ') != -1);
                int prefixIndex = term.IndexOf('*');

                isPrefix = (prefixIndex != -1);

                if (!isPrefix)
                {
                    return;
                }

                if (!isPhrase)
                {
                    if ((options & FullTextSearchOptions.TrimPrefixTerms) == 0)
                    {
                        return;
                    }
                    if (prefixIndex == (term.Length - 1))
                    {
                        return;
                    }
                    this.term = (prefixIndex == 0) ? "" : term.Remove(prefixIndex + 1);
                    return;
                }

                if ((options & FullTextSearchOptions.TrimPrefixPhrases) == 0)
                {
                    return;
                }
                term      = Regex.Replace(term, @"(\*[^ ]+)|(\*)", "");
                term      = Regex.Replace(term.Trim(), @"[ ]{2,}", " ");
                this.term = term + "*";
            }
        public static string OperatorToString(ConditionOperator conditionOperator)
        {
            switch (conditionOperator)
            {
            case ConditionOperator.Diff: return(" <> ");

            case ConditionOperator.Equal: return(" = ");

            case ConditionOperator.Gt: return(" > ");

            case ConditionOperator.Gte: return(" >= ");

            case ConditionOperator.Lt: return(" < ");

            case ConditionOperator.Lte: return(" <= ");

            case ConditionOperator.Isnull: return(" Is Null ");

            case ConditionOperator.NotNull: return(" Is Not Null");
            }
            return("");
        }
Esempio n. 43
0
        private void AddToFilter <T>(ConditionOperator conditionOperator, T[] values)
        {
            if (!applyIfTrue)
            {
                return;
            }

            if (conditionOperator == ConditionOperator.In)
            {
                this.Operator = conditionOperator;
                this.Value    = values;
                Parent.Conditions.Add(this);
                return;
            }

            if (values.Length <= 1)
            {
                this.Operator = conditionOperator;
                if (values.Length == 1)
                {
                    this.Value = values[0];
                }

                Parent.Conditions.Add(this);
                return;
            }

            //All other situation where more than one value are specified imply child Or filter
            var filterExpression = new Filter <P>(Parent, LogicalOperator.Or);

            foreach (var v in values)
            {
                var condition = new Condition <P>(filterExpression, AttributeName);
                condition.Is <object>(conditionOperator, v);
            }

            Parent.Filters.Add(filterExpression);
        }
            public string ReadQuote()
            {
                StringBuilder sb = new StringBuilder();

                while (Read())
                {
                    if (Current.Equals('"'))
                    {
                        if ((index + 1) == condition.Length)
                        {
                            index = condition.Length;
                            return(sb.ToString());
                        }
                        char peek = condition[index + 1];
                        if ((peek == ' ') || (peek == ')') || (peek == '(') || (ConditionOperator.IsSymbol(peek)))
                        {
                            return(sb.ToString());
                        }
                        if (peek == '"')
                        {
                            index += 1;
                        }
                        else
                        {
                            if ((options & FullTextSearchOptions.ThrowOnUnbalancedQuotes) != 0)
                            {
                                return(sb.ToString());
                            }
                        }
                    }
                    sb.Append(Current);
                }
                if ((options & FullTextSearchOptions.ThrowOnUnbalancedQuotes) != 0)
                {
                    throw new InvalidOperationException("Unbalanced quotes.");
                }
                return(sb.ToString());
            }
Esempio n. 45
0
            public static bool TryParse(string s, ref ConditionOperator op)
            {
                if (s.Length == 1)
                {
                    switch (s[0])
                    {
                    case And1Symbol:
                        op = ConditionOperator.And; return(true);

                    case AndNot1Symbol:
                        op = ConditionOperator.AndNot; return(true);
                    }
                    return(false);
                }

                if (s.Equals(ConditionOperator.And.ToString(), StringComparison.OrdinalIgnoreCase))
                {
                    op = ConditionOperator.And;
                    return(true);
                }
                if (s.Equals("not", StringComparison.OrdinalIgnoreCase) && (op == ConditionOperator.And))
                {
                    op = ConditionOperator.AndNot;
                    return(true);
                }
                if (s.Equals(ConditionOperator.Or.ToString(), StringComparison.OrdinalIgnoreCase))
                {
                    op = ConditionOperator.Or;
                    return(true);
                }
                if (s.Equals(ConditionOperator.Near.ToString(), StringComparison.OrdinalIgnoreCase))
                {
                    op = ConditionOperator.Near;
                    return(true);
                }

                return(false);
            }
Esempio n. 46
0
        public static ExpressionMetadata GetBasicExprDef(int num, ConditionOperator op, string key)
        {
            var expressionList = new List<AbstractExpression>
            {
                new BasicExpression{Key = key,Value = num,Operator = op}
            };

            ExpressionMetadata expressionMetadata = new ExpressionMetadata
            {
                Items = new List<ExpressionGroup>
                {
                    new ExpressionGroup
                    {
                        Criteria = expressionList,

                        Operator = OperationOperator.And
                    }
                },

                Operator = OperationOperator.And
            };

            return expressionMetadata;
        }
        public PropertyCondition( Mobile from, Type type, PropertyInfo[] props, string prop, string oper, string arg, bool logicalNot )
        {
            /*m_From = from;*/
            m_LogicalNot = logicalNot;

            string failReason = "";
            m_PropertyInfoChain = Properties.GetPropertyInfoChain( from, type, prop, PropertyAccess.Read, ref failReason );

            if ( m_PropertyInfoChain == null )
                throw new Exception( failReason );

            string error = Properties.ConstructFromString( m_PropertyInfoChain[m_PropertyInfoChain.Length - 1].PropertyType, null, arg, ref m_Argument );

            if ( error != null )
                throw new Exception( error );

            switch ( oper )
            {
                case "=":
                case "==":
                case "is": m_Operator = ConditionOperator.Equality; break;

                case "!=": m_Operator = ConditionOperator.Inequality; break;

                case ">": m_Operator = ConditionOperator.Greater; break;
                case "<": m_Operator = ConditionOperator.Lesser; break;

                case ">=": m_Operator = ConditionOperator.GreaterEqual; break;
                case "<=": m_Operator = ConditionOperator.LesserEqual; break;

                case "==~":
                case "~==":
                case "=~":
                case "~=":
                case "is~":
                case "~is": m_Operator = ConditionOperator.EqualityInsensitive; break;

                case "!=~":
                case "~!=": m_Operator = ConditionOperator.InequalityInsensitive; break;

                case "starts": m_Operator = ConditionOperator.StartsWith; break;

                case "starts~":
                case "~starts": m_Operator = ConditionOperator.StartsWithInsensitive; break;

                case "ends": m_Operator = ConditionOperator.EndsWith; break;

                case "ends~":
                case "~ends": m_Operator = ConditionOperator.EndsWithInsensitive; break;

                case "contains": m_Operator = ConditionOperator.Contains; break;

                case "contains~":
                case "~contains": m_Operator = ConditionOperator.ContainsInsensitive; break;
            }

            if ( m_Operator != ConditionOperator.Equality && m_Operator != ConditionOperator.Inequality )
            {
                if ( m_Argument != null && !(m_Argument is IComparable) )
                    throw new Exception( String.Format( "This property ({0}) is not comparable.", prop ) );
            }
        }
Esempio n. 48
0
		public PropertyCondition(Mobile from, Type type, PropertyInfo[] props, string prop, string oper, string arg, bool logicalNot)
		{
			m_From = from;
			m_LogicalNot = logicalNot;

			string failReason = "";
			m_PropertyInfoChain = Properties.GetPropertyInfoChain(from, type, prop, true, ref failReason);

			if (m_PropertyInfoChain == null)
				throw new Exception(failReason);

			/*for ( int i = 0; i < props.Length; ++i )
			{
				PropertyInfo check = props[i];

				if ( !Insensitive.Equals( check.Name, prop ) )
					continue;

				m_Property = check;
				break;
			}

			if ( m_Property == null )
				throw new Exception( String.Format( "No property with the name ({0}) was found on type ({1}).", prop, type.Name ) );

			CPA attr = Properties.GetCPA( m_Property );

			if ( attr == null )
				throw new Exception( String.Format( "No property with the name ({0}) was found on type ({1}).", prop, type.Name ) );

			if ( from.AccessLevel < attr.ReadLevel )
				throw new Exception( String.Format( "Getting this property ({0}) requires at least {1} access level.", prop, Mobile.GetAccessLevelName( attr.ReadLevel ) ) );*/

			string error = Properties.ConstructFromString(m_PropertyInfoChain[m_PropertyInfoChain.Length - 1].PropertyType, null, arg, ref m_Argument);

			if (error != null)
				throw new Exception(error);

			switch (oper)
			{
				case "=":
				case "==":
				case "is": m_Operator = ConditionOperator.Equality; break;

				case "!=": m_Operator = ConditionOperator.Inequality; break;

				case ">": m_Operator = ConditionOperator.Greater; break;
				case "<": m_Operator = ConditionOperator.Lesser; break;

				case ">=": m_Operator = ConditionOperator.GreaterEqual; break;
				case "<=": m_Operator = ConditionOperator.LesserEqual; break;

				case "==~":
				case "~==":
				case "=~":
				case "~=":
				case "is~":
				case "~is": m_Operator = ConditionOperator.EqualityInsensitive; break;

				case "!=~":
				case "~!=": m_Operator = ConditionOperator.InequalityInsensitive; break;

				case "starts": m_Operator = ConditionOperator.StartsWith; break;

				case "starts~":
				case "~starts": m_Operator = ConditionOperator.StartsWithInsensitive; break;

				case "ends": m_Operator = ConditionOperator.EndsWith; break;

				case "ends~":
				case "~ends": m_Operator = ConditionOperator.EndsWithInsensitive; break;

				case "contains": m_Operator = ConditionOperator.Contains; break;

				case "contains~":
				case "~contains": m_Operator = ConditionOperator.ContainsInsensitive; break;
			}

			if (m_Operator != ConditionOperator.Equality && m_Operator != ConditionOperator.Inequality)
			{
				if (m_Argument != null && !(m_Argument is IComparable))
					throw new Exception(String.Format("This property ({0}) is not comparable.", prop));
			}
		}
Esempio n. 49
0
		/// <summary>
		/// Translates the given <see cref="ConditionOperator"/> into the string representation
		/// used in the XML.
		/// </summary>
		/// <param name="p_copOperator">The <see cref="ConditionOperator"/> to unparse.</param>
		/// <returns>The string representation used in the XML for the given <see cref="ConditionOperator"/>.</returns>
		protected string UnparseConditionOperator(ConditionOperator p_copOperator)
		{
			return p_copOperator.ToString();
		}
Esempio n. 50
0
        /// <summary>
        /// Creates <see cref="OrCondition"/> with the same <paramref name="fieldName"/> cref="fieldName"/> and differents <paramref name="values"/>.
        /// </summary>
        /// <param name="fieldName">name of a field which mapped with table.</param>
        /// <param name="values"></param>
        /// <param name="operator"></param>
        /// <param name="entityType">defines filtering Entity.</param>
        /// <returns><see cref="OrCondition"/> which contains <see cref="Condition"/> where the same 
        /// <paramref name="fieldName"/> and differents <paramref name="values"/>.
        /// </returns>
        public static OrCondition Create(string fieldName, object[] values, ConditionOperator @operator, Type entityType)
        {
            Checker.CheckArgumentNull(fieldName, "fieldName");

            if (values == null || values.Length == 0)
            {
                throw new ArgumentNullException("values");
            }

            var conditionList = new ConditionList();
            conditionList.AddConditions(fieldName, values, @operator, entityType);

            return new OrCondition(conditionList);
        }
Esempio n. 51
0
 public SelectSql Where(string table, string column, string parameterName, ConditionOperator op, params object[] values)
 {
     TableItem tableInfo = null;
     if (!String.IsNullOrEmpty(table))
     {
         tableInfo = this.GetOrCreateTable(table);
     }
     this.wheres.Add(new WhereItem(tableInfo, column, parameterName, op, values));
     return this;
 }
 public ConditionExpression(string entityName, string attributeName, ConditionOperator conditionOperator, params object[] values) :
     this(attributeName, conditionOperator, values)
 {
     this.EntityName = entityName;
 }
Esempio n. 53
0
            internal WhereItem(TableItem table, string columnName, string parameterName, ConditionOperator op, object[] values)
            {
                if (String.IsNullOrEmpty(columnName))
                    throw new ArgumentNullException("columnName");
                if (null == values)
                    throw new ArgumentNullException("values");

                this.Table = table;
                this.Criteria = new FilterCriteria(columnName, op, '@', values) { ParameterName = parameterName };
            }
 public void AddCondition(string attributeName, ConditionOperator conditionOperator, params Object[] values)
 {
     if (values.Count() == 0)
         this.Conditions.Add(new ConditionExpression(attributeName, conditionOperator));
     else
         this.Conditions.Add(new ConditionExpression(attributeName, conditionOperator, values));
 }
 public void AddCondition(string entityName, string attributeName, ConditionOperator conditionOperator, params Object[] values)
 {
     this.Conditions.Add(new ConditionExpression(entityName, attributeName, conditionOperator, values));
 }
Esempio n. 56
0
 public OperatorItem(ConditionOperator Operator)
 {
     oper = Operator;
 }
 /// <summary>
 ///     ONLY IMPLEMENTED FOR OPTION SETS
 /// </summary>
 public void AddFilter(string fieldName, ConditionOperator conditionoperator, object value)
 {
     Filters =
         Filters.Concat(new[] { new ConditionExpression(fieldName, conditionoperator, value) }).ToArray();
 }
Esempio n. 58
0
 /// <summary>
 /// Creates <see cref="OrCondition"/> with the same <paramref name="fieldName"/> cref="fieldName"/> and differents <paramref name="values"/>.
 /// <see cref="Condition.ElementType"/> define as null.
 /// </summary>
 /// <param name="fieldName">name of a field which mapped with table.</param>
 /// <param name="values"></param>
 /// <param name="operator"></param>
 /// <returns><see cref="OrCondition"/> which contains <see cref="Condition"/> where the same 
 /// <paramref name="fieldName"/> and differents <paramref name="values"/>.
 /// </returns>
 public static OrCondition Create(string fieldName, object[] values, ConditionOperator @operator)
 {
     return Create(fieldName, values, @operator, null);
 }
 public bool MeetsConditionChanging(string fieldName, ConditionOperator conditionOperator, object value)
 {
     var conditions = new[] { new ConditionExpression(fieldName, conditionOperator, value) };
     return MeetsConditionsChanging(conditions);
 }
Esempio n. 60
0
 public SelectSql Where(string column, ConditionOperator op, params object[] values)
 {
     return this.Where(null, column, null, op, values);
 }