Ejemplo n.º 1
0
        /// <summary>
        /// 得到条件语句
        /// </summary>
        /// <param name="filter">过滤器</param>
        /// <returns></returns>
        internal virtual string GetSqlSign(AndOrQueryFilter filter)
        {
            StringBuilder builder = new StringBuilder();
            int           index   = 0;

            builder.Append(" ( ");
            foreach (var item in filter.Filters)
            {
                if (index != 0)
                {
                    builder.Append(" " + filter.FilterAndOrType.ToString() + " ");
                }
                string str = string.Empty;
                if (item is QueryFilter)
                {
                    str = GetSqlSign(item as QueryFilter);
                }
                if (item is AndOrQueryFilter)
                {
                    str = GetSqlSign(item as AndOrQueryFilter);
                }
                builder.Append(str);
                index++;
            }
            builder.Append(" ) ");
            return(builder.ToString());
        }
Ejemplo n.º 2
0
        public QueryFilterBase ToFilters()
        {
            var fitler = new AndOrQueryFilter()
            {
                FilterAndOrType = FilterAndOrType, Filters = Filters
            };

            return(fitler);
        }