protected function CreateControlsForAttributes() { $this->txtAttributePreviousChurch = new QTextBox($this); $this->txtAttributePreviousChurch->Name = 'Previous Church'; $this->txtAttributeOccupation = new QTextBox($this); $this->txtAttributeOccupation->Name = 'Occupation'; $this->lstAttributeMethodJoin = new QListBox($this); $this->lstAttributeMethodJoin->Name = 'Method of Joining ALCF'; $this->lstAttributeMethodJoin->AddItem('- Select One -', null); $objAttribute = Attribute::QuerySingle(QQ::Equal(QQN::Attribute()->Name, "Method of Joining ALCF")); $attributeOptionArray = AttributeOption::LoadArrayByAttributeId($objAttribute->Id); foreach ($attributeOptionArray as $objAttributeOption) { $this->lstAttributeMethodJoin->AddItem($objAttributeOption->Name, $objAttributeOption->Id); } $this->lstAttributeEthnicity = new QListBox($this); $this->lstAttributeEthnicity->Name = 'Ethnicity'; $this->lstAttributeEthnicity->AddItem('- Select One -', null); $objAttribute = Attribute::QuerySingle(QQ::Equal(QQN::Attribute()->Name, "Ethnicity")); $attributeOptionArray = AttributeOption::LoadArrayByAttributeId($objAttribute->Id); foreach ($attributeOptionArray as $objAttributeOption) { $this->lstAttributeEthnicity->AddItem($objAttributeOption->Name, $objAttributeOption->Id); } $this->dtxAttributeDateAcceptedChrist = new QDateTimeTextBox($this); $this->dtxAttributeDateAcceptedChrist->Name = 'Date Accepted Christ'; $this->calAttributeDateAcceptedChrist = new QCalendar($this, $this->dtxAttributeDateAcceptedChrist); $this->chkAcceptedChristAtALCF = new QCheckBox($this); $this->chkAcceptedChristAtALCF->Name = 'Accepted Christ at ALCF?'; $this->chkAcceptedChristAtALCF->Text = 'Click if this person accepted Christ at ALCF'; }
/** * Deletes all associated AttributeOptions * @return void */ public function DeleteAllAttributeOptions() { if (is_null($this->intId)) { throw new QUndefinedPrimaryKeyException('Unable to call UnassociateAttributeOption on this unsaved Attribute.'); } // Get the Database Object for this Class $objDatabase = Attribute::GetDatabase(); // Journaling if ($objDatabase->JournalingDatabase) { foreach (AttributeOption::LoadArrayByAttributeId($this->intId) as $objAttributeOption) { $objAttributeOption->Journal('DELETE'); } } // Perform the SQL Query $objDatabase->NonQuery(' DELETE FROM `attribute_option` WHERE `attribute_id` = ' . $objDatabase->SqlVariable($this->intId) . ' '); }