/** * Refresh this MetaControl with Data from the local SignupProduct object. * @param boolean $blnReload reload SignupProduct from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objSignupProduct->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objSignupProduct->Id; } } if ($this->lstSignupEntry) { $this->lstSignupEntry->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstSignupEntry->AddItem(QApplication::Translate('- Select One -'), null); } $objSignupEntryArray = SignupEntry::LoadAll(); if ($objSignupEntryArray) { foreach ($objSignupEntryArray as $objSignupEntry) { $objListItem = new QListItem($objSignupEntry->__toString(), $objSignupEntry->Id); if ($this->objSignupProduct->SignupEntry && $this->objSignupProduct->SignupEntry->Id == $objSignupEntry->Id) { $objListItem->Selected = true; } $this->lstSignupEntry->AddItem($objListItem); } } } if ($this->lblSignupEntryId) { $this->lblSignupEntryId->Text = $this->objSignupProduct->SignupEntry ? $this->objSignupProduct->SignupEntry->__toString() : null; } if ($this->lstFormProduct) { $this->lstFormProduct->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstFormProduct->AddItem(QApplication::Translate('- Select One -'), null); } $objFormProductArray = FormProduct::LoadAll(); if ($objFormProductArray) { foreach ($objFormProductArray as $objFormProduct) { $objListItem = new QListItem($objFormProduct->__toString(), $objFormProduct->Id); if ($this->objSignupProduct->FormProduct && $this->objSignupProduct->FormProduct->Id == $objFormProduct->Id) { $objListItem->Selected = true; } $this->lstFormProduct->AddItem($objListItem); } } } if ($this->lblFormProductId) { $this->lblFormProductId->Text = $this->objSignupProduct->FormProduct ? $this->objSignupProduct->FormProduct->__toString() : null; } if ($this->txtQuantity) { $this->txtQuantity->Text = $this->objSignupProduct->Quantity; } if ($this->lblQuantity) { $this->lblQuantity->Text = $this->objSignupProduct->Quantity; } if ($this->txtAmount) { $this->txtAmount->Text = $this->objSignupProduct->Amount; } if ($this->lblAmount) { $this->lblAmount->Text = $this->objSignupProduct->Amount; } if ($this->txtDeposit) { $this->txtDeposit->Text = $this->objSignupProduct->Deposit; } if ($this->lblDeposit) { $this->lblDeposit->Text = $this->objSignupProduct->Deposit; } }