Beispiel #1
0
        public tgCase Else(tgQueryItem queryItem)
        {
            tgExpression expression = queryItem;

            this.data.Else = expression;

            return(this);
        }
Beispiel #2
0
        public tgCase Then(tgExpression expression)
        {
            tgSimpleCaseData.tgCaseClause clause = new tgSimpleCaseData.tgCaseClause();
            clause.When = this.WhenItem;
            clause.Then = expression;

            if (data.Cases == null)
            {
                data.Cases = new List <tgSimpleCaseData.tgCaseClause>();
            }

            this.data.Cases.Add(clause);

            return(this);
        }
Beispiel #3
0
        protected static string GetExpressionColumn(StandardProviderParameters std, tgDynamicQuerySerializable query, tgExpression expression, bool inExpression, bool useAlias)
        {
            string sql = String.Empty;

            if (expression.CaseWhen != null)
            {
                return GetCaseWhenThenEnd(std, query, expression.CaseWhen);
            }

            if (expression.HasMathmaticalExpression)
            {
                sql += GetMathmaticalExpressionColumn(std, query, expression.MathmaticalExpression);
            }
            else
            {
                sql += GetColumnName(expression.Column);
            }

            if (expression.SubOperators != null)
            {
                if (expression.Column.Distinct)
                {
                    sql = BuildSubOperationsSql(std, "DISTINCT " + sql, expression.SubOperators);
                }
                else
                {
                    sql = BuildSubOperationsSql(std, sql, expression.SubOperators);
                }
            }

            if (!inExpression && useAlias)
            {
                if (expression.SubOperators != null || expression.Column.HasAlias)
                {
                    sql += " AS " + Delimiters.StringOpen + expression.Column.Alias + Delimiters.StringClose;
                }
            }

            return sql;
        }
Beispiel #4
0
 public tgCase When(tgExpression ex)
 {
     return(this);
 }
Beispiel #5
0
 public tgCase Else(tgExpression expression)
 {
     this.data.Else = expression;
     return(this);
 }
Beispiel #6
0
 public tgCase Else(tgExpression expression)
 {
     this.data.Else = expression;
     return this;
 }
Beispiel #7
0
 public tgCase When(tgExpression ex)
 {
     return this;
 }
Beispiel #8
0
        public tgCase Then(tgExpression expression)
        {
            tgSimpleCaseData.tgCaseClause clause = new tgSimpleCaseData.tgCaseClause();
            clause.When = this.WhenItem;
            clause.Then = expression;

            if (data.Cases == null)
            {
                data.Cases = new List<tgSimpleCaseData.tgCaseClause>();
            }

            this.data.Cases.Add(clause);

            return this;
        }