Pagination.cs 870 B

12345678910111213141516171819202122232425262728293031
  1. 
  2. using System;
  3. using System.Collections.Generic;
  4. namespace TEAMModelOS.SDK
  5. {
  6. public class Pagination
  7. {
  8. public long total { get; set; }
  9. public int currPage { get; set; }
  10. public int pageSize { get; set; }
  11. public int totalPage { get; set; }
  12. public Pagination() { }
  13. public Pagination(long total, int currPage, int pageSize)
  14. {
  15. this.total = total;
  16. this.currPage = currPage;
  17. this.pageSize = pageSize;
  18. this.totalPage = (int)Math.Ceiling((double)this.total / (double)this.pageSize);
  19. }
  20. public Pagination(long total, int currPage, int pageSize, int totalPage)
  21. {
  22. this.total = total;
  23. this.currPage = currPage;
  24. this.pageSize = pageSize;
  25. this.totalPage = totalPage;
  26. }
  27. }
  28. }