protected function dtgLengthUnit_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->dtgLengthUnit->TotalItemCount = LengthUnit::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->dtgLengthUnit->OrderByClause) { array_push($objClauses, $objClause); } // Add the LimitClause information, as well if ($objClause = $this->dtgLengthUnit->LimitClause) { array_push($objClauses, $objClause); } // Set the DataSource to be the array of all LengthUnit objects, given the clauses above $this->dtgLengthUnit->DataSource = LengthUnit::LoadAll($objClauses); }
protected function lstLengthUnit_Create() { $this->lstLengthUnit = new QListBox($this); $this->lstLengthUnit->Name = QApplication::Translate('Length Unit'); $this->lstLengthUnit->AddItem(QApplication::Translate('- Select One -'), null); $objLengthUnitArray = LengthUnit::LoadAll(); if ($objLengthUnitArray) { foreach ($objLengthUnitArray as $objLengthUnit) { $objListItem = new QListItem($objLengthUnit->__toString(), $objLengthUnit->LengthUnitId); if ($this->objFedexShipment->LengthUnit && $this->objFedexShipment->LengthUnit->LengthUnitId == $objLengthUnit->LengthUnitId) { $objListItem->Selected = true; } $this->lstLengthUnit->AddItem($objListItem); } } }
public function dtgLengthUnit_Bind() { // Get Total Count b/c of Pagination $this->dtgLengthUnit->TotalItemCount = LengthUnit::CountAll(); $objClauses = array(); if ($objClause = $this->dtgLengthUnit->OrderByClause) { array_push($objClauses, $objClause); } if ($objClause = $this->dtgLengthUnit->LimitClause) { array_push($objClauses, $objClause); } $this->dtgLengthUnit->DataSource = LengthUnit::LoadAll($objClauses); }
protected function lstLengthUnit_Create() { $this->lstLengthUnit = new QListBox($this->pnlFedExShipment); $this->lstLengthUnit->Name = QApplication::Translate('Length Unit'); //$this->lstLengthUnit->AddItem('- Select One -', null); $objLengthUnitArray = LengthUnit::LoadAll(QQ::Clause(QQ::OrderBy(QQN::LengthUnit()->ShortDescription))); if ($objLengthUnitArray) { foreach ($objLengthUnitArray as $objLengthUnit) { $objListItem = new QListItem($objLengthUnit->__toString(), $objLengthUnit->LengthUnitId); if ($this->blnEditMode && $this->objFedexShipment && $this->objFedexShipment->LengthUnit && $this->objFedexShipment->LengthUnit->LengthUnitId == $objLengthUnit->LengthUnitId) { $objListItem->Selected = true; } else { if (!$this->objFedexShipment && $objLengthUnit->LengthUnitId === 1) { // Default to IN (LengthUnitId 1) $objListItem->Selected = true; } } $this->lstLengthUnit->AddItem($objListItem); } } $this->lstLengthUnit->SetCustomStyle('Width', '60px'); $this->lstLengthUnit->TabIndex = 23; }