protected function dtgCurrencyUnit_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->dtgCurrencyUnit->TotalItemCount = CurrencyUnit::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->dtgCurrencyUnit->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     // Add the LimitClause information, as well
     if ($objClause = $this->dtgCurrencyUnit->LimitClause) {
         array_push($objClauses, $objClause);
     }
     // Set the DataSource to be the array of all CurrencyUnit objects, given the clauses above
     $this->dtgCurrencyUnit->DataSource = CurrencyUnit::LoadAll($objClauses);
 }
 protected function lstCurrencyUnit_Create()
 {
     $this->lstCurrencyUnit = new QListBox($this);
     $this->lstCurrencyUnit->Name = QApplication::Translate('Currency Unit');
     $this->lstCurrencyUnit->AddItem(QApplication::Translate('- Select One -'), null);
     $objCurrencyUnitArray = CurrencyUnit::LoadAll();
     if ($objCurrencyUnitArray) {
         foreach ($objCurrencyUnitArray as $objCurrencyUnit) {
             $objListItem = new QListItem($objCurrencyUnit->__toString(), $objCurrencyUnit->CurrencyUnitId);
             if ($this->objFedexShipment->CurrencyUnit && $this->objFedexShipment->CurrencyUnit->CurrencyUnitId == $objCurrencyUnit->CurrencyUnitId) {
                 $objListItem->Selected = true;
             }
             $this->lstCurrencyUnit->AddItem($objListItem);
         }
     }
 }
示例#3
0
 protected function lstCurrencyUnit_Create()
 {
     $this->lstCurrencyUnit = new QListBox($this->pnlFedExShipment);
     $this->lstCurrencyUnit->Name = QApplication::Translate('Currency Unit');
     //$this->lstCurrencyUnit->AddItem('- Select One -', null);
     $objCurrencyUnitArray = CurrencyUnit::LoadAll(QQ::Clause(QQ::OrderBy(QQN::CurrencyUnit()->ShortDescription)));
     if ($objCurrencyUnitArray) {
         foreach ($objCurrencyUnitArray as $objCurrencyUnit) {
             $objListItem = new QListItem($objCurrencyUnit->__toString(), $objCurrencyUnit->CurrencyUnitId);
             if ($this->blnEditMode && $this->objFedexShipment && $this->objFedexShipment->CurrencyUnit && $this->objFedexShipment->CurrencyUnit->CurrencyUnitId == $objCurrencyUnit->CurrencyUnitId) {
                 $objListItem->Selected = true;
             } else {
                 if (!$this->objFedexShipment && $objCurrencyUnit->CurrencyUnitId === 1) {
                     $objListItem->Selected = true;
                 }
             }
             $this->lstCurrencyUnit->AddItem($objListItem);
         }
     }
     $this->lstCurrencyUnit->SetCustomStyle('Width', '60px');
     $this->lstCurrencyUnit->TabIndex = 25;
 }
 public function dtgCurrencyUnit_Bind()
 {
     // Get Total Count b/c of Pagination
     $this->dtgCurrencyUnit->TotalItemCount = CurrencyUnit::CountAll();
     $objClauses = array();
     if ($objClause = $this->dtgCurrencyUnit->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     if ($objClause = $this->dtgCurrencyUnit->LimitClause) {
         array_push($objClauses, $objClause);
     }
     $this->dtgCurrencyUnit->DataSource = CurrencyUnit::LoadAll($objClauses);
 }