Skip to content

Commit

Permalink
fixed pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
mausch committed Jan 10, 2012
1 parent fb43ba2 commit 21d003c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions QuartzNetWebConsole.Views/PaginationInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

Public ReadOnly Property LastPage As Integer
Get
Return CInt(Math.Floor(CDec(TotalItemCount) - 1) / PageSize) + 1
Return CInt(Math.Floor((CDec(TotalItemCount) - 1) / PageSize)) + 1
End Get
End Property

Expand Down Expand Up @@ -59,7 +59,7 @@
Public ReadOnly Property Pages As IEnumerable(Of Integer)
Get
Dim pageCount = LastPage
Dim pageFrom = Math.Max(1, CurrentPage - PageSize)
Dim pageFrom = Math.Max(1, CurrentPage - PageSlide)
Dim pageTo = Math.Min(pageCount, CurrentPage + PageSlide)
pageFrom = Math.Max(1, Math.Min(pageTo - 2 * PageSlide, pageFrom))
pageTo = Math.Min(pageCount, Math.Max(pageFrom + 2 * PageSlide, pageTo))
Expand Down

0 comments on commit 21d003c

Please sign in to comment.