/** * Refresh this MetaControl with Data from the local ParentPagerChildHistory object. * @param boolean $blnReload reload ParentPagerChildHistory from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objParentPagerChildHistory->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objParentPagerChildHistory->Id; } } if ($this->txtServerIdentifier) { $this->txtServerIdentifier->Text = $this->objParentPagerChildHistory->ServerIdentifier; } if ($this->lblServerIdentifier) { $this->lblServerIdentifier->Text = $this->objParentPagerChildHistory->ServerIdentifier; } if ($this->lstParentPagerIndividual) { $this->lstParentPagerIndividual->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstParentPagerIndividual->AddItem(QApplication::Translate('- Select One -'), null); } $objParentPagerIndividualArray = ParentPagerIndividual::LoadAll(); if ($objParentPagerIndividualArray) { foreach ($objParentPagerIndividualArray as $objParentPagerIndividual) { $objListItem = new QListItem($objParentPagerIndividual->__toString(), $objParentPagerIndividual->Id); if ($this->objParentPagerChildHistory->ParentPagerIndividual && $this->objParentPagerChildHistory->ParentPagerIndividual->Id == $objParentPagerIndividual->Id) { $objListItem->Selected = true; } $this->lstParentPagerIndividual->AddItem($objListItem); } } } if ($this->lblParentPagerIndividualId) { $this->lblParentPagerIndividualId->Text = $this->objParentPagerChildHistory->ParentPagerIndividual ? $this->objParentPagerChildHistory->ParentPagerIndividual->__toString() : null; } if ($this->lstParentPagerStation) { $this->lstParentPagerStation->RemoveAllItems(); $this->lstParentPagerStation->AddItem(QApplication::Translate('- Select One -'), null); $objParentPagerStationArray = ParentPagerStation::LoadAll(); if ($objParentPagerStationArray) { foreach ($objParentPagerStationArray as $objParentPagerStation) { $objListItem = new QListItem($objParentPagerStation->__toString(), $objParentPagerStation->Id); if ($this->objParentPagerChildHistory->ParentPagerStation && $this->objParentPagerChildHistory->ParentPagerStation->Id == $objParentPagerStation->Id) { $objListItem->Selected = true; } $this->lstParentPagerStation->AddItem($objListItem); } } } if ($this->lblParentPagerStationId) { $this->lblParentPagerStationId->Text = $this->objParentPagerChildHistory->ParentPagerStation ? $this->objParentPagerChildHistory->ParentPagerStation->__toString() : null; } if ($this->lstParentPagerPeriod) { $this->lstParentPagerPeriod->RemoveAllItems(); $this->lstParentPagerPeriod->AddItem(QApplication::Translate('- Select One -'), null); $objParentPagerPeriodArray = ParentPagerPeriod::LoadAll(); if ($objParentPagerPeriodArray) { foreach ($objParentPagerPeriodArray as $objParentPagerPeriod) { $objListItem = new QListItem($objParentPagerPeriod->__toString(), $objParentPagerPeriod->Id); if ($this->objParentPagerChildHistory->ParentPagerPeriod && $this->objParentPagerChildHistory->ParentPagerPeriod->Id == $objParentPagerPeriod->Id) { $objListItem->Selected = true; } $this->lstParentPagerPeriod->AddItem($objListItem); } } } if ($this->lblParentPagerPeriodId) { $this->lblParentPagerPeriodId->Text = $this->objParentPagerChildHistory->ParentPagerPeriod ? $this->objParentPagerChildHistory->ParentPagerPeriod->__toString() : null; } if ($this->lstDropoffByParentPagerIndividual) { $this->lstDropoffByParentPagerIndividual->RemoveAllItems(); $this->lstDropoffByParentPagerIndividual->AddItem(QApplication::Translate('- Select One -'), null); $objDropoffByParentPagerIndividualArray = ParentPagerIndividual::LoadAll(); if ($objDropoffByParentPagerIndividualArray) { foreach ($objDropoffByParentPagerIndividualArray as $objDropoffByParentPagerIndividual) { $objListItem = new QListItem($objDropoffByParentPagerIndividual->__toString(), $objDropoffByParentPagerIndividual->Id); if ($this->objParentPagerChildHistory->DropoffByParentPagerIndividual && $this->objParentPagerChildHistory->DropoffByParentPagerIndividual->Id == $objDropoffByParentPagerIndividual->Id) { $objListItem->Selected = true; } $this->lstDropoffByParentPagerIndividual->AddItem($objListItem); } } } if ($this->lblDropoffByParentPagerIndividualId) { $this->lblDropoffByParentPagerIndividualId->Text = $this->objParentPagerChildHistory->DropoffByParentPagerIndividual ? $this->objParentPagerChildHistory->DropoffByParentPagerIndividual->__toString() : null; } if ($this->lstPickupByParentPagerIndividual) { $this->lstPickupByParentPagerIndividual->RemoveAllItems(); $this->lstPickupByParentPagerIndividual->AddItem(QApplication::Translate('- Select One -'), null); $objPickupByParentPagerIndividualArray = ParentPagerIndividual::LoadAll(); if ($objPickupByParentPagerIndividualArray) { foreach ($objPickupByParentPagerIndividualArray as $objPickupByParentPagerIndividual) { $objListItem = new QListItem($objPickupByParentPagerIndividual->__toString(), $objPickupByParentPagerIndividual->Id); if ($this->objParentPagerChildHistory->PickupByParentPagerIndividual && $this->objParentPagerChildHistory->PickupByParentPagerIndividual->Id == $objPickupByParentPagerIndividual->Id) { $objListItem->Selected = true; } $this->lstPickupByParentPagerIndividual->AddItem($objListItem); } } } if ($this->lblPickupByParentPagerIndividualId) { $this->lblPickupByParentPagerIndividualId->Text = $this->objParentPagerChildHistory->PickupByParentPagerIndividual ? $this->objParentPagerChildHistory->PickupByParentPagerIndividual->__toString() : null; } if ($this->calDateIn) { $this->calDateIn->DateTime = $this->objParentPagerChildHistory->DateIn; } if ($this->lblDateIn) { $this->lblDateIn->Text = sprintf($this->objParentPagerChildHistory->DateIn) ? $this->objParentPagerChildHistory->__toString($this->strDateInDateTimeFormat) : null; } if ($this->calDateOut) { $this->calDateOut->DateTime = $this->objParentPagerChildHistory->DateOut; } if ($this->lblDateOut) { $this->lblDateOut->Text = sprintf($this->objParentPagerChildHistory->DateOut) ? $this->objParentPagerChildHistory->__toString($this->strDateOutDateTimeFormat) : null; } }