Пример #1
0
 protected function Form_PreRender()
 {
     $objExpansionMap[ShippingAccount::ExpandCourier] = true;
     // Get Total Count b/c of Pagination
     $this->dtgShippingAccount->TotalItemCount = ShippingAccount::CountAll();
     if ($this->dtgShippingAccount->TotalItemCount == 0) {
         $this->dtgShippingAccount->ShowHeader = false;
     } else {
         $objClauses = array();
         if ($objClause = $this->dtgShippingAccount->OrderByClause) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = $this->dtgShippingAccount->LimitClause) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = QQ::Expand(QQN::ShippingAccount()->Courier)) {
             array_push($objClauses, $objClause);
         }
         $this->dtgShippingAccount->DataSource = ShippingAccount::LoadAll($objClauses);
         $this->dtgShippingAccount->ShowHeader = true;
     }
     $this->dtgCourier->TotalItemCount = Courier::CountAll();
     if ($this->dtgCourier->TotalItemCount == 0) {
         $this->dtgCourier->ShowHeader = false;
     } else {
         $objClauses = array();
         if ($objClause = $this->dtgCourier->OrderByClause) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = $this->dtgCourier->LimitClause) {
             array_push($objClauses, $objClause);
         }
         $this->dtgCourier->DataSource = Courier::LoadAll($objClauses);
         $this->dtgCourier->ShowHeader = true;
     }
 }
 protected function dtgShippingAccount_Bind()
 {
     // Because we want to enable pagination AND sorting, we need to setup the $objClauses array to send to LoadAll()
     // Remember!  We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below
     $this->dtgShippingAccount->TotalItemCount = ShippingAccount::CountAll();
     // Setup the $objClauses Array
     $objClauses = array();
     // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add
     // the OrderByClause to the $objClauses array
     if ($objClause = $this->dtgShippingAccount->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     // Add the LimitClause information, as well
     if ($objClause = $this->dtgShippingAccount->LimitClause) {
         array_push($objClauses, $objClause);
     }
     // Set the DataSource to be the array of all ShippingAccount objects, given the clauses above
     $this->dtgShippingAccount->DataSource = ShippingAccount::LoadAll($objClauses);
 }
 public function dtgShippingAccount_Bind()
 {
     // Get Total Count b/c of Pagination
     $this->dtgShippingAccount->TotalItemCount = ShippingAccount::CountAll();
     $objClauses = array();
     if ($objClause = $this->dtgShippingAccount->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     if ($objClause = $this->dtgShippingAccount->LimitClause) {
         array_push($objClauses, $objClause);
     }
     $this->dtgShippingAccount->DataSource = ShippingAccount::LoadAll($objClauses);
 }