protected function lstPackageType_Create() { $this->lstPackageType = new QListBox($this); $this->lstPackageType->Name = QApplication::Translate('Package Type'); $this->lstPackageType->AddItem(QApplication::Translate('- Select One -'), null); $objPackageTypeArray = PackageType::LoadAll(); if ($objPackageTypeArray) { foreach ($objPackageTypeArray as $objPackageType) { $objListItem = new QListItem($objPackageType->__toString(), $objPackageType->PackageTypeId); if ($this->objFedexShipment->PackageType && $this->objFedexShipment->PackageType->PackageTypeId == $objPackageType->PackageTypeId) { $objListItem->Selected = true; } $this->lstPackageType->AddItem($objListItem); } } }
protected function dtgPackageType_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->dtgPackageType->TotalItemCount = PackageType::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->dtgPackageType->OrderByClause) { array_push($objClauses, $objClause); } // Add the LimitClause information, as well if ($objClause = $this->dtgPackageType->LimitClause) { array_push($objClauses, $objClause); } // Set the DataSource to be the array of all PackageType objects, given the clauses above $this->dtgPackageType->DataSource = PackageType::LoadAll($objClauses); }
protected function LoadPackageTypes() { $this->lstPackageType->AddItem('- Select One -', null); $objPackageTypeArray = PackageType::LoadAll(QQ::Clause(QQ::OrderBy(QQN::PackageType()->ShortDescription))); if ($objPackageTypeArray) { foreach ($objPackageTypeArray as $objPackageType) { // FedexServiceTypeId 6 = 'FedEx Ground', PackageTypeId 1 = 'Other Packaging' // For FedEx Ground shipments, allow only 'Other Packaging' if ($this->lstFxServiceType->SelectedValue == 6 && $objPackageType->PackageTypeId !== 1) { continue; } $objListItem = new QListItem($objPackageType->__toString(), $objPackageType->PackageTypeId); if ($this->blnEditMode && $this->objFedexShipment && $this->objFedexShipment->PackageType && $this->objFedexShipment->PackageType->PackageTypeId == $objPackageType->PackageTypeId) { $objListItem->Selected = true; } $this->lstPackageType->AddItem($objListItem); } } }