///<summary>
 /// Displays a configurable "Go To Page:" form for instances of PagedList.
 ///</summary>
 ///<param name="html">This method is meant to hook off HtmlHelper as an extension method.</param>
 ///<param name="list">The PagedList to use as the data source.</param>
 ///<param name="formAction">The URL this form should submit the GET request to.</param>
 ///<param name="inputFieldName">The querystring key this form should submit the new page number as.</param>
 ///<returns>Outputs the "Go To Page:" form HTML.</returns>
 public static MvcHtmlString PagedListGoToPageForm(this System.Web.Mvc.HtmlHelper html,
                                                   IPagingInfo list,
                                                   string formAction,
                                                   string inputFieldName)
 {
     return(PagedListGoToPageForm(html, list, formAction, new GoToFormRenderOptions(inputFieldName)));
 }
Exemplo n.º 2
0
        public async Task <PagedCollection <TEntity> > ListAsync(IPagingInfo pagingInfo,
                                                                 Expression <Func <TEntity, bool> > filter,
                                                                 Func <IQueryable <TEntity>, IOrderedQueryable <TEntity> > orderBy,
                                                                 params string[] includeExpressions)
        {
            IQueryable <TEntity> queryBeforePaging = dbSet;

            if (filter != null)
            {
                queryBeforePaging = queryBeforePaging.Where(filter);
            }

            foreach (var include in includeExpressions.Where(s => !string.IsNullOrEmpty(s)))
            {
                queryBeforePaging = queryBeforePaging.Include(include);
            }

            var count = await queryBeforePaging.CountAsync();

            if (orderBy != null)
            {
                queryBeforePaging = orderBy(queryBeforePaging);
            }
            else
            {
                queryBeforePaging = queryBeforePaging.OrderBy(h => h.Id);
            }

            return(PagedCollection <TEntity> .Create(queryBeforePaging,
                                                     pagingInfo.PageNumber,
                                                     pagingInfo.PageSize));
        }
        ///<summary>
        /// Displays a configurable "Go To Page:" form for instances of PagedList.
        ///</summary>
        ///<param name="html">This method is meant to hook off HtmlHelper as an extension method.</param>
        ///<param name="list">The PagedList to use as the data source.</param>
        ///<param name="formAction">The URL this form should submit the GET request to.</param>
        ///<param name="options">Formatting options.</param>
        ///<returns>Outputs the "Go To Page:" form HTML.</returns>
        public static MvcHtmlString PagedListGoToPageForm(this System.Web.Mvc.HtmlHelper html,
                                                          IPagingInfo list,
                                                          string formAction,
                                                          GoToFormRenderOptions options)
        {
            var form = new TagBuilder("form");

            form.AddCssClass("PagedList-goToPage");
            form.Attributes.Add("action", formAction);
            form.Attributes.Add("method", "get");

            var fieldset = new TagBuilder("fieldset");

            var label = new TagBuilder("label");

            label.Attributes.Add("for", options.InputFieldName);
            label.SetInnerText(options.LabelFormat);

            var input = new TagBuilder("input");

            input.Attributes.Add("type", options.InputFieldType);
            input.Attributes.Add("name", options.InputFieldName);
            input.Attributes.Add("value", list.PageNumber.ToString());

            var submit = new TagBuilder("input");

            submit.Attributes.Add("type", "submit");
            submit.Attributes.Add("value", options.SubmitButtonFormat);

            fieldset.InnerHtml  = label.ToString();
            fieldset.InnerHtml += input.ToString(TagRenderMode.SelfClosing);
            fieldset.InnerHtml += submit.ToString(TagRenderMode.SelfClosing);
            form.InnerHtml      = fieldset.ToString();
            return(new MvcHtmlString(form.ToString()));
        }
Exemplo n.º 4
0
        public PagedCollection <TEntity> List <TProperty>(IPagingInfo pagingInfo,
                                                          Expression <Func <TEntity, bool> > filter,
                                                          Func <IQueryable <TEntity>, IOrderedQueryable <TEntity> > orderBy,
                                                          Expression <Func <TEntity, TProperty> > includeExpressions)
        {
            IQueryable <TEntity> queryBeforePaging = dbSet;

            if (filter != null)
            {
                queryBeforePaging = queryBeforePaging.Where(filter);
            }

            queryBeforePaging = queryBeforePaging.Include(includeExpressions);

            var count = queryBeforePaging.Count();

            if (orderBy != null)
            {
                queryBeforePaging = orderBy(queryBeforePaging);
            }
            else
            {
                queryBeforePaging = queryBeforePaging.OrderBy(h => h.Id);
            }

            return(PagedCollection <TEntity> .Create(queryBeforePaging,
                                                     pagingInfo.PageNumber,
                                                     pagingInfo.PageSize));
        }
Exemplo n.º 5
0
 public MessagesController(MaildbContext context, IMessageControl msgCntrl, IAdvancedSearch advSearch, IPagingInfo pageInfo)
 {
     _context   = context;
     _msgCntrl  = msgCntrl;
     _advSearch = advSearch;
     _pageInfo  = pageInfo;
 }
        private static TagBuilder ItemSliceAndTotalText(IPagingInfo list, PagedListRenderOptions options)
        {
            var text = new TagBuilder("a");

            text.SetInnerText(string.Format(options.ItemSliceAndTotalFormat, list.FirstItemOnPage, list.LastItemOnPage, list.TotalItemCount));

            return(WrapInListItem(text, options, "PagedList-pageCountAndLocation", "disabled"));
        }
        private static TagBuilder PageCountAndLocationText(IPagingInfo list, PagedListRenderOptions options)
        {
            var text = new TagBuilder("a");

            text.SetInnerText(string.Format(options.PageCountAndCurrentLocationFormat, list.PageNumber, list.PageCount));

            return(WrapInListItem(text, options, "PagedList-pageCountAndLocation", "disabled"));
        }
Exemplo n.º 8
0
 public SearchLegalPartyDomain(ISearchProviderSelector searchProviderSelector, ILogger logger,
                               IPagingInfo pagingInfo, ISearchResultsConfiguration searchResultsConfiguration)
 {
     _searchProviderSelector = searchProviderSelector;
     _logger     = logger;
     _pagingInfo = (PagingInfo)pagingInfo;
     _searchResultsConfiguration = searchResultsConfiguration;
 }
Exemplo n.º 9
0
 public ContainsSearchLegalPartyRepository(SearchLegalPartyContext context, IPagingInfo pagingInfo, ILogger logger,
                                           ICommandTimeoutConfiguration commandTimeoutConfiguration)
 {
     _pagingInfo = (PagingInfo)pagingInfo;
     _logger     = logger;
     _context    = context;
     _context.Database.SetCommandTimeout(commandTimeoutConfiguration.CommandTimeout);
 }
Exemplo n.º 10
0
        /// <summary>
        /// Adds @PageNumber and @PageSize parameters using the supplied filter.
        /// </summary>
        /// <param name="args">The arguments.</param>
        /// <param name="filter">The filter.</param>
        public static void AddPagingFilters([NotNull] this DynamicParameters args, [NotNull] IPagingInfo filter)
        {
            Contract.Requires(args != null);
            Contract.Requires(filter != null);

            args.Add(PageNumber, filter.PageNumber);
            args.Add(PageSize, filter.PageSize);
        }
Exemplo n.º 11
0
 public GameController(IGameRepository repo, IPagingInfo pagInfo, IGamesListViewModel gamlist)
 {
     repository  = repo;
     paginatInfo = pagInfo;
     gamesList   = gamlist;
     paginatInfo.ItemsPerPage = pageSize;
     paginatInfo.TotalItems   = repository.Games.Count();
     gamesList.PagingInfo     = paginatInfo as IPagingInfo;
 }
Exemplo n.º 12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PagedResult{T}" /> class.
        /// </summary>
        /// <param name="paging">The paging.</param>
        public PagedResult(IPagingInfo paging)
        {
            if (paging == null)
            {
                return;
            }

            this.CurrentPageNumber = paging.PageNumber;
            this.PageSize          = paging.PageSize;
        }
        public SimpleQuery Page(IPagingInfo paging = null)
        {
            this.paging = string.Empty;
            if (paging != null)
            {
                this.paging = paging.ToQueryString();
            }
            ;

            return(this);
        }
Exemplo n.º 14
0
        public async Task <IEnumerable <JourneyViewModel> > GetAllAsync(
            string company,
            string country,
            DateTime?dateFrom,
            DateTime?dateTo,
            ISortingInfo sortingInfo,
            IPagingInfo pagingInfo)
        {
            var query = BuildIndexQuery(company, country, dateFrom, dateTo, sortingInfo, true, pagingInfo);
            var data  = await query.Select(v => _mapper.Map <Journey, JourneyViewModel>(v)).ToListAsync();

            return(data);
        }
Exemplo n.º 15
0
        public ActionResult Pagination(IPagingInfo pagingInfo)
        {
            var pagination = new Pagination
            {
                CurrentPage  = 1,
                PageNumbers  = Enumerable.Range(1, 2).ToArray(),
                PageSize     = 5,
                TotalRecords = 6,
                TotalPages   = 2,
                ShowingFrom  = 1,
                ShowingTo    = 5
            };

            return(Display(pagination));
        }
Exemplo n.º 16
0
        private static TagBuilder First(IPagingInfo list, Func <int, string> generatePageUrl, PagedListRenderOptions options)
        {
            const int targetPageNumber = 1;
            var       first            = new TagBuilder("a")
            {
                InnerHtml = string.Format(options.LinkToFirstPageFormat, targetPageNumber)
            };

            if (list.IsFirstPage)
            {
                return(WrapInListItem(first, options, "PagedList-skipToFirst", "disabled"));
            }

            first.Attributes["href"] = generatePageUrl(targetPageNumber);
            return(WrapInListItem(first, options, "PagedList-skipToFirst"));
        }
Exemplo n.º 17
0
        private static TagBuilder Page(int i, IPagingInfo list, Func <int, string> generatePageUrl, PagedListRenderOptions options)
        {
            var format = options.FunctionToDisplayEachPageNumber
                         ?? (pageNumber => string.Format(options.LinkToIndividualPageFormat, pageNumber));
            var targetPageNumber = i;
            var page             = new TagBuilder("a");

            page.SetInnerText(format(targetPageNumber));

            if (i == list.PageNumber + 1)
            {
                return(WrapInListItem(page, options, "active"));
            }

            page.Attributes["href"] = generatePageUrl(targetPageNumber);
            return(WrapInListItem(page, options));
        }
Exemplo n.º 18
0
        /// <summary>
        /// 按Query条件查询并返回支持分页的对象列表
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <param name="pagingInfo">分页信息</param>
        /// <param name="orderBy">排序字段信息</param>
        /// <returns>支持翻页的对象列表</returns>
        public virtual IPagedList <T> GetObjectPagedList(IQueryOver <T, T> query, IPagingInfo pagingInfo, OrderField orderBy)
        {
            bool needPaging = pagingInfo != null && pagingInfo.IsLegal;

            if (needPaging)
            {
                if (pagingInfo.DoCount)
                {
                    pagingInfo.RecordCount = query.RowCountInt64();
                }
                query.Skip((pagingInfo.CurrentPage - 1) * pagingInfo.PageSize).Take(pagingInfo.PageSize);
            }

            query.RootCriteria.AddOrder(new Order(orderBy.PropertyName, orderBy.Ascending));
            IList <T> list = query.List <T>();

            return(needPaging ? list.ToPagedList(pagingInfo.CurrentPage, pagingInfo.PageSize, (int)pagingInfo.RecordCount) : list.ToPagedList(1, list.Count));
        }
Exemplo n.º 19
0
        private static TagBuilder Next(IPagingInfo list, Func <int, string> generatePageUrl, PagedListRenderOptions options)
        {
            var targetPageNumber = list.PageNumber + 2;
            var next             = new TagBuilder("a")
            {
                InnerHtml = string.Format(options.LinkToNextPageFormat, targetPageNumber)
            };

            next.Attributes["rel"] = "next";

            if (!list.HasNextPage)
            {
                return(WrapInListItem(next, options, "PagedList-skipToNext", "disabled"));
            }

            next.Attributes["href"] = generatePageUrl(targetPageNumber);
            return(WrapInListItem(next, options, "PagedList-skipToNext"));
        }
Exemplo n.º 20
0
        private static TagBuilder Previous(IPagingInfo list, Func <int, string> generatePageUrl, PagedListRenderOptions options)
        {
            var targetPageNumber = list.PageNumber; //- 1;
            var previous         = new TagBuilder("a")
            {
                InnerHtml = string.Format(options.LinkToPreviousPageFormat, targetPageNumber)
            };

            previous.Attributes["rel"] = "prev";

            if (!list.HasPreviousPage)
            {
                return(WrapInListItem(previous, options, "PagedList-skipToPrevious", "disabled"));
            }

            previous.Attributes["href"] = generatePageUrl(targetPageNumber);
            return(WrapInListItem(previous, options, "PagedList-skipToPrevious"));
        }
Exemplo n.º 21
0
        public async Task <DbRecordList <User> > SearchAsync(
            string keyword,
            Sorting <UserSortableFields> sorting = null,
            IPagingInfo paging = null)
        {
            var records = new DbRecordList <User>(paging);

            // Default sorting
            if (sorting == null)
            {
                sorting = new Sorting <UserSortableFields>(UserSortableFields.FirstName, SortDirection.Asc);
            }

            var param = new DynamicParameters();

            string filter = GetSqlFilter(keyword, param);

            var query = new SimpleQuery(GetBaseQuery())
                        .SetFilter(filter)
                        .SortBy(sorting)
                        .Page(paging);

            var record = await DbClient.QueryAsync <User, Company, User>(
                query.ToString(),
                (user, company) =>
            {
                user.CompanyInfo = company;
                return(user);
            },
                param);

            if (record == null)
            {
                return(records);
            }

            records.Records    = record;
            records.TotalCount = await GetTotalCountAsync(filter, param, "u");

            return(records);
        }
Exemplo n.º 22
0
        /// <summary>
        /// Returns a paged collection of entities, optionally filtered and sorted with specified associated entities eagerly loaded.
        /// </summary>
        /// <param name="pagingInfo">The paging information.</param>
        /// <param name="filter">The filter.</param>
        /// <param name="orderBy">The order by.</param>
        /// <param name="relatedEntitiesToEagerlyLoad">Names of properties representing related entities to be eagerly loaded.</param>
        /// <returns></returns>
        public IPagedCollection <TEntity> List(IPagingInfo pagingInfo,
                                               Expression <Func <TEntity, bool> > filter,
                                               Func <IQueryable <TEntity>, IOrderedQueryable <TEntity> > orderBy,
                                               params string[] relatedEntitiesToEagerlyLoad)
        {
            IQueryable <TEntity>  query = dbSet;
            ICollection <TEntity> data;

            if (filter != null)
            {
                query = query.Where(filter);
            }

            foreach (var relatedEntityToEagerlyLoad in relatedEntitiesToEagerlyLoad)
            {
                query.Include(relatedEntityToEagerlyLoad);
            }

            var count = query.Count();

            if (orderBy != null)
            {
                data = orderBy(query)
                       .Skip(pagingInfo.FirstResult)
                       .Take(pagingInfo.MaxResults)
                       .ToList();
            }
            else
            {
                data = query.OrderBy(h => h.Id)
                       .Skip(pagingInfo.FirstResult)
                       .Take(pagingInfo.MaxResults)
                       .ToList();
            }

            return(new PagedCollection <TEntity>
            {
                TotalRowCount = count,
                Data = data
            });
        }
Exemplo n.º 23
0
        public static MvcHtmlString PageLinks(this HtmlHelper html,
                                              IPagingInfo pagingInfo,
                                              Func <int, string> pageUrl)
        {
            StringBuilder result = new StringBuilder();

            for (int i = 1; i <= pagingInfo.TotalPages; i++)
            {
                TagBuilder tag = new TagBuilder("a");
                tag.MergeAttribute("href", pageUrl(i));
                tag.InnerHtml = i.ToString();
                if (i == pagingInfo.CurrentPage)
                {
                    tag.AddCssClass("selected");
                    tag.AddCssClass("btn-primary");
                }
                tag.AddCssClass("btn btn-default");
                result.Append(tag.ToString());
            }
            return(MvcHtmlString.Create(result.ToString()));
        }
Exemplo n.º 24
0
        /// <summary>
        /// 根据过滤条件查询并返回支持翻页的对象列表
        /// </summary>
        /// <param name="pagingInfo">分页信息</param>
        /// <param name="orderBy">排序字段信息</param>
        /// <param name="condition">过滤条件</param>
        /// <returns>带有翻页信息的对象列表</returns>
        public virtual IPagedList <T> GetObjectPagedList(IPagingInfo pagingInfo, OrderField orderBy, Expression <Func <T, bool> > condition = null)
        {
            var query = this.CreateQueryOver();

            if (condition != null)
            {
                query.Where(condition);
            }
            bool needPaging = pagingInfo != null && pagingInfo.IsLegal;

            if (needPaging)
            {
                if (pagingInfo.DoCount)
                {
                    pagingInfo.RecordCount = query.RowCountInt64();
                }
                query.Skip((pagingInfo.CurrentPage - 1) * pagingInfo.PageSize).Take(pagingInfo.PageSize);
            }

            query.RootCriteria.AddOrder(new Order(orderBy.PropertyName, orderBy.Ascending));
            IList <T> list = query.List <T>();

            return(needPaging ? list.ToPagedList(pagingInfo.CurrentPage, pagingInfo.PageSize, (int)pagingInfo.RecordCount) : list.ToPagedList(1, list.Count));
        }
Exemplo n.º 25
0
        public static IQueryable <T> SkipToPage <T>([CanBeNull] this IQueryable <T> list, [CanBeNull] IPagingInfo pagingInfo)
        {
            if (list == null)
            {
                return(Enumerable.Empty <T>().AsQueryable());
            }

            if (pagingInfo == null)
            {
                pagingInfo = new PagingInfo();
            }

            return(list.Skip(Convert.ToInt32((pagingInfo.PageNumber - 1) * pagingInfo.PageSize)).Take(Convert.ToInt32(pagingInfo.PageSize)));
        }
Exemplo n.º 26
0
 /// <summary>
 /// 分页返回结果
 /// </summary>
 public PagingResult(IList <TData> data, int totalCount, IPagingInfo pager)
     : this(data, totalCount, pager?.PageIndex ?? 0, pager?.PageSize ?? 0)
 {
 }
Exemplo n.º 27
0
 ///<summary>
 ///	Displays a configurable paging control for instances of PagedList.
 ///</summary>
 ///<param name = "html">This method is meant to hook off HtmlHelper as an extension method.</param>
 ///<param name = "list">The PagedList to use as the data source.</param>
 ///<param name = "generatePageUrl">A function that takes the page number of the desired page and returns a URL-string that will load that page.</param>
 ///<returns>Outputs the paging control HTML.</returns>
 public static MvcHtmlString PagedListPager(this System.Web.Mvc.HtmlHelper html,
                                            IPagingInfo list,
                                            Func <int, string> generatePageUrl)
 {
     return(PagedListPager(html, list, generatePageUrl, new PagedListRenderOptions()));
 }
Exemplo n.º 28
0
        ///<summary>
        ///	Displays a configurable paging control for instances of PagedList.
        ///</summary>
        ///<param name = "html">This method is meant to hook off HtmlHelper as an extension method.</param>
        ///<param name = "list">The PagedList to use as the data source.</param>
        ///<param name = "generatePageUrl">A function that takes the page number  of the desired page and returns a URL-string that will load that page.</param>
        ///<param name = "options">Formatting options.</param>
        ///<returns>Outputs the paging control HTML.</returns>
        public static MvcHtmlString PagedListPager(this System.Web.Mvc.HtmlHelper html,
                                                   IPagingInfo list,
                                                   Func <int, string> generatePageUrl,
                                                   PagedListRenderOptions options)
        {
            if (options.Display == PagedListDisplayMode.Never || (options.Display == PagedListDisplayMode.IfNeeded && list.PageCount <= 1))
            {
                return(null);
            }

            var listItemLinks = new List <TagBuilder>();

            //calculate start and end of range of page numbers
            var firstPageToDisplay   = 1;
            var lastPageToDisplay    = list.PageCount;
            var pageNumbersToDisplay = lastPageToDisplay;

            if (options.MaximumPageNumbersToDisplay.HasValue && list.PageCount > options.MaximumPageNumbersToDisplay)
            {
                // cannot fit all pages into pager
                var maxPageNumbersToDisplay = options.MaximumPageNumbersToDisplay.Value;
                firstPageToDisplay = list.PageNumber - maxPageNumbersToDisplay / 2;
                if (firstPageToDisplay < 1)
                {
                    firstPageToDisplay = 1;
                }
                pageNumbersToDisplay = maxPageNumbersToDisplay;
                lastPageToDisplay    = firstPageToDisplay + pageNumbersToDisplay - 1;
                if (lastPageToDisplay > list.PageCount)
                {
                    firstPageToDisplay = list.PageCount - maxPageNumbersToDisplay + 1;
                }
            }

            //first
            if (options.DisplayLinkToFirstPage == PagedListDisplayMode.Always || (options.DisplayLinkToFirstPage == PagedListDisplayMode.IfNeeded && firstPageToDisplay > 1))
            {
                listItemLinks.Add(First(list, generatePageUrl, options));
            }

            //previous
            if (options.DisplayLinkToPreviousPage == PagedListDisplayMode.Always || (options.DisplayLinkToPreviousPage == PagedListDisplayMode.IfNeeded && !list.IsFirstPage))
            {
                listItemLinks.Add(Previous(list, generatePageUrl, options));
            }

            //text
            if (options.DisplayPageCountAndCurrentLocation)
            {
                listItemLinks.Add(PageCountAndLocationText(list, options));
            }

            //text
            if (options.DisplayItemSliceAndTotal)
            {
                listItemLinks.Add(ItemSliceAndTotalText(list, options));
            }

            //page
            if (options.DisplayLinkToIndividualPages)
            {
                //if there are previous page numbers not displayed, show an ellipsis
                if (options.DisplayEllipsesWhenNotShowingAllPageNumbers && firstPageToDisplay > 1)
                {
                    listItemLinks.Add(Ellipses(options));
                }

                foreach (var i in Enumerable.Range(firstPageToDisplay, pageNumbersToDisplay))
                {
                    //show delimiter between page numbers
                    if (i > firstPageToDisplay && !string.IsNullOrWhiteSpace(options.DelimiterBetweenPageNumbers))
                    {
                        listItemLinks.Add(WrapInListItem(options.DelimiterBetweenPageNumbers));
                    }

                    //show page number link
                    listItemLinks.Add(Page(i, list, generatePageUrl, options));
                }

                //if there are subsequent page numbers not displayed, show an ellipsis
                if (options.DisplayEllipsesWhenNotShowingAllPageNumbers && (firstPageToDisplay + pageNumbersToDisplay - 1) < list.PageCount)
                {
                    listItemLinks.Add(Ellipses(options));
                }
            }

            //next
            if (options.DisplayLinkToNextPage == PagedListDisplayMode.Always || (options.DisplayLinkToNextPage == PagedListDisplayMode.IfNeeded && !list.IsLastPage))
            {
                listItemLinks.Add(Next(list, generatePageUrl, options));
            }

            //last
            if (options.DisplayLinkToLastPage == PagedListDisplayMode.Always || (options.DisplayLinkToLastPage == PagedListDisplayMode.IfNeeded && lastPageToDisplay < list.PageCount))
            {
                listItemLinks.Add(Last(list, generatePageUrl, options));
            }

            if (listItemLinks.Any())
            {
                //append class to first item in list?
                if (!string.IsNullOrWhiteSpace(options.ClassToApplyToFirstListItemInPager))
                {
                    listItemLinks.First().AddCssClass(options.ClassToApplyToFirstListItemInPager);
                }

                //append class to last item in list?
                if (!string.IsNullOrWhiteSpace(options.ClassToApplyToLastListItemInPager))
                {
                    listItemLinks.Last().AddCssClass(options.ClassToApplyToLastListItemInPager);
                }

                //append classes to all list item links
                foreach (var li in listItemLinks)
                {
                    foreach (var c in options.LiElementClasses ?? Enumerable.Empty <string>())
                    {
                        li.AddCssClass(c);
                    }
                }
            }

            //collapse all of the list items into one big string
            var listItemLinksString = listItemLinks.Aggregate(
                new StringBuilder(),
                (sb, listItem) => sb.Append(listItem.ToString()),
                sb => sb.ToString()
                );

            var ul = new TagBuilder("ul")
            {
                InnerHtml = listItemLinksString
            };

            foreach (var c in options.UlElementClasses ?? Enumerable.Empty <string>())
            {
                ul.AddCssClass(c);
            }

            var outerDiv = new TagBuilder("div");

            foreach (var c in options.ContainerDivClasses ?? Enumerable.Empty <string>())
            {
                outerDiv.AddCssClass(c);
            }
            outerDiv.InnerHtml = ul.ToString();

            return(new MvcHtmlString(outerDiv.ToString()));
        }
Exemplo n.º 29
0
 public DbRecordList(IPagingInfo paging)
 {
     Paging = paging;
 }
Exemplo n.º 30
0
 ///<summary>
 /// Displays a configurable "Go To Page:" form for instances of PagedList.
 ///</summary>
 ///<param name="html">This method is meant to hook off HtmlHelper as an extension method.</param>
 ///<param name="list">The PagedList to use as the data source.</param>
 ///<param name="formAction">The URL this form should submit the GET request to.</param>
 ///<returns>Outputs the "Go To Page:" form HTML.</returns>
 public static MvcHtmlString PagedListGoToPageForm(this System.Web.Mvc.HtmlHelper html,
                                                   IPagingInfo list,
                                                   string formAction)
 {
     return(PagedListGoToPageForm(html, list, formAction, "page"));
 }