function FindAllCustomersPaged(page, pageSize) {
     var itemCount = 0;
     var customerPage = [];
     var intPage = parseInt(page, 10);
     var intPageSize = parseInt(pageSize, 10);
     if (intPageSize > customers.length)
          intPageSize = customers.length;
     var start = (intPage - 1) * intPageSize;
     customers = lodash.orderBy(customers, [orderBy], [direction]);
     itemCount = start + intPageSize;
     if (itemCount > customers.length)
          itemCount = customers.length;

     if (start > -1) {
          for (var idx = start; idx < itemCount; idx++)
               customerPage.push(customers[idx]);
     }
     return { customers: customerPage, totalItems: customers.length };
}
//function FindAllCustomersPaged(page, pageSize, orderBy, direction) {
function FindAllCustomersPaged(page, pageSize, orderBy, direction) {
function FindAllCustomersPaged ( page pageSize orderBy direction ) {
function FindAllCustomersPaged(page, pageSize) {
     var itemCount = 0;
     var customerPage = [];
     var intPage = parseInt(page, 10);
     var intPageSize = parseInt(pageSize, 10);
     if (intPageSize > customers.length)
          intPageSize = customers.length;
     var start = (intPage - 1) * intPageSize;
     customers = lodash.orderBy(customers, [orderBy], [direction]);
     itemCount = start + intPageSize;
     if (itemCount > customers.length)
          itemCount = customers.length;
     if (start > -1) {
          for (var idx = start; idx < itemCount; idx++)
               customerPage.push(customers[idx]);
     }
     return { customers: customerPage, totalItems: customers.length };
}
function FindAllCustomersPaged ( page , pageSize ) { var itemCount = 0 ; var customerPage = [ ] ; var intPage = parseInt ( page , 10 ) ; var intPageSize = parseInt ( pageSize , 10 ) ; if ( intPageSize > customers . length ) intPageSize = customers . length ; var start = ( intPage - 1 ) * intPageSize ; customers = lodash . orderBy ( customers , [ orderBy ] , [ direction ] ) ; itemCount = start + intPageSize ; if ( itemCount > customers . length ) itemCount = customers . length ; if ( start > - 1 ) { for ( var idx = start ; idx < itemCount ; idx ++ ) customerPage . push ( customers [ idx ] ) ; } return { customers : customerPage , totalItems : customers . length } ; }
function FindAllCustomersPaged(page, pageSize, orderBy, direction) {
function FindAllCustomersPaged ( page pageSize orderBy direction ) {