Exemple #1
0
 public static expr not(expr exp)
 {
     return(new UnaryExpression("NOT", exp)
     {
         fieldType = dbType.Bool
     });
 }
Exemple #2
0
 public expr plus(expr exp)
 {
     return(new BinaryExpression(this, "+", exp)
     {
         fieldType = this.fieldType
     });
 }
Exemple #3
0
 public static expr Minus(expr exp)
 {
     return(new UnaryExpression("-", exp)
     {
         fieldType = dbType.Double
     });
 }
Exemple #4
0
 public expr lessThan(expr exp)
 {
     return(new BinaryExpression(this, "<", exp)
     {
         fieldType = dbType.Bool
     });
 }
Exemple #5
0
 public expr between(expr exp1, expr exp2)
 {
     return(new BetweenExpression(this, true, exp1, exp2)
     {
         fieldType = dbType.Bool
     });
 }
Exemple #6
0
 public expr greaterThan(expr exp)
 {
     return(new BinaryExpression(this, ">", exp)
     {
         fieldType = dbType.Bool
     });
 }
Exemple #7
0
 public expr greaterOrEqual(expr exp)
 {
     return(new BinaryExpression(this, ">=", exp)
     {
         fieldType = dbType.Bool
     });
 }
Exemple #8
0
 public expr And(expr exp)
 {
     return(new BinaryExpression(this, "AND", exp)
     {
         fieldType = dbType.Bool
     });
 }
Exemple #9
0
 public expr OR(expr exp)
 {
     return(new BinaryExpression(this, "OR", exp)
     {
         fieldType = dbType.Bool
     });
 }
Exemple #10
0
 public expr divide(expr exp)
 {
     return(new BinaryExpression(this, "/", exp)
     {
         fieldType = dbType.Double
     });
 }
Exemple #11
0
 public expr multiply(expr exp)
 {
     return(new BinaryExpression(this, "*", exp)
     {
         fieldType = dbType.Double
     });
 }
Exemple #12
0
 public expr mod(expr exp)
 {
     return(new BinaryExpression(this, "%", exp)
     {
         fieldType = dbType.Int
     });
 }
Exemple #13
0
 public static expr abs(expr exp)
 {
     return(new FunctionExpression("Abs", exp)
     {
         fieldType = exp.fieldType
     });
 }
Exemple #14
0
 public expr notBetween(expr exp1, expr exp2)
 {
     return(new BetweenExpression(this, false, exp1, exp2)
     {
         fieldType = dbType.Bool
     });
 }
Exemple #15
0
 public JoinTable(AbsTable t1, JoinType j, AbsTable t2, expr on)
 {
     this.Tbl1 = t1;
     this.tbl2 = t2;
     this.join = j;
     this.on   = on;
 }
Exemple #16
0
 public expr concat(expr exp)
 {
     return(new BinaryExpression(this, "||", exp)
     {
         fieldType = dbType.String
     });
 }
Exemple #17
0
 public static expr ceiling(expr exp)
 {
     return(new FunctionExpression("ceiling", exp)
     {
         fieldType = dbType.Int
     });
 }
Exemple #18
0
 public BetweenExpression(expr exp, bool betweenOrNot, expr exp1, expr exp2)
 {
     this.exp      = exp;
     this.exp1     = exp1;
     this.exp2     = exp2;
     this._between = betweenOrNot;
 }
Exemple #19
0
 public expr notEqual(expr exp)
 {
     return(new BinaryExpression(this, "<>", exp)
     {
         fieldType = dbType.Bool
     });
 }
Exemple #20
0
 /// <summary>
 /// the length of a string value
 /// </summary>
 public static expr length(expr exp)
 {
     return(new FunctionExpression("length", exp)
     {
         fieldType = dbType.Int
     });
 }
Exemple #21
0
 public static expr floor(expr exp)
 {
     return(new FunctionExpression("floor", exp)
     {
         fieldType = dbType.Int
     });
 }
Exemple #22
0
        public List <T> select <T>(expr cond, int pageIndex, int pageSize) where T : Entity, new()
        {
            var tbl  = new T().Tbl;
            var list = new List <T>();
            var dt   = this.select().from(tbl).where (cond).page(pageIndex, pageSize).execute();

            foreach (DataRow dr in dt.Rows)
            {
                var item = new T();
                item.attach(dr);
                list.Add(item);
            }

            return(list);
        }
Exemple #23
0
        public T selectFirstWhere <T>(expr cond) where T : Entity, new()
        {
            var ent = new T();
            var r   = this.select().from(ent.Tbl).where (cond).executeRow();

            if (r == null)
            {
                return(null);
            }
            else
            {
                ent.attach(r);
                return(ent);
            }
        }
Exemple #24
0
 public InExpression(expr exp, bool InOrNotIn, params object[] values)
 {
     this.exp       = exp;
     this.inOrNotIn = InOrNotIn;
     this.values    = values;
 }
Exemple #25
0
 public Assignment value(expr exp)
 {
     return(new Assignment(this, exp));
 }
Exemple #26
0
 /// <summary>
 /// only use with gruopBy() otherwise it's useless
 /// </summary>
 public SelectStatement having(expr exp)
 {
     this.havingExp = exp;
     return(this);
 }
Exemple #27
0
 /// <summary>
 /// use only once
 /// </summary>
 public SelectStatement where (expr cond)
 {
     this.cond = cond;
     return(this);
 }
Exemple #28
0
 public SortExp(expr exp)
 {
     this.exp = exp;
 }
Exemple #29
0
 public SortExp(expr exp, bool Desc)
 {
     this.exp = exp;
     so       = Desc? SortOrder.DESC : SortOrder.ASC;
 }
Exemple #30
0
 public AliasedExpr(expr exp, string alias)
 {
     this.exp       = exp;
     this._alias    = alias;
     this.fieldType = exp.fieldType;
 }