示例#1
0
        }       //	getWhereClause

        /// <summary>
        ///Create the resulting Query WHERE Clause
        /// </summary>
        /// <param name="fullyQualified">fullyQualified fully qualified Table.ColumnName</param>
        /// <returns></returns>
        public string GetWhereClause(bool fullyQualified)
        {
            bool qualified = fullyQualified;

            if (qualified && (_tableName == null || _tableName.Length == 0))
            {
                qualified = false;
            }
            //
            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < _list.Count; i++)
            {
                QueryRestriction r = _list[i];
                if (i != 0)
                {
                    sb.Append(r.AndCondition ? " AND " : " OR ");
                    //sb.Append("");
                }
                if (qualified)
                {
                    sb.Append(r.GetSQL(_tableName));
                }
                else
                {
                    sb.Append(r.GetSQL(null));
                }
            }
            return(sb.ToString());
        }
示例#2
0
        }       //	getWhereClause

        public String GetWhereClause(int index)
        {
            StringBuilder sb = new StringBuilder();

            if (index >= 0 && index < _list.Count)
            {
                QueryRestriction r = _list[index];
                sb.Append(r.GetSQL(null));
            }
            return(sb.ToString());
        }       //	getWhereClause