protected function Form_Create() { // Define our Label $this->lblMessage = new QLabel($this); $this->lblMessage->Text = '<None>'; // Define the ListBox, and create the first listitem as 'Select One' $this->lstPersons = new QListBox($this); $this->lstPersons->AddItem('- Select One -', null); // Add the items for the listbox, pulling in from the Person table $objPersons = Person::LoadAll(QQ::Clause(QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName))); if ($objPersons) { foreach ($objPersons as $objPerson) { // We want to display the listitem as Last Name, First Name // and the VALUE of the listitem should be the person object itself $this->lstPersons->AddItem($objPerson->LastName . ', ' . $objPerson->FirstName, $objPerson); } } // Declare a QChangeEvent to call a server action: the lstPersons_Change PHP method $this->lstPersons->AddAction(new QChangeEvent(), new QServerAction('lstPersons_Change')); // Do the same but with a multiple selection QCheckboxList $this->chkPersons = new QCheckBoxList($this); if ($objPersons) { foreach ($objPersons as $objPerson) { // We want to display the listitem as Last Name, First Name // and the VALUE of the listitem will be the database id $this->chkPersons->AddItem($objPerson->FirstName . ' ' . $objPerson->LastName, $objPerson->Id); } } $this->chkPersons->RepeatColumns = 2; $this->chkPersons->AddAction(new QChangeEvent(), new QServerAction('chkPersons_Change')); }
public function testSelectSubsetInExpandAsArray() { $objPersonArray = Person::LoadAll(QQ::Clause(QQ::Select(QQN::Person()->FirstName), QQ::ExpandAsArray(QQN::Person()->Address, QQ::Select(QQN::Person()->Address->Street, QQN::Person()->Address->City)), QQ::ExpandAsArray(QQN::Person()->ProjectAsManager, QQ::Select(QQN::Person()->ProjectAsManager->StartDate)), QQ::ExpandAsArray(QQN::Person()->ProjectAsManager->Milestone, QQ::Select(QQN::Person()->ProjectAsManager->Milestone->Name)))); foreach ($objPersonArray as $objPerson) { $this->assertNull($objPerson->LastName, "LastName should be null, since it was not selected"); $this->assertNotNull($objPerson->Id, "Id should not be null since it's always added to the select list"); if (sizeof($objPerson->_AddressArray) > 0) { foreach ($objPerson->_AddressArray as $objAddress) { $this->assertNotNull($objAddress->Id, "Address->Id should not be null since it's always added to the select list"); $this->assertNull($objAddress->PersonId, "Address->PersonId should be null, since it was not selected"); } } if (sizeof($objPerson->_ProjectAsManagerArray) > 0) { foreach ($objPerson->_ProjectAsManagerArray as $objProject) { $this->assertNotNull($objProject->Id, "Project->Id should not be null since it's always added to the select list"); $this->assertNull($objProject->Name, "Project->Name should be null, since it was not selected"); if (sizeof($objProject->_MilestoneArray) > 0) { foreach ($objProject->_MilestoneArray as $objMilestone) { $this->assertNotNull($objMilestone->Id, "Milestone->Id should not be null since it's always added to the select list"); $this->assertNull($objMilestone->ProjectId, "Milestone->ProjectId should be null, since it was not selected"); } } } } } }
public function testMultiLevel() { $arrPeople = Person::LoadAll(QQ::Clause(QQ::ExpandAsArray(QQN::Person()->Address), QQ::ExpandAsArray(QQN::Person()->ProjectAsManager), QQ::ExpandAsArray(QQN::Person()->ProjectAsManager->Milestone))); $targetPerson = null; foreach ($arrPeople as $objPerson) { if ($objPerson->LastName == "Wolfe") { $targetPerson = $objPerson; } } $this->assertEqual(sizeof($arrPeople), 12); $this->assertNotEqual($targetPerson, null, "Karen Wolfe found"); $targetProject = null; foreach ($targetPerson->_ProjectAsManagerArray as $objProject) { if ($objProject->Name == "ACME Payment System") { $targetProject = $objProject; } } $this->assertEqual(sizeof($targetPerson->_ProjectAsManagerArray), 2, "2 projects found"); $this->assertNotEqual($targetProject, null, "ACME Payment System project found"); $targetMilestone = null; foreach ($targetProject->_MilestoneArray as $objMilestone) { if ($objMilestone->Name == "Milestone H") { $targetMilestone = $objMilestone; } } $this->assertEqual(sizeof($targetProject->_MilestoneArray), 4, "4 milestones found"); $this->assertNotEqual($targetMilestone, null, "Milestone H found"); }
protected function dtgPersons_Bind() { // We must first let the datagrid know how many total items there are $this->dtgPersons->TotalItemCount = Person::CountAll(); // Next, we must be sure to load the data source, passing in the datagrid's // limit info into our loadall method. $this->dtgPersons->DataSource = Person::LoadAll(QQ::Clause($this->dtgPersons->OrderByClause, $this->dtgPersons->LimitClause)); }
protected function dtgPersons_Bind() { // We must be sure to load the data source // Ask the datagrid for the sorting clause that corresponds to the currently active sort column. $clauses[] = $this->dtgPersons->OrderByClause; // Give that clause to our sql query so it returns sorted data $this->dtgPersons->DataSource = Person::LoadAll($clauses); }
protected function dtgPersons_Bind() { $objPersonArray = $this->dtgPersons->DataSource = Person::LoadAll(QQ::Clause($this->dtgPersons->OrderByClause, $this->dtgPersons->LimitClause)); // If we are editing someone new, we need to add a new (blank) person to the data source if ($this->intEditPersonId == -1) { array_push($objPersonArray, new Person()); } // Bind the datasource to the datagrid $this->dtgPersons->DataSource = $objPersonArray; }
protected function Go_Click() { QApplication::$blnLocalCache = false; $timeNoCache = -microtime(true); $a = Person::LoadAll(); // noncached loads $timeNoCache += microtime(true); QApplication::$blnLocalCache = true; $timeLoad1Cached = -microtime(true); $a = Person::LoadAll(); // noncached loads $timeLoad1Cached += microtime(true); $timeLoad2Cached = -microtime(true); $a = Person::LoadAll(); // cached loads $timeLoad2Cached += microtime(true); QApplication::$blnLocalCache = new QCacheProviderLocalMemory(array()); $timeLoad3Cached = -microtime(true); $a = Person::LoadAll(); // noncached loads $timeLoad3Cached += microtime(true); $timeLoad4Cached = -microtime(true); $a = Person::LoadAll(); // cached loads $timeLoad4Cached += microtime(true); $this->pnlTiny->Text = sprintf("Load No Cache: %2.1f%% \n", 100 * $timeNoCache / $timeNoCache) . sprintf("Populate Cache: %2.1f%% \n", 100 * $timeLoad1Cached / $timeNoCache) . sprintf("Load With Cache: %2.1f%% \n", 100 * $timeLoad2Cached / $timeNoCache) . sprintf("Populate LocalCacheProvider: %2.1f%% \n", 100 * $timeLoad3Cached / $timeNoCache) . sprintf("Load LocalCacheProvider: %2.1f%% \n", 100 * $timeLoad4Cached / $timeNoCache); $cond = QQ::Equal(QQN::Project()->ProjectStatusTypeId, ProjectStatusType::Open); $clauses[] = QQ::Expand(QQN::Project()->ManagerPerson); Project::ClearCache(); Person::ClearCache(); QApplication::$blnLocalCache = false; $timeNoCache = -microtime(true); $a = Project::QueryArray($cond, $clauses); // noncached loads $timeNoCache += microtime(true); QApplication::$blnLocalCache = true; $timeLoad1Cached = -microtime(true); $a = Project::QueryArray($cond, $clauses); // noncached loads $timeLoad1Cached += microtime(true); $timeLoad2Cached = -microtime(true); $a = Project::QueryArray($cond, $clauses); // cached loads $timeLoad2Cached += microtime(true); QApplication::$blnLocalCache = new QCacheProviderLocalMemory(array()); $timeLoad3Cached = -microtime(true); $a = Project::QueryArray($cond, $clauses); // noncached loads $timeLoad3Cached += microtime(true); $timeLoad4Cached = -microtime(true); $a = Project::QueryArray($cond, $clauses); // cached loads $timeLoad4Cached += microtime(true); $this->pnlBig->Text = sprintf("Load No Cache: %2.1f%% \n", 100 * $timeNoCache / $timeNoCache) . sprintf("Populate Cache: %2.1f%% \n", 100 * $timeLoad1Cached / $timeNoCache) . sprintf("Load With Cache: %2.1f%% \n", 100 * $timeLoad2Cached / $timeNoCache) . sprintf("Populate LocalCacheProvider: %2.1f%% \n", 100 * $timeLoad3Cached / $timeNoCache) . sprintf("Load LocalCacheProvider: %2.1f%% \n", 100 * $timeLoad4Cached / $timeNoCache); }
protected function dtgPersons_Bind() { // We must first let the datagrid know how many total items there are // IMPORTANT: Do not pass a limit clause here to CountAll $this->dtgPersons->TotalItemCount = Person::CountAll(); // Ask the datagrid for the sorting information for the currently active sort column $clauses[] = $this->dtgPersons->OrderByClause; // Ask the datagrid for the Limit clause that will limit what portion of the data we will get from the database $clauses[] = $this->dtgPersons->LimitClause; // Next, we must be sure to load the data source, passing in the datagrid's // limit info into our loadall method. $this->dtgPersons->DataSource = Person::LoadAll($clauses); }
?> <br/> Project End Date: <?php _p($objProject->EndDate); ?> <br/> Project Budget: <?php _p($objProject->Budget); ?> <br/> <h3>Using LoadAll to get an Array of Person Objects</h3> <?php // We'll load all the persons into an array $objPersonArray = Person::LoadAll(); // Use foreach to iterate through that array and output the first and last // name of each person foreach ($objPersonArray as $objPerson) { printf('• ' . $objPerson->FirstName . ' ' . $objPerson->LastName . '<br/>'); } ?> <h3>Using CountAll to get a Count of All Persons in the Database</h3> There are <?php _p(Person::CountAll()); ?> person(s) in the system. <?php
public function testQuerySelectSubsetSkipPK() { $objSelect = QQ::Select(QQN::Person()->FirstName); $objSelect->SetSkipPrimaryKey(true); $objPersonArray = Person::LoadAll($objSelect); foreach ($objPersonArray as $objPerson) { $this->assertNull($objPerson->LastName, "LastName should be null, since it was not selected"); $this->assertNull($objPerson->Id, "Id should be null since SkipPrimaryKey is set on the Select object"); } }
/** * Refresh this MetaControl with Data from the local WikiVersion object. * @param boolean $blnReload reload WikiVersion from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objWikiVersion->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objWikiVersion->Id; } } if ($this->lstWikiItem) { $this->lstWikiItem->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstWikiItem->AddItem(QApplication::Translate('- Select One -'), null); } $objWikiItemArray = WikiItem::LoadAll(); if ($objWikiItemArray) { foreach ($objWikiItemArray as $objWikiItem) { $objListItem = new QListItem($objWikiItem->__toString(), $objWikiItem->Id); if ($this->objWikiVersion->WikiItem && $this->objWikiVersion->WikiItem->Id == $objWikiItem->Id) { $objListItem->Selected = true; } $this->lstWikiItem->AddItem($objListItem); } } } if ($this->lblWikiItemId) { $this->lblWikiItemId->Text = $this->objWikiVersion->WikiItem ? $this->objWikiVersion->WikiItem->__toString() : null; } if ($this->txtVersionNumber) { $this->txtVersionNumber->Text = $this->objWikiVersion->VersionNumber; } if ($this->lblVersionNumber) { $this->lblVersionNumber->Text = $this->objWikiVersion->VersionNumber; } if ($this->txtName) { $this->txtName->Text = $this->objWikiVersion->Name; } if ($this->lblName) { $this->lblName->Text = $this->objWikiVersion->Name; } if ($this->lstPostedByPerson) { $this->lstPostedByPerson->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstPostedByPerson->AddItem(QApplication::Translate('- Select One -'), null); } $objPostedByPersonArray = Person::LoadAll(); if ($objPostedByPersonArray) { foreach ($objPostedByPersonArray as $objPostedByPerson) { $objListItem = new QListItem($objPostedByPerson->__toString(), $objPostedByPerson->Id); if ($this->objWikiVersion->PostedByPerson && $this->objWikiVersion->PostedByPerson->Id == $objPostedByPerson->Id) { $objListItem->Selected = true; } $this->lstPostedByPerson->AddItem($objListItem); } } } if ($this->lblPostedByPersonId) { $this->lblPostedByPersonId->Text = $this->objWikiVersion->PostedByPerson ? $this->objWikiVersion->PostedByPerson->__toString() : null; } if ($this->calPostDate) { $this->calPostDate->DateTime = $this->objWikiVersion->PostDate; } if ($this->lblPostDate) { $this->lblPostDate->Text = sprintf($this->objWikiVersion->PostDate) ? $this->objWikiVersion->__toString($this->strPostDateDateTimeFormat) : null; } if ($this->lstWikiFile) { $this->lstWikiFile->RemoveAllItems(); $this->lstWikiFile->AddItem(QApplication::Translate('- Select One -'), null); $objWikiFileArray = WikiFile::LoadAll(); if ($objWikiFileArray) { foreach ($objWikiFileArray as $objWikiFile) { $objListItem = new QListItem($objWikiFile->__toString(), $objWikiFile->WikiVersionId); if ($objWikiFile->WikiVersionId == $this->objWikiVersion->Id) { $objListItem->Selected = true; } $this->lstWikiFile->AddItem($objListItem); } } // Because WikiFile's WikiFile is not null, if a value is already selected, it cannot be changed. if ($this->lstWikiFile->SelectedValue) { $this->lstWikiFile->Enabled = false; } else { $this->lstWikiFile->Enabled = true; } } if ($this->lblWikiFile) { $this->lblWikiFile->Text = $this->objWikiVersion->WikiFile ? $this->objWikiVersion->WikiFile->__toString() : null; } if ($this->lstWikiImage) { $this->lstWikiImage->RemoveAllItems(); $this->lstWikiImage->AddItem(QApplication::Translate('- Select One -'), null); $objWikiImageArray = WikiImage::LoadAll(); if ($objWikiImageArray) { foreach ($objWikiImageArray as $objWikiImage) { $objListItem = new QListItem($objWikiImage->__toString(), $objWikiImage->WikiVersionId); if ($objWikiImage->WikiVersionId == $this->objWikiVersion->Id) { $objListItem->Selected = true; } $this->lstWikiImage->AddItem($objListItem); } } // Because WikiImage's WikiImage is not null, if a value is already selected, it cannot be changed. if ($this->lstWikiImage->SelectedValue) { $this->lstWikiImage->Enabled = false; } else { $this->lstWikiImage->Enabled = true; } } if ($this->lblWikiImage) { $this->lblWikiImage->Text = $this->objWikiVersion->WikiImage ? $this->objWikiVersion->WikiImage->__toString() : null; } if ($this->lstWikiItemAsCurrent) { $this->lstWikiItemAsCurrent->RemoveAllItems(); $this->lstWikiItemAsCurrent->AddItem(QApplication::Translate('- Select One -'), null); $objWikiItemArray = WikiItem::LoadAll(); if ($objWikiItemArray) { foreach ($objWikiItemArray as $objWikiItem) { $objListItem = new QListItem($objWikiItem->__toString(), $objWikiItem->Id); if ($objWikiItem->CurrentWikiVersionId == $this->objWikiVersion->Id) { $objListItem->Selected = true; } $this->lstWikiItemAsCurrent->AddItem($objListItem); } } } if ($this->lblWikiItemAsCurrent) { $this->lblWikiItemAsCurrent->Text = $this->objWikiVersion->WikiItemAsCurrent ? $this->objWikiVersion->WikiItemAsCurrent->__toString() : null; } if ($this->lstWikiPage) { $this->lstWikiPage->RemoveAllItems(); $this->lstWikiPage->AddItem(QApplication::Translate('- Select One -'), null); $objWikiPageArray = WikiPage::LoadAll(); if ($objWikiPageArray) { foreach ($objWikiPageArray as $objWikiPage) { $objListItem = new QListItem($objWikiPage->__toString(), $objWikiPage->WikiVersionId); if ($objWikiPage->WikiVersionId == $this->objWikiVersion->Id) { $objListItem->Selected = true; } $this->lstWikiPage->AddItem($objListItem); } } // Because WikiPage's WikiPage is not null, if a value is already selected, it cannot be changed. if ($this->lstWikiPage->SelectedValue) { $this->lstWikiPage->Enabled = false; } else { $this->lstWikiPage->Enabled = true; } } if ($this->lblWikiPage) { $this->lblWikiPage->Text = $this->objWikiVersion->WikiPage ? $this->objWikiVersion->WikiPage->__toString() : null; } }
protected function tblPersons_Bind() { // We load the data source, and set it to the datagrid's DataSource parameter $this->tblPersons->DataSource = Person::LoadAll(); }
public static function GenerateCommunicationLists() { $objPersonArray = Person::LoadAll(); while (QDataGen::DisplayWhileTask('Generating Communication Lists', self::CommunicationListCount, false)) { $objCommunicationList = new CommunicationList(); $objCommunicationList->EmailBroadcastTypeId = QDataGen::GenerateFromArray(array_keys(EmailBroadcastType::$NameArray)); $objCommunicationList->Ministry = QDataGen::GenerateFromArray(self::$MinistryArray); $objCommunicationList->Name = QDataGen::GenerateTitle(1, 4); $objCommunicationList->Token = strtolower(str_replace(' ', '_', $objCommunicationList->Name)); while (CommunicationList::LoadByToken($objCommunicationList->Token)) { $objCommunicationList->Name = QDataGen::GenerateTitle(1, 4); $objCommunicationList->Token = strtolower(str_replace(' ', '_', $objCommunicationList->Name)); } $objCommunicationList->Save(); $intCount = rand(5, 100); for ($i = 0; $i < $intCount; $i++) { if (rand(0, 3)) { $objPerson = QDataGen::GenerateFromArray($objPersonArray); while ($objCommunicationList->IsPersonAssociated($objPerson)) { $objPerson = QDataGen::GenerateFromArray($objPersonArray); } $objCommunicationList->AssociatePerson($objPerson); } else { $strFirstName = QDataGen::GenerateFirstName(); if (!rand(0, 5)) { $strMiddleName = QDataGen::GenerateMiddleInitial() . '.'; } else { $strMiddleName = null; } $strLastName = QDataGen::GenerateLastName(); $strEmail = QDataGen::GenerateEmail($strFirstName, $strLastName); $objCommunicationList->AddEntry($strEmail, $strFirstName, $strMiddleName, $strLastName); } } } }
As a final reminder, note that you can use either, both, more or none of these optional <b>QQClause</b> parameters whenever you make your <b>LoadAll</b> or <b>LoadArrayBy</b> calls. </div> <h3>List All the People, Ordered by Last Name then First Name</h3> <?php // Load the Person array, sorted $objPersonArray = Person::LoadAll(QQ::Clause(QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName))); foreach ($objPersonArray as $objPerson) { _p($objPerson->LastName . ', ' . $objPerson->FirstName . ' (ID #' . $objPerson->Id . ')'); _p('<br/>', false); } ?> <h3>List Five People, Start with the Third from the Top, Ordered by Last Name then First Name</h3> <?php // Load the Person array, sorted and limited // Note that because we want to start with row #3, we need to define "2" as the offset $objPersonArray = Person::LoadAll(QQ::Clause(QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName), QQ::LimitInfo(5, 2))); foreach ($objPersonArray as $objPerson) { _p($objPerson->LastName . ', ' . $objPerson->FirstName . ' (ID #' . $objPerson->Id . ')'); _p('<br/>', false); } ?> <?php require '../includes/footer.inc.php';
/** * Refresh this MetaControl with Data from the local Relationship object. * @param boolean $blnReload reload Relationship from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objRelationship->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objRelationship->Id; } } if ($this->lstPerson) { $this->lstPerson->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstPerson->AddItem(QApplication::Translate('- Select One -'), null); } $objPersonArray = Person::LoadAll(); if ($objPersonArray) { foreach ($objPersonArray as $objPerson) { $objListItem = new QListItem($objPerson->__toString(), $objPerson->Id); if ($this->objRelationship->Person && $this->objRelationship->Person->Id == $objPerson->Id) { $objListItem->Selected = true; } $this->lstPerson->AddItem($objListItem); } } } if ($this->lblPersonId) { $this->lblPersonId->Text = $this->objRelationship->Person ? $this->objRelationship->Person->__toString() : null; } if ($this->lstRelatedToPerson) { $this->lstRelatedToPerson->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstRelatedToPerson->AddItem(QApplication::Translate('- Select One -'), null); } $objRelatedToPersonArray = Person::LoadAll(); if ($objRelatedToPersonArray) { foreach ($objRelatedToPersonArray as $objRelatedToPerson) { $objListItem = new QListItem($objRelatedToPerson->__toString(), $objRelatedToPerson->Id); if ($this->objRelationship->RelatedToPerson && $this->objRelationship->RelatedToPerson->Id == $objRelatedToPerson->Id) { $objListItem->Selected = true; } $this->lstRelatedToPerson->AddItem($objListItem); } } } if ($this->lblRelatedToPersonId) { $this->lblRelatedToPersonId->Text = $this->objRelationship->RelatedToPerson ? $this->objRelationship->RelatedToPerson->__toString() : null; } if ($this->lstRelationshipType) { $this->lstRelationshipType->SelectedValue = $this->objRelationship->RelationshipTypeId; } if ($this->lblRelationshipTypeId) { $this->lblRelationshipTypeId->Text = $this->objRelationship->RelationshipTypeId ? RelationshipType::$NameArray[$this->objRelationship->RelationshipTypeId] : null; } }
/** * Refresh this MetaControl with Data from the local ParentPagerIndividual object. * @param boolean $blnReload reload ParentPagerIndividual from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objParentPagerIndividual->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objParentPagerIndividual->Id; } } if ($this->txtServerIdentifier) { $this->txtServerIdentifier->Text = $this->objParentPagerIndividual->ServerIdentifier; } if ($this->lblServerIdentifier) { $this->lblServerIdentifier->Text = $this->objParentPagerIndividual->ServerIdentifier; } if ($this->lstPerson) { $this->lstPerson->RemoveAllItems(); $this->lstPerson->AddItem(QApplication::Translate('- Select One -'), null); $objPersonArray = Person::LoadAll(); if ($objPersonArray) { foreach ($objPersonArray as $objPerson) { $objListItem = new QListItem($objPerson->__toString(), $objPerson->Id); if ($this->objParentPagerIndividual->Person && $this->objParentPagerIndividual->Person->Id == $objPerson->Id) { $objListItem->Selected = true; } $this->lstPerson->AddItem($objListItem); } } } if ($this->lblPersonId) { $this->lblPersonId->Text = $this->objParentPagerIndividual->Person ? $this->objParentPagerIndividual->Person->__toString() : null; } if ($this->chkHiddenFlag) { $this->chkHiddenFlag->Checked = $this->objParentPagerIndividual->HiddenFlag; } if ($this->lblHiddenFlag) { $this->lblHiddenFlag->Text = $this->objParentPagerIndividual->HiddenFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->lstParentPagerSyncStatusType) { $this->lstParentPagerSyncStatusType->SelectedValue = $this->objParentPagerIndividual->ParentPagerSyncStatusTypeId; } if ($this->lblParentPagerSyncStatusTypeId) { $this->lblParentPagerSyncStatusTypeId->Text = $this->objParentPagerIndividual->ParentPagerSyncStatusTypeId ? ParentPagerSyncStatusType::$NameArray[$this->objParentPagerIndividual->ParentPagerSyncStatusTypeId] : null; } if ($this->lstParentPagerHousehold) { $this->lstParentPagerHousehold->RemoveAllItems(); $this->lstParentPagerHousehold->AddItem(QApplication::Translate('- Select One -'), null); $objParentPagerHouseholdArray = ParentPagerHousehold::LoadAll(); if ($objParentPagerHouseholdArray) { foreach ($objParentPagerHouseholdArray as $objParentPagerHousehold) { $objListItem = new QListItem($objParentPagerHousehold->__toString(), $objParentPagerHousehold->Id); if ($this->objParentPagerIndividual->ParentPagerHousehold && $this->objParentPagerIndividual->ParentPagerHousehold->Id == $objParentPagerHousehold->Id) { $objListItem->Selected = true; } $this->lstParentPagerHousehold->AddItem($objListItem); } } } if ($this->lblParentPagerHouseholdId) { $this->lblParentPagerHouseholdId->Text = $this->objParentPagerIndividual->ParentPagerHousehold ? $this->objParentPagerIndividual->ParentPagerHousehold->__toString() : null; } if ($this->txtFirstName) { $this->txtFirstName->Text = $this->objParentPagerIndividual->FirstName; } if ($this->lblFirstName) { $this->lblFirstName->Text = $this->objParentPagerIndividual->FirstName; } if ($this->txtMiddleName) { $this->txtMiddleName->Text = $this->objParentPagerIndividual->MiddleName; } if ($this->lblMiddleName) { $this->lblMiddleName->Text = $this->objParentPagerIndividual->MiddleName; } if ($this->txtLastName) { $this->txtLastName->Text = $this->objParentPagerIndividual->LastName; } if ($this->lblLastName) { $this->lblLastName->Text = $this->objParentPagerIndividual->LastName; } if ($this->txtPrefix) { $this->txtPrefix->Text = $this->objParentPagerIndividual->Prefix; } if ($this->lblPrefix) { $this->lblPrefix->Text = $this->objParentPagerIndividual->Prefix; } if ($this->txtSuffix) { $this->txtSuffix->Text = $this->objParentPagerIndividual->Suffix; } if ($this->lblSuffix) { $this->lblSuffix->Text = $this->objParentPagerIndividual->Suffix; } if ($this->txtNickname) { $this->txtNickname->Text = $this->objParentPagerIndividual->Nickname; } if ($this->lblNickname) { $this->lblNickname->Text = $this->objParentPagerIndividual->Nickname; } if ($this->txtGraduationYear) { $this->txtGraduationYear->Text = $this->objParentPagerIndividual->GraduationYear; } if ($this->lblGraduationYear) { $this->lblGraduationYear->Text = $this->objParentPagerIndividual->GraduationYear; } if ($this->txtGender) { $this->txtGender->Text = $this->objParentPagerIndividual->Gender; } if ($this->lblGender) { $this->lblGender->Text = $this->objParentPagerIndividual->Gender; } if ($this->calDateOfBirth) { $this->calDateOfBirth->DateTime = $this->objParentPagerIndividual->DateOfBirth; } if ($this->lblDateOfBirth) { $this->lblDateOfBirth->Text = sprintf($this->objParentPagerIndividual->DateOfBirth) ? $this->objParentPagerIndividual->__toString($this->strDateOfBirthDateTimeFormat) : null; } }
protected function dtgPersons_Bind() { // Let the datagrid know how many total items and then get the data source $this->dtgPersons->TotalItemCount = Person::CountAll(); $this->dtgPersons->DataSource = Person::LoadAll(QQ::Clause($this->dtgPersons->OrderByClause, $this->dtgPersons->LimitClause)); }
protected function dtgPersons_Bind() { // We must be sure to load the data source // Make sure we pass in the DataGrid's OrderByClause to the LoadAll command $this->dtgPersons->DataSource = Person::LoadAll(QQ::Clause($this->dtgPersons->OrderByClause)); }
/** * Default / simple DataBinder for this Meta DataGrid. This can easily be overridden * by calling SetDataBinder() on this DataGrid with another DataBinder of your choice. * * If a paginator is set on this DataBinder, it will use it. If not, then no pagination will be used. * It will also perform any sorting (if applicable). */ public function MetaDataBinder() { // Remember! We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below if ($this->Paginator) { $this->TotalItemCount = Person::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->OrderByClause) { array_push($objClauses, $objClause); } // Add the LimitClause information, as well if ($objClause = $this->LimitClause) { array_push($objClauses, $objClause); } // Set the DataSource to be a Query result from Person, given the clauses above $this->DataSource = Person::LoadAll($objClauses); }
/** * Bind the data to the data source. Note that the first parameter is the control we are binding to. This allows * us to use the same data binder for multiple controls. */ protected function dtgPersons_Bind($objControl) { // Use the control passed in to the data binder to know to which to send the data. $objControl->DataSource = Person::LoadAll(); }
protected function dtrPersons_Bind() { // This function defines how we load the data source into the Data Repeater $this->dtrPersons->TotalItemCount = Person::CountAll(); $this->dtrPersons->DataSource = Person::LoadAll(QQ::Clause($this->dtrPersons->LimitClause)); }
/** * Refresh this MetaControl with Data from the local HouseholdParticipation object. * @param boolean $blnReload reload HouseholdParticipation from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objHouseholdParticipation->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objHouseholdParticipation->Id; } } if ($this->lstPerson) { $this->lstPerson->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstPerson->AddItem(QApplication::Translate('- Select One -'), null); } $objPersonArray = Person::LoadAll(); if ($objPersonArray) { foreach ($objPersonArray as $objPerson) { $objListItem = new QListItem($objPerson->__toString(), $objPerson->Id); if ($this->objHouseholdParticipation->Person && $this->objHouseholdParticipation->Person->Id == $objPerson->Id) { $objListItem->Selected = true; } $this->lstPerson->AddItem($objListItem); } } } if ($this->lblPersonId) { $this->lblPersonId->Text = $this->objHouseholdParticipation->Person ? $this->objHouseholdParticipation->Person->__toString() : null; } if ($this->lstHousehold) { $this->lstHousehold->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstHousehold->AddItem(QApplication::Translate('- Select One -'), null); } $objHouseholdArray = Household::LoadAll(); if ($objHouseholdArray) { foreach ($objHouseholdArray as $objHousehold) { $objListItem = new QListItem($objHousehold->__toString(), $objHousehold->Id); if ($this->objHouseholdParticipation->Household && $this->objHouseholdParticipation->Household->Id == $objHousehold->Id) { $objListItem->Selected = true; } $this->lstHousehold->AddItem($objListItem); } } } if ($this->lblHouseholdId) { $this->lblHouseholdId->Text = $this->objHouseholdParticipation->Household ? $this->objHouseholdParticipation->Household->__toString() : null; } if ($this->txtRole) { $this->txtRole->Text = $this->objHouseholdParticipation->Role; } if ($this->lblRole) { $this->lblRole->Text = $this->objHouseholdParticipation->Role; } if ($this->txtRoleOverride) { $this->txtRoleOverride->Text = $this->objHouseholdParticipation->RoleOverride; } if ($this->lblRoleOverride) { $this->lblRoleOverride->Text = $this->objHouseholdParticipation->RoleOverride; } }
/** * Refresh this MetaControl with Data from the local AttributeValue object. * @param boolean $blnReload reload AttributeValue from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objAttributeValue->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objAttributeValue->Id; } } if ($this->lstAttribute) { $this->lstAttribute->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstAttribute->AddItem(QApplication::Translate('- Select One -'), null); } $objAttributeArray = Attribute::LoadAll(); if ($objAttributeArray) { foreach ($objAttributeArray as $objAttribute) { $objListItem = new QListItem($objAttribute->__toString(), $objAttribute->Id); if ($this->objAttributeValue->Attribute && $this->objAttributeValue->Attribute->Id == $objAttribute->Id) { $objListItem->Selected = true; } $this->lstAttribute->AddItem($objListItem); } } } if ($this->lblAttributeId) { $this->lblAttributeId->Text = $this->objAttributeValue->Attribute ? $this->objAttributeValue->Attribute->__toString() : null; } if ($this->lstPerson) { $this->lstPerson->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstPerson->AddItem(QApplication::Translate('- Select One -'), null); } $objPersonArray = Person::LoadAll(); if ($objPersonArray) { foreach ($objPersonArray as $objPerson) { $objListItem = new QListItem($objPerson->__toString(), $objPerson->Id); if ($this->objAttributeValue->Person && $this->objAttributeValue->Person->Id == $objPerson->Id) { $objListItem->Selected = true; } $this->lstPerson->AddItem($objListItem); } } } if ($this->lblPersonId) { $this->lblPersonId->Text = $this->objAttributeValue->Person ? $this->objAttributeValue->Person->__toString() : null; } if ($this->calDateValue) { $this->calDateValue->DateTime = $this->objAttributeValue->DateValue; } if ($this->lblDateValue) { $this->lblDateValue->Text = sprintf($this->objAttributeValue->DateValue) ? $this->objAttributeValue->__toString($this->strDateValueDateTimeFormat) : null; } if ($this->calDatetimeValue) { $this->calDatetimeValue->DateTime = $this->objAttributeValue->DatetimeValue; } if ($this->lblDatetimeValue) { $this->lblDatetimeValue->Text = sprintf($this->objAttributeValue->DatetimeValue) ? $this->objAttributeValue->__toString($this->strDatetimeValueDateTimeFormat) : null; } if ($this->txtTextValue) { $this->txtTextValue->Text = $this->objAttributeValue->TextValue; } if ($this->lblTextValue) { $this->lblTextValue->Text = $this->objAttributeValue->TextValue; } if ($this->chkBooleanValue) { $this->chkBooleanValue->Checked = $this->objAttributeValue->BooleanValue; } if ($this->lblBooleanValue) { $this->lblBooleanValue->Text = $this->objAttributeValue->BooleanValue ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->lstSingleAttributeOption) { $this->lstSingleAttributeOption->RemoveAllItems(); $this->lstSingleAttributeOption->AddItem(QApplication::Translate('- Select One -'), null); $objSingleAttributeOptionArray = AttributeOption::LoadAll(); if ($objSingleAttributeOptionArray) { foreach ($objSingleAttributeOptionArray as $objSingleAttributeOption) { $objListItem = new QListItem($objSingleAttributeOption->__toString(), $objSingleAttributeOption->Id); if ($this->objAttributeValue->SingleAttributeOption && $this->objAttributeValue->SingleAttributeOption->Id == $objSingleAttributeOption->Id) { $objListItem->Selected = true; } $this->lstSingleAttributeOption->AddItem($objListItem); } } } if ($this->lblSingleAttributeOptionId) { $this->lblSingleAttributeOptionId->Text = $this->objAttributeValue->SingleAttributeOption ? $this->objAttributeValue->SingleAttributeOption->__toString() : null; } if ($this->lstAttributeOptionsAsMultiple) { $this->lstAttributeOptionsAsMultiple->RemoveAllItems(); $objAssociatedArray = $this->objAttributeValue->GetAttributeOptionAsMultipleArray(); $objAttributeOptionArray = AttributeOption::LoadAll(); if ($objAttributeOptionArray) { foreach ($objAttributeOptionArray as $objAttributeOption) { $objListItem = new QListItem($objAttributeOption->__toString(), $objAttributeOption->Id); foreach ($objAssociatedArray as $objAssociated) { if ($objAssociated->Id == $objAttributeOption->Id) { $objListItem->Selected = true; } } $this->lstAttributeOptionsAsMultiple->AddItem($objListItem); } } } if ($this->lblAttributeOptionsAsMultiple) { $objAssociatedArray = $this->objAttributeValue->GetAttributeOptionAsMultipleArray(); $strItems = array(); foreach ($objAssociatedArray as $objAssociated) { $strItems[] = $objAssociated->__toString(); } $this->lblAttributeOptionsAsMultiple->Text = implode($strGlue, $strItems); } }
/** * Refresh this MetaControl with Data from the local Email object. * @param boolean $blnReload reload Email from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objEmail->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objEmail->Id; } } if ($this->lstPerson) { $this->lstPerson->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstPerson->AddItem(QApplication::Translate('- Select One -'), null); } $objPersonArray = Person::LoadAll(); if ($objPersonArray) { foreach ($objPersonArray as $objPerson) { $objListItem = new QListItem($objPerson->__toString(), $objPerson->Id); if ($this->objEmail->Person && $this->objEmail->Person->Id == $objPerson->Id) { $objListItem->Selected = true; } $this->lstPerson->AddItem($objListItem); } } } if ($this->lblPersonId) { $this->lblPersonId->Text = $this->objEmail->Person ? $this->objEmail->Person->__toString() : null; } if ($this->txtAddress) { $this->txtAddress->Text = $this->objEmail->Address; } if ($this->lblAddress) { $this->lblAddress->Text = $this->objEmail->Address; } if ($this->lstPersonAsPrimary) { $this->lstPersonAsPrimary->RemoveAllItems(); $this->lstPersonAsPrimary->AddItem(QApplication::Translate('- Select One -'), null); $objPersonArray = Person::LoadAll(); if ($objPersonArray) { foreach ($objPersonArray as $objPerson) { $objListItem = new QListItem($objPerson->__toString(), $objPerson->Id); if ($objPerson->PrimaryEmailId == $this->objEmail->Id) { $objListItem->Selected = true; } $this->lstPersonAsPrimary->AddItem($objListItem); } } } if ($this->lblPersonAsPrimary) { $this->lblPersonAsPrimary->Text = $this->objEmail->PersonAsPrimary ? $this->objEmail->PersonAsPrimary->__toString() : null; } }
/** * Refresh this MetaControl with Data from the local Package object. * @param boolean $blnReload reload Package from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objPackage->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objPackage->Id; } } if ($this->lstPackageCategory) { $this->lstPackageCategory->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstPackageCategory->AddItem(QApplication::Translate('- Select One -'), null); } $objPackageCategoryArray = PackageCategory::LoadAll(); if ($objPackageCategoryArray) { foreach ($objPackageCategoryArray as $objPackageCategory) { $objListItem = new QListItem($objPackageCategory->__toString(), $objPackageCategory->Id); if ($this->objPackage->PackageCategory && $this->objPackage->PackageCategory->Id == $objPackageCategory->Id) { $objListItem->Selected = true; } $this->lstPackageCategory->AddItem($objListItem); } } } if ($this->lblPackageCategoryId) { $this->lblPackageCategoryId->Text = $this->objPackage->PackageCategory ? $this->objPackage->PackageCategory->__toString() : null; } if ($this->txtToken) { $this->txtToken->Text = $this->objPackage->Token; } if ($this->lblToken) { $this->lblToken->Text = $this->objPackage->Token; } if ($this->txtName) { $this->txtName->Text = $this->objPackage->Name; } if ($this->lblName) { $this->lblName->Text = $this->objPackage->Name; } if ($this->txtDescription) { $this->txtDescription->Text = $this->objPackage->Description; } if ($this->lblDescription) { $this->lblDescription->Text = $this->objPackage->Description; } if ($this->calLastPostDate) { $this->calLastPostDate->DateTime = $this->objPackage->LastPostDate; } if ($this->lblLastPostDate) { $this->lblLastPostDate->Text = sprintf($this->objPackage->LastPostDate) ? $this->objPackage->__toString($this->strLastPostDateDateTimeFormat) : null; } if ($this->lstLastPostedByPerson) { $this->lstLastPostedByPerson->RemoveAllItems(); $this->lstLastPostedByPerson->AddItem(QApplication::Translate('- Select One -'), null); $objLastPostedByPersonArray = Person::LoadAll(); if ($objLastPostedByPersonArray) { foreach ($objLastPostedByPersonArray as $objLastPostedByPerson) { $objListItem = new QListItem($objLastPostedByPerson->__toString(), $objLastPostedByPerson->Id); if ($this->objPackage->LastPostedByPerson && $this->objPackage->LastPostedByPerson->Id == $objLastPostedByPerson->Id) { $objListItem->Selected = true; } $this->lstLastPostedByPerson->AddItem($objListItem); } } } if ($this->lblLastPostedByPersonId) { $this->lblLastPostedByPersonId->Text = $this->objPackage->LastPostedByPerson ? $this->objPackage->LastPostedByPerson->__toString() : null; } if ($this->lstTopicLink) { $this->lstTopicLink->RemoveAllItems(); $this->lstTopicLink->AddItem(QApplication::Translate('- Select One -'), null); $objTopicLinkArray = TopicLink::LoadAll(); if ($objTopicLinkArray) { foreach ($objTopicLinkArray as $objTopicLink) { $objListItem = new QListItem($objTopicLink->__toString(), $objTopicLink->Id); if ($objTopicLink->PackageId == $this->objPackage->Id) { $objListItem->Selected = true; } $this->lstTopicLink->AddItem($objListItem); } } } if ($this->lblTopicLink) { $this->lblTopicLink->Text = $this->objPackage->TopicLink ? $this->objPackage->TopicLink->__toString() : null; } }
protected function Accordion_Bind() { $this->accordion->DataSource = Person::LoadAll([QQ::Expand(QQN::Person()->Address)]); }
protected function dtgPersons_Bind() { // We must be sure to load the data source $this->dtgPersons->DataSource = Person::LoadAll(); }
/** * Refresh this MetaControl with Data from the local PublicLogin object. * @param boolean $blnReload reload PublicLogin from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objPublicLogin->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objPublicLogin->Id; } } if ($this->lstPerson) { $this->lstPerson->RemoveAllItems(); $this->lstPerson->AddItem(QApplication::Translate('- Select One -'), null); $objPersonArray = Person::LoadAll(); if ($objPersonArray) { foreach ($objPersonArray as $objPerson) { $objListItem = new QListItem($objPerson->__toString(), $objPerson->Id); if ($this->objPublicLogin->Person && $this->objPublicLogin->Person->Id == $objPerson->Id) { $objListItem->Selected = true; } $this->lstPerson->AddItem($objListItem); } } } if ($this->lblPersonId) { $this->lblPersonId->Text = $this->objPublicLogin->Person ? $this->objPublicLogin->Person->__toString() : null; } if ($this->chkActiveFlag) { $this->chkActiveFlag->Checked = $this->objPublicLogin->ActiveFlag; } if ($this->lblActiveFlag) { $this->lblActiveFlag->Text = $this->objPublicLogin->ActiveFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->txtUsername) { $this->txtUsername->Text = $this->objPublicLogin->Username; } if ($this->lblUsername) { $this->lblUsername->Text = $this->objPublicLogin->Username; } if ($this->txtPassword) { $this->txtPassword->Text = $this->objPublicLogin->Password; } if ($this->lblPassword) { $this->lblPassword->Text = $this->objPublicLogin->Password; } if ($this->txtLostPasswordQuestion) { $this->txtLostPasswordQuestion->Text = $this->objPublicLogin->LostPasswordQuestion; } if ($this->lblLostPasswordQuestion) { $this->lblLostPasswordQuestion->Text = $this->objPublicLogin->LostPasswordQuestion; } if ($this->txtLostPasswordAnswer) { $this->txtLostPasswordAnswer->Text = $this->objPublicLogin->LostPasswordAnswer; } if ($this->lblLostPasswordAnswer) { $this->lblLostPasswordAnswer->Text = $this->objPublicLogin->LostPasswordAnswer; } if ($this->chkTemporaryPasswordFlag) { $this->chkTemporaryPasswordFlag->Checked = $this->objPublicLogin->TemporaryPasswordFlag; } if ($this->lblTemporaryPasswordFlag) { $this->lblTemporaryPasswordFlag->Text = $this->objPublicLogin->TemporaryPasswordFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->calDateRegistered) { $this->calDateRegistered->DateTime = $this->objPublicLogin->DateRegistered; } if ($this->lblDateRegistered) { $this->lblDateRegistered->Text = sprintf($this->objPublicLogin->DateRegistered) ? $this->objPublicLogin->__toString($this->strDateRegisteredDateTimeFormat) : null; } if ($this->calDateLastLogin) { $this->calDateLastLogin->DateTime = $this->objPublicLogin->DateLastLogin; } if ($this->lblDateLastLogin) { $this->lblDateLastLogin->Text = sprintf($this->objPublicLogin->DateLastLogin) ? $this->objPublicLogin->__toString($this->strDateLastLoginDateTimeFormat) : null; } if ($this->lstProvisionalPublicLogin) { $this->lstProvisionalPublicLogin->RemoveAllItems(); $this->lstProvisionalPublicLogin->AddItem(QApplication::Translate('- Select One -'), null); $objProvisionalPublicLoginArray = ProvisionalPublicLogin::LoadAll(); if ($objProvisionalPublicLoginArray) { foreach ($objProvisionalPublicLoginArray as $objProvisionalPublicLogin) { $objListItem = new QListItem($objProvisionalPublicLogin->__toString(), $objProvisionalPublicLogin->PublicLoginId); if ($objProvisionalPublicLogin->PublicLoginId == $this->objPublicLogin->Id) { $objListItem->Selected = true; } $this->lstProvisionalPublicLogin->AddItem($objListItem); } } // Because ProvisionalPublicLogin's ProvisionalPublicLogin is not null, if a value is already selected, it cannot be changed. if ($this->lstProvisionalPublicLogin->SelectedValue) { $this->lstProvisionalPublicLogin->Enabled = false; } else { $this->lstProvisionalPublicLogin->Enabled = true; } } if ($this->lblProvisionalPublicLogin) { $this->lblProvisionalPublicLogin->Text = $this->objPublicLogin->ProvisionalPublicLogin ? $this->objPublicLogin->ProvisionalPublicLogin->__toString() : null; } }
/** * Refresh this MetaControl with Data from the local Message object. * @param boolean $blnReload reload Message from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objMessage->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objMessage->Id; } } if ($this->lstTopic) { $this->lstTopic->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstTopic->AddItem(QApplication::Translate('- Select One -'), null); } $objTopicArray = Topic::LoadAll(); if ($objTopicArray) { foreach ($objTopicArray as $objTopic) { $objListItem = new QListItem($objTopic->__toString(), $objTopic->Id); if ($this->objMessage->Topic && $this->objMessage->Topic->Id == $objTopic->Id) { $objListItem->Selected = true; } $this->lstTopic->AddItem($objListItem); } } } if ($this->lblTopicId) { $this->lblTopicId->Text = $this->objMessage->Topic ? $this->objMessage->Topic->__toString() : null; } if ($this->lstTopicLink) { $this->lstTopicLink->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstTopicLink->AddItem(QApplication::Translate('- Select One -'), null); } $objTopicLinkArray = TopicLink::LoadAll(); if ($objTopicLinkArray) { foreach ($objTopicLinkArray as $objTopicLink) { $objListItem = new QListItem($objTopicLink->__toString(), $objTopicLink->Id); if ($this->objMessage->TopicLink && $this->objMessage->TopicLink->Id == $objTopicLink->Id) { $objListItem->Selected = true; } $this->lstTopicLink->AddItem($objListItem); } } } if ($this->lblTopicLinkId) { $this->lblTopicLinkId->Text = $this->objMessage->TopicLink ? $this->objMessage->TopicLink->__toString() : null; } if ($this->lstPerson) { $this->lstPerson->RemoveAllItems(); $this->lstPerson->AddItem(QApplication::Translate('- Select One -'), null); $objPersonArray = Person::LoadAll(); if ($objPersonArray) { foreach ($objPersonArray as $objPerson) { $objListItem = new QListItem($objPerson->__toString(), $objPerson->Id); if ($this->objMessage->Person && $this->objMessage->Person->Id == $objPerson->Id) { $objListItem->Selected = true; } $this->lstPerson->AddItem($objListItem); } } } if ($this->lblPersonId) { $this->lblPersonId->Text = $this->objMessage->Person ? $this->objMessage->Person->__toString() : null; } if ($this->txtMessage) { $this->txtMessage->Text = $this->objMessage->Message; } if ($this->lblMessage) { $this->lblMessage->Text = $this->objMessage->Message; } if ($this->txtCompiledHtml) { $this->txtCompiledHtml->Text = $this->objMessage->CompiledHtml; } if ($this->lblCompiledHtml) { $this->lblCompiledHtml->Text = $this->objMessage->CompiledHtml; } if ($this->txtReplyNumber) { $this->txtReplyNumber->Text = $this->objMessage->ReplyNumber; } if ($this->lblReplyNumber) { $this->lblReplyNumber->Text = $this->objMessage->ReplyNumber; } if ($this->calPostDate) { $this->calPostDate->DateTime = $this->objMessage->PostDate; } if ($this->lblPostDate) { $this->lblPostDate->Text = sprintf($this->objMessage->PostDate) ? $this->objMessage->__toString($this->strPostDateDateTimeFormat) : null; } }
protected function dtgPersons_Bind() { // Specify the Total Item Count and Load in the Data Source $this->dtgPersons->TotalItemCount = Person::CountAll(); $this->dtgPersons->DataSource = Person::LoadAll(QQ::Clause($this->dtgPersons->OrderByClause, $this->dtgPersons->LimitClause)); }