Ejemplo n.º 1
0
        /// <summary>
        /// 将List数据包装为PageObj
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="query"></param>
        /// <returns></returns>
        public static PageObj <T> ToPageObj <T>(this CRL.LambdaQuery.LambdaQuery <T> query) where T : CRL.IModel, new()
        {
            var result  = query.ToList();
            var pageObj = new PageObj <T>(result, query.SkipPage, query.RowCount, query.TakeNum);

            return(pageObj);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 创建分页导航
        /// </summary>
        public static MvcHtmlString CreatePageNavigation <T>(PageObj <T> pageObj, CoreHelper.PageNavigation.PageStyle style = CoreHelper.PageNavigation.PageStyle.Google, string navFormat = "")
        {
            var nav = new CoreHelper.PageNavigation();

            nav.SetPageStyle(style);
            nav.PageNavigationFormat = navFormat;
            if (pageObj.Count == 0)
            {
                return(MvcHtmlString.Create(""));
            }
            string str = nav.GetPageNavigation(pageObj.PageIndex, pageObj.Total, pageObj.PageSize);

            return(MvcHtmlString.Create(str));
        }
Ejemplo n.º 3
0
 public static MvcHtmlString Pager <T>(this HtmlHelper html, PageObj <T> pageObj, CoreHelper.PageNavigation.PageStyle style = CoreHelper.PageNavigation.PageStyle.Google, string navFormat = "")
 {
     return(Core.Mvc.ControllHelper.CreatePageNavigation(pageObj, style, navFormat));
 }