protected function lstManufacturerCustomFieldHelper_Create() { $this->lstManufacturerCustomFieldHelper = new QListBox($this); $this->lstManufacturerCustomFieldHelper->Name = QApplication::Translate('Manufacturer Custom Field Helper'); $this->lstManufacturerCustomFieldHelper->AddItem(QApplication::Translate('- Select One -'), null); $objManufacturerCustomFieldHelperArray = ManufacturerCustomFieldHelper::LoadAll(); if ($objManufacturerCustomFieldHelperArray) { foreach ($objManufacturerCustomFieldHelperArray as $objManufacturerCustomFieldHelper) { $objListItem = new QListItem($objManufacturerCustomFieldHelper->__toString(), $objManufacturerCustomFieldHelper->ManufacturerId); if ($objManufacturerCustomFieldHelper->ManufacturerId == $this->objManufacturer->ManufacturerId) { $objListItem->Selected = true; } $this->lstManufacturerCustomFieldHelper->AddItem($objListItem); } } // Because ManufacturerCustomFieldHelper's ManufacturerCustomFieldHelper is not null, if a value is already selected, it cannot be changed. if ($this->lstManufacturerCustomFieldHelper->SelectedValue) { $this->lstManufacturerCustomFieldHelper->Enabled = false; } }
/** * Refresh this MetaControl with Data from the local Manufacturer object. * @param boolean $blnReload reload Manufacturer from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objManufacturer->Reload(); } if ($this->lblManufacturerId) { if ($this->blnEditMode) { $this->lblManufacturerId->Text = $this->objManufacturer->ManufacturerId; } } if ($this->txtShortDescription) { $this->txtShortDescription->Text = $this->objManufacturer->ShortDescription; } if ($this->lblShortDescription) { $this->lblShortDescription->Text = $this->objManufacturer->ShortDescription; } if ($this->txtLongDescription) { $this->txtLongDescription->Text = $this->objManufacturer->LongDescription; } if ($this->lblLongDescription) { $this->lblLongDescription->Text = $this->objManufacturer->LongDescription; } if ($this->txtImagePath) { $this->txtImagePath->Text = $this->objManufacturer->ImagePath; } if ($this->lblImagePath) { $this->lblImagePath->Text = $this->objManufacturer->ImagePath; } if ($this->lstCreatedByObject) { $this->lstCreatedByObject->RemoveAllItems(); $this->lstCreatedByObject->AddItem(QApplication::Translate('- Select One -'), null); $objCreatedByObjectArray = UserAccount::LoadAll(); if ($objCreatedByObjectArray) { foreach ($objCreatedByObjectArray as $objCreatedByObject) { $objListItem = new QListItem($objCreatedByObject->__toString(), $objCreatedByObject->UserAccountId); if ($this->objManufacturer->CreatedByObject && $this->objManufacturer->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objManufacturer->CreatedByObject ? $this->objManufacturer->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objManufacturer->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objManufacturer->CreationDate) ? $this->objManufacturer->__toString($this->strCreationDateDateTimeFormat) : null; } if ($this->lstModifiedByObject) { $this->lstModifiedByObject->RemoveAllItems(); $this->lstModifiedByObject->AddItem(QApplication::Translate('- Select One -'), null); $objModifiedByObjectArray = UserAccount::LoadAll(); if ($objModifiedByObjectArray) { foreach ($objModifiedByObjectArray as $objModifiedByObject) { $objListItem = new QListItem($objModifiedByObject->__toString(), $objModifiedByObject->UserAccountId); if ($this->objManufacturer->ModifiedByObject && $this->objManufacturer->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objManufacturer->ModifiedByObject ? $this->objManufacturer->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objManufacturer->ModifiedDate; } } if ($this->lstManufacturerCustomFieldHelper) { $this->lstManufacturerCustomFieldHelper->RemoveAllItems(); $this->lstManufacturerCustomFieldHelper->AddItem(QApplication::Translate('- Select One -'), null); $objManufacturerCustomFieldHelperArray = ManufacturerCustomFieldHelper::LoadAll(); if ($objManufacturerCustomFieldHelperArray) { foreach ($objManufacturerCustomFieldHelperArray as $objManufacturerCustomFieldHelper) { $objListItem = new QListItem($objManufacturerCustomFieldHelper->__toString(), $objManufacturerCustomFieldHelper->ManufacturerId); if ($objManufacturerCustomFieldHelper->ManufacturerId == $this->objManufacturer->ManufacturerId) { $objListItem->Selected = true; } $this->lstManufacturerCustomFieldHelper->AddItem($objListItem); } } // Because ManufacturerCustomFieldHelper's ManufacturerCustomFieldHelper is not null, if a value is already selected, it cannot be changed. if ($this->lstManufacturerCustomFieldHelper->SelectedValue) { $this->lstManufacturerCustomFieldHelper->Enabled = false; } else { $this->lstManufacturerCustomFieldHelper->Enabled = true; } } if ($this->lblManufacturerCustomFieldHelper) { $this->lblManufacturerCustomFieldHelper->Text = $this->objManufacturer->ManufacturerCustomFieldHelper ? $this->objManufacturer->ManufacturerCustomFieldHelper->__toString() : null; } }