Пример #1
0
 private QWhereCondition AddCondition(QCondition condition, WhereType type)
 {
     if (whereType == WhereType.None)
     {
         if (condition is QWhereCondition)
         {
             return((QWhereCondition)condition);
         }
         whereType     = WhereType.Single;
         leftCondition = condition;
         return(this);
     }
     if (whereType == WhereType.Single)
     {
         whereType      = type;
         rightCondition = condition;
         if (rightCondition is QWhereCondition)
         {
             rightHasOr = ((QWhereCondition)rightCondition).whereType == WhereType.Or;
         }
         return(this);
     }
     var where            = new QWhereCondition();
     where.whereType      = type;
     where.leftCondition  = this;
     where.rightCondition = condition;
     where.leftHasOr      = this.whereType == WhereType.Or;
     if (rightCondition is QWhereCondition)
     {
         where.rightHasOr = ((QWhereCondition)rightCondition).whereType == WhereType.Or;
     }
     return(where);
 }
Пример #2
0
 public void Where(QCondition @where)
 {
     if (_jump)
     {
         _jump = false; return;
     }
     whereCondition = whereCondition.And(@where);
 }
Пример #3
0
        public void Having(QCondition having)
        {
            if (_jump)
            {
                _jump = false; return;
            }

            _having.Add(having);
        }
Пример #4
0
 internal QWhereCondition And(QCondition condition)
 {
     return(AddCondition(condition, WhereType.And));
 }
Пример #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="c1"></param>
 /// <param name="whereType"></param>
 /// <param name="c2"></param>
 internal QWhereCondition(QCondition c1, WhereType whereType, QCondition c2)
 {
     leftCondition  = c1;
     this.whereType = whereType;
     rightCondition = c2;
 }
Пример #6
0
 internal QWhereCondition Or(QCondition condition)
 {
     return(AddCondition(condition, WhereType.Or));
 }
Пример #7
0
 public QWhereCondition Or(QCondition condition)
 {
     return(AddCondition(condition, WhereType.Or));
 }
Пример #8
0
 public QWhereCondition And(QCondition condition)
 {
     return(AddCondition(condition, WhereType.And));
 }