Ejemplo n.º 1
0
        /// <summary>获取基础Url,用于附加参数</summary>
        /// <param name="where">查询条件,不包含排序和分页</param>
        /// <param name="order">排序</param>
        /// <param name="page">分页</param>
        /// <returns></returns>
        public virtual StringBuilder GetBaseUrl(Boolean where, Boolean order, Boolean page)
        {
            var sb  = new StringBuilder();
            var dic = Params;

            // 过滤
            dic = PagerHelper.FilterSpecialChar(dic);

            // 先构造基本条件,再排序到分页
            if (where)
            {
                sb.UrlParamsExcept(dic, _.Sort, _.Desc, _.PageIndex, _.PageSize);
            }
            if (order)
            {
                sb.UrlParams(dic, _.Sort, _.Desc);
            }
            if (page)
            {
                sb.UrlParams(dic, _.PageIndex, _.PageSize);
            }

            return(sb);
        }