Beispiel #1
0
        public void ReferenceOverFlowCheck()
        {
            var rangeStatement1 = new RangeStatement("2..10 | 51..343");

            rangeStatement1.AddStatement(new ReferenceStatement("value"));
            Assert.Throws <ArgumentOutOfRangeException>(() => rangeStatement1.AddStatement(new ReferenceStatement("value")));
        }
        public void ReferenceOverFlowCheck()
        {
            var lengthStatement1 = new RangeStatement("2323..5690");

            lengthStatement1.AddStatement(new ReferenceStatement("value"));
            Assert.Throws <ArgumentOutOfRangeException>(() => lengthStatement1.AddStatement(new ReferenceStatement("value")));
        }
Beispiel #3
0
        public override string ToString()
        {
            string result = "";

            if (ExpressionSqlBuilder.ExistSubQuery())
            {
                result = ExpressionSqlBuilder.ParseSubQuery() + " ";
            }

            if (this.SelectStatement != null)
            {
                this.SelectStatement.Columns = this.SelectFields;
                result += this.SelectStatement.ToString() + " " + this.Sql.ToString();
            }
            else
            {
                result += this.Sql.ToString();
            }
            if (this.PageStatement != null)
            {
                PageStatement._SqlPack = this;
                PageStatement.Sql      = result;
                result = PageStatement.ToString();
            }
            else if (this.RangeStatement != null)
            {
                RangeStatement._SqlPack = this;
                RangeStatement.Sql      = result;
                result = RangeStatement.ToString();
            }
            //if (ExpressionSqlBuilder.ExistSubQuery())
            //{
            //    ExpressionSqlBuilder.ClearSubQuery();
            //}
            return(result);
        }