/**
  * @param mixed $currentPageNumber
  * @param Dataset $dataset
  */
 function ApplyPageToDataset($currentPageNumber, Dataset $dataset)
 {
     if (!isset($currentPageNumber) || $currentPageNumber == '') {
         $this->FillUserPartitions();
         $userPartitionsKeys = array_keys($this->userPartitions);
         if ($this->GetAllowViewAllRecords()) {
             $currentPageNumber = null;
         } else {
             $currentPageNumber = $userPartitionsKeys[0];
         }
     }
     if (isset($currentPageNumber)) {
         $condition = $this->DoOnGetPartitionCondition($currentPageNumber);
         if (isset($condition) && $condition != '') {
             $dataset->AddCustomCondition($condition);
         }
     }
 }