Blame view

src/MapsModels/DsModels/PaginationDsM.cs 1019 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; }
9035cd53   Administrator   add RoadToCategor...
10
          public string filter {get; set;}
8940e931   Administrator   add default sort
11
12
13
14
15
16
17
18
19
20
21
          public int perPage{
              get{
                  if(per_page == 0){
                      return 25;
                  }
                  return per_page;
              } 
              set{
                  per_page = value;
              } 
          }
db607025   Administrator   add pagination
22
          public string orderType(){
f89dc177   Administrator   add upper case in...
23
24
25
26
27
28
29
30
31
32
              string orderType = null;
              if(sort != null){
                 if(sort.StartsWith("-")){
                      sort = sort.Substring(1);
                      orderType = DESC;
                  } else {
                      orderType = ASC;
                  }
                  
                  sort = char.ToUpper(sort[0]) + sort.Substring(1);
db607025   Administrator   add pagination
33
              }
f89dc177   Administrator   add upper case in...
34
35
              
              return orderType;
db607025   Administrator   add pagination
36
37
38
          }
      }
  }