コード例 #1
0
        public virtual void Visiting(SqlMathExpression mathExpression)
        {
            mathExpression.LeftOperand.Accept(this);

            switch (mathExpression.SqlMathOperator)
            {
            case SqlMathOperatorType.Add:
            {
                sqlBuilder.Append("+");
                break;
            }

            case SqlMathOperatorType.Divide:
            {
                sqlBuilder.Append("/");
                break;
            }

            case SqlMathOperatorType.Multiply:
            {
                sqlBuilder.Append("*");
                break;
            }

            case SqlMathOperatorType.Subtract:
            {
                sqlBuilder.Append("-");
                break;
            }
            }
            mathExpression.RightOperand.Accept(this);
        }
コード例 #2
0
 public virtual void Visited(SqlMathExpression mathExpression)
 {
 }
コード例 #3
0
 private void GenerateMath(SqlGenerator sql, SqlMathExpression math)
 {
     GenerateField(sql, math.Left);
     sql.Add(" " + OperatorStr(math.Op) + " ");
     GenerateField(sql, math.Right);
 }