protected function SetupFedexServiceType() { // Lookup Object PK information from Query String (if applicable) // Set mode to Edit or New depending on what's found $intFedexServiceTypeId = QApplication::QueryString('intFedexServiceTypeId'); if ($intFedexServiceTypeId) { $this->objFedexServiceType = FedexServiceType::Load($intFedexServiceTypeId); if (!$this->objFedexServiceType) { throw new Exception('Could not find a FedexServiceType object with PK arguments: ' . $intFedexServiceTypeId); } $this->strTitleVerb = QApplication::Translate('Edit'); $this->blnEditMode = true; } else { $this->objFedexServiceType = new FedexServiceType(); $this->strTitleVerb = QApplication::Translate('Create'); $this->blnEditMode = false; } }
protected function dtgFedexServiceType_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->dtgFedexServiceType->TotalItemCount = FedexServiceType::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->dtgFedexServiceType->OrderByClause) { array_push($objClauses, $objClause); } // Add the LimitClause information, as well if ($objClause = $this->dtgFedexServiceType->LimitClause) { array_push($objClauses, $objClause); } // Set the DataSource to be the array of all FedexServiceType objects, given the clauses above $this->dtgFedexServiceType->DataSource = FedexServiceType::LoadAll($objClauses); }
protected function lstFedexServiceType_Create() { $this->lstFedexServiceType = new QListBox($this); $this->lstFedexServiceType->Name = QApplication::Translate('Fedex Service Type'); $this->lstFedexServiceType->AddItem(QApplication::Translate('- Select One -'), null); $objFedexServiceTypeArray = FedexServiceType::LoadAll(); if ($objFedexServiceTypeArray) { foreach ($objFedexServiceTypeArray as $objFedexServiceType) { $objListItem = new QListItem($objFedexServiceType->__toString(), $objFedexServiceType->FedexServiceTypeId); if ($this->objFedexShipment->FedexServiceType && $this->objFedexShipment->FedexServiceType->FedexServiceTypeId == $objFedexServiceType->FedexServiceTypeId) { $objListItem->Selected = true; } $this->lstFedexServiceType->AddItem($objListItem); } } }
public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects) { if ($objObject->objShipment) { $objObject->objShipment = Shipment::GetSoapObjectFromObject($objObject->objShipment, false); } else { if (!$blnBindRelatedObjects) { $objObject->intShipmentId = null; } } if ($objObject->objPackageType) { $objObject->objPackageType = PackageType::GetSoapObjectFromObject($objObject->objPackageType, false); } else { if (!$blnBindRelatedObjects) { $objObject->intPackageTypeId = null; } } if ($objObject->objShippingAccount) { $objObject->objShippingAccount = ShippingAccount::GetSoapObjectFromObject($objObject->objShippingAccount, false); } else { if (!$blnBindRelatedObjects) { $objObject->intShippingAccountId = null; } } if ($objObject->objFedexServiceType) { $objObject->objFedexServiceType = FedexServiceType::GetSoapObjectFromObject($objObject->objFedexServiceType, false); } else { if (!$blnBindRelatedObjects) { $objObject->intFedexServiceTypeId = null; } } if ($objObject->objCurrencyUnit) { $objObject->objCurrencyUnit = CurrencyUnit::GetSoapObjectFromObject($objObject->objCurrencyUnit, false); } else { if (!$blnBindRelatedObjects) { $objObject->intCurrencyUnitId = null; } } if ($objObject->objWeightUnit) { $objObject->objWeightUnit = WeightUnit::GetSoapObjectFromObject($objObject->objWeightUnit, false); } else { if (!$blnBindRelatedObjects) { $objObject->intWeightUnitId = null; } } if ($objObject->objLengthUnit) { $objObject->objLengthUnit = LengthUnit::GetSoapObjectFromObject($objObject->objLengthUnit, false); } else { if (!$blnBindRelatedObjects) { $objObject->intLengthUnitId = null; } } if ($objObject->objHoldAtLocationStateObject) { $objObject->objHoldAtLocationStateObject = StateProvince::GetSoapObjectFromObject($objObject->objHoldAtLocationStateObject, false); } else { if (!$blnBindRelatedObjects) { $objObject->intHoldAtLocationState = null; } } return $objObject; }
public function dtgFedexServiceType_Bind() { // Get Total Count b/c of Pagination $this->dtgFedexServiceType->TotalItemCount = FedexServiceType::CountAll(); $objClauses = array(); if ($objClause = $this->dtgFedexServiceType->OrderByClause) { array_push($objClauses, $objClause); } if ($objClause = $this->dtgFedexServiceType->LimitClause) { array_push($objClauses, $objClause); } $this->dtgFedexServiceType->DataSource = FedexServiceType::LoadAll($objClauses); }
protected function lstFxServiceType_Update() { $this->lstFxServiceType->RemoveAllItems(); $this->lstFxServiceType->Enabled = false; $this->lstFxServiceType->Required = false; if ($this->lstCourier->SelectedValue == 1 && $this->lstToAddress->SelectedValue && $this->lstFromAddress->SelectedValue && $this->lstShippingAccount->SelectedValue) { $this->lstFxServiceType->Enabled = true; $this->lstFxServiceType->Required = true; $this->lstFxServiceType->AddItem('- Select One -', null); $objFedexServiceTypeArr = FedexServiceType::LoadAll(QQ::Clause(QQ::OrderBy(QQN::FedexServiceType()->ShortDescription))); if ($objFedexServiceTypeArr) { foreach ($objFedexServiceTypeArr as $objFedexServiceType) { $objListItem = new QListItem($objFedexServiceType->ShortDescription, $objFedexServiceType->FedexServiceTypeId); if ($this->objShipment->FedexServiceTypeId == $objFedexServiceType->FedexServiceTypeId) { $objListItem->Selected = true; } $this->lstFxServiceType->AddItem($objListItem); } } } }
public static function GetSoapArrayFromArray($objArray) { if (!$objArray) { return null; } $objArrayToReturn = array(); foreach ($objArray as $objObject) { array_push($objArrayToReturn, FedexServiceType::GetSoapObjectFromObject($objObject, true)); } return unserialize(serialize($objArrayToReturn)); }