예제 #1
0
        public virtual string GetConditionOp(CheckOp condition)
        {
            var left = this.FormatTableAndColumn(condition.ColumnName);
            // get unique parameter name
            var parameterName = this.GetParameterName(condition.ColumnName);

            if (condition.Rank > 1)
            {
                parameterName += condition.Rank.ToString();
            }
            return(left + condition.Operator + parameterName);
        }
예제 #2
0
파일: Check.cs 프로젝트: romagny13/EasyDb
        private void SetRank(CheckOp condition)
        {
            var rank       = 1;
            var columnName = condition.ColumnName;

            if (this is CheckOp && this.ColumnName == columnName)
            {
                rank += 1;
            }
            foreach (var subCondition in this.ChainedConditions)
            {
                if (subCondition.Condition is CheckOp &&
                    subCondition.Condition.ColumnName == columnName)
                {
                    rank += 1;
                }
            }
            condition.Rank = rank;
        }