/** * Refresh this MetaControl with Data from the local SignupEntry object. * @param boolean $blnReload reload SignupEntry from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objSignupEntry->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objSignupEntry->Id; } } if ($this->lstSignupForm) { $this->lstSignupForm->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstSignupForm->AddItem(QApplication::Translate('- Select One -'), null); } $objSignupFormArray = SignupForm::LoadAll(); if ($objSignupFormArray) { foreach ($objSignupFormArray as $objSignupForm) { $objListItem = new QListItem($objSignupForm->__toString(), $objSignupForm->Id); if ($this->objSignupEntry->SignupForm && $this->objSignupEntry->SignupForm->Id == $objSignupForm->Id) { $objListItem->Selected = true; } $this->lstSignupForm->AddItem($objListItem); } } } if ($this->lblSignupFormId) { $this->lblSignupFormId->Text = $this->objSignupEntry->SignupForm ? $this->objSignupEntry->SignupForm->__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->objSignupEntry->Person && $this->objSignupEntry->Person->Id == $objPerson->Id) { $objListItem->Selected = true; } $this->lstPerson->AddItem($objListItem); } } } if ($this->lblPersonId) { $this->lblPersonId->Text = $this->objSignupEntry->Person ? $this->objSignupEntry->Person->__toString() : null; } if ($this->lstSignupByPerson) { $this->lstSignupByPerson->RemoveAllItems(); $this->lstSignupByPerson->AddItem(QApplication::Translate('- Select One -'), null); $objSignupByPersonArray = Person::LoadAll(); if ($objSignupByPersonArray) { foreach ($objSignupByPersonArray as $objSignupByPerson) { $objListItem = new QListItem($objSignupByPerson->__toString(), $objSignupByPerson->Id); if ($this->objSignupEntry->SignupByPerson && $this->objSignupEntry->SignupByPerson->Id == $objSignupByPerson->Id) { $objListItem->Selected = true; } $this->lstSignupByPerson->AddItem($objListItem); } } } if ($this->lblSignupByPersonId) { $this->lblSignupByPersonId->Text = $this->objSignupEntry->SignupByPerson ? $this->objSignupEntry->SignupByPerson->__toString() : null; } if ($this->lstSignupEntryStatusType) { $this->lstSignupEntryStatusType->SelectedValue = $this->objSignupEntry->SignupEntryStatusTypeId; } if ($this->lblSignupEntryStatusTypeId) { $this->lblSignupEntryStatusTypeId->Text = $this->objSignupEntry->SignupEntryStatusTypeId ? SignupEntryStatusType::$NameArray[$this->objSignupEntry->SignupEntryStatusTypeId] : null; } if ($this->calDateCreated) { $this->calDateCreated->DateTime = $this->objSignupEntry->DateCreated; } if ($this->lblDateCreated) { $this->lblDateCreated->Text = sprintf($this->objSignupEntry->DateCreated) ? $this->objSignupEntry->__toString($this->strDateCreatedDateTimeFormat) : null; } if ($this->calDateSubmitted) { $this->calDateSubmitted->DateTime = $this->objSignupEntry->DateSubmitted; } if ($this->lblDateSubmitted) { $this->lblDateSubmitted->Text = sprintf($this->objSignupEntry->DateSubmitted) ? $this->objSignupEntry->__toString($this->strDateSubmittedDateTimeFormat) : null; } if ($this->txtAmountTotal) { $this->txtAmountTotal->Text = $this->objSignupEntry->AmountTotal; } if ($this->lblAmountTotal) { $this->lblAmountTotal->Text = $this->objSignupEntry->AmountTotal; } if ($this->txtAmountPaid) { $this->txtAmountPaid->Text = $this->objSignupEntry->AmountPaid; } if ($this->lblAmountPaid) { $this->lblAmountPaid->Text = $this->objSignupEntry->AmountPaid; } if ($this->txtAmountBalance) { $this->txtAmountBalance->Text = $this->objSignupEntry->AmountBalance; } if ($this->lblAmountBalance) { $this->lblAmountBalance->Text = $this->objSignupEntry->AmountBalance; } if ($this->txtInternalNotes) { $this->txtInternalNotes->Text = $this->objSignupEntry->InternalNotes; } if ($this->lblInternalNotes) { $this->lblInternalNotes->Text = $this->objSignupEntry->InternalNotes; } if ($this->lstCommunicationsEntry) { $this->lstCommunicationsEntry->RemoveAllItems(); $this->lstCommunicationsEntry->AddItem(QApplication::Translate('- Select One -'), null); $objCommunicationsEntryArray = CommunicationListEntry::LoadAll(); if ($objCommunicationsEntryArray) { foreach ($objCommunicationsEntryArray as $objCommunicationsEntry) { $objListItem = new QListItem($objCommunicationsEntry->__toString(), $objCommunicationsEntry->Id); if ($this->objSignupEntry->CommunicationsEntry && $this->objSignupEntry->CommunicationsEntry->Id == $objCommunicationsEntry->Id) { $objListItem->Selected = true; } $this->lstCommunicationsEntry->AddItem($objListItem); } } } if ($this->lblCommunicationsEntryId) { $this->lblCommunicationsEntryId->Text = $this->objSignupEntry->CommunicationsEntry ? $this->objSignupEntry->CommunicationsEntry->__toString() : null; } if ($this->lstClassRegistration) { $this->lstClassRegistration->RemoveAllItems(); $this->lstClassRegistration->AddItem(QApplication::Translate('- Select One -'), null); $objClassRegistrationArray = ClassRegistration::LoadAll(); if ($objClassRegistrationArray) { foreach ($objClassRegistrationArray as $objClassRegistration) { $objListItem = new QListItem($objClassRegistration->__toString(), $objClassRegistration->SignupEntryId); if ($objClassRegistration->SignupEntryId == $this->objSignupEntry->Id) { $objListItem->Selected = true; } $this->lstClassRegistration->AddItem($objListItem); } } // Because ClassRegistration's ClassRegistration is not null, if a value is already selected, it cannot be changed. if ($this->lstClassRegistration->SelectedValue) { $this->lstClassRegistration->Enabled = false; } else { $this->lstClassRegistration->Enabled = true; } } if ($this->lblClassRegistration) { $this->lblClassRegistration->Text = $this->objSignupEntry->ClassRegistration ? $this->objSignupEntry->ClassRegistration->__toString() : null; } }
/** * Refresh this MetaControl with Data from the local ClassAttendence object. * @param boolean $blnReload reload ClassAttendence from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objClassAttendence->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objClassAttendence->Id; } } if ($this->lstClassRegistration) { $this->lstClassRegistration->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstClassRegistration->AddItem(QApplication::Translate('- Select One -'), null); } $objClassRegistrationArray = ClassRegistration::LoadAll(); if ($objClassRegistrationArray) { foreach ($objClassRegistrationArray as $objClassRegistration) { $objListItem = new QListItem($objClassRegistration->__toString(), $objClassRegistration->SignupEntryId); if ($this->objClassAttendence->ClassRegistration && $this->objClassAttendence->ClassRegistration->SignupEntryId == $objClassRegistration->SignupEntryId) { $objListItem->Selected = true; } $this->lstClassRegistration->AddItem($objListItem); } } } if ($this->lblClassRegistrationId) { $this->lblClassRegistrationId->Text = $this->objClassAttendence->ClassRegistration ? $this->objClassAttendence->ClassRegistration->__toString() : null; } if ($this->txtMeetingNumber) { $this->txtMeetingNumber->Text = $this->objClassAttendence->MeetingNumber; } if ($this->lblMeetingNumber) { $this->lblMeetingNumber->Text = $this->objClassAttendence->MeetingNumber; } if ($this->chkPresentFlag) { $this->chkPresentFlag->Checked = $this->objClassAttendence->PresentFlag; } if ($this->lblPresentFlag) { $this->lblPresentFlag->Text = $this->objClassAttendence->PresentFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } }