Ejemplo n.º 1
0
        public SelectSqlSection Join(SelectSqlSection sqlSectin)
        {
            bool IsAlias = !string.IsNullOrEmpty(this.AliasName);

            switch (this.JoinType)
            {
            case EJoinType.Join:
                if (IsAlias)
                {
                    sqlSectin.Join(this.JoinQueryTable, this.AliasName, this.JoinWhere);
                }
                else
                {
                    sqlSectin.Join(this.JoinQueryTable, this.JoinWhere);
                }
                break;

            case EJoinType.LeftJoin:
                if (IsAlias)
                {
                    sqlSectin.LeftJoin(this.JoinQueryTable, this.AliasName, this.JoinWhere);
                }
                else
                {
                    sqlSectin.LeftJoin(this.JoinQueryTable, this.JoinWhere);
                }
                break;

            case EJoinType.RightJoin:
                if (IsAlias)
                {
                    sqlSectin.RightJoin(this.JoinQueryTable, this.AliasName, this.JoinWhere);
                }
                else
                {
                    sqlSectin.RightJoin(this.JoinQueryTable, this.JoinWhere);
                }
                break;
            }
            return(sqlSectin);
        }