Blame view

src/MapsModels/DsModels/PaginationDsM.cs 786 Bytes
db607025   Administrator   add pagination
1
2
3
4
5
6
7
  namespace MapsModels.DsModels
  {
      public class PaginationDsM
      {
          public const string ASC = "ASC";
          public const string DESC = "DESC";
          public int from { get; set; }
8940e931   Administrator   add default sort
8
          public int per_page;
db607025   Administrator   add pagination
9
          public string sort { get; set; }
8940e931   Administrator   add default sort
10
11
12
13
14
15
16
17
18
19
20
          public int perPage{
              get{
                  if(per_page == 0){
                      return 25;
                  }
                  return per_page;
              } 
              set{
                  per_page = value;
              } 
          }
db607025   Administrator   add pagination
21
          public string orderType(){
8940e931   Administrator   add default sort
22
23
24
              if(sort == null){
                  return null;
              }
db607025   Administrator   add pagination
25
26
27
28
29
30
31
32
              if(sort.StartsWith("-")){
                  sort = sort.Substring(1);
                  return DESC;
              }
              return ASC;
          }
      }
  }