/** * Refresh this MetaControl with Data from the local RecurringPayments object. * @param boolean $blnReload reload RecurringPayments from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objRecurringPayments->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objRecurringPayments->Id; } } if ($this->txtName) { $this->txtName->Text = $this->objRecurringPayments->Name; } if ($this->lblName) { $this->lblName->Text = $this->objRecurringPayments->Name; } if ($this->lstPaymentPeriod) { $this->lstPaymentPeriod->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstPaymentPeriod->AddItem(QApplication::Translate('- Select One -'), null); } $objPaymentPeriodArray = PaymentPeriod::LoadAll(); if ($objPaymentPeriodArray) { foreach ($objPaymentPeriodArray as $objPaymentPeriod) { $objListItem = new QListItem($objPaymentPeriod->__toString(), $objPaymentPeriod->Id); if ($this->objRecurringPayments->PaymentPeriod && $this->objRecurringPayments->PaymentPeriod->Id == $objPaymentPeriod->Id) { $objListItem->Selected = true; } $this->lstPaymentPeriod->AddItem($objListItem); } } } if ($this->lblPaymentPeriodId) { $this->lblPaymentPeriodId->Text = $this->objRecurringPayments->PaymentPeriod ? $this->objRecurringPayments->PaymentPeriod->__toString() : null; } if ($this->txtAmount) { $this->txtAmount->Text = $this->objRecurringPayments->Amount; } if ($this->lblAmount) { $this->lblAmount->Text = $this->objRecurringPayments->Amount; } if ($this->calStartDate) { $this->calStartDate->DateTime = $this->objRecurringPayments->StartDate; } if ($this->lblStartDate) { $this->lblStartDate->Text = sprintf($this->objRecurringPayments->StartDate) ? $this->objRecurringPayments->__toString($this->strStartDateDateTimeFormat) : null; } if ($this->calEndDate) { $this->calEndDate->DateTime = $this->objRecurringPayments->EndDate; } if ($this->lblEndDate) { $this->lblEndDate->Text = sprintf($this->objRecurringPayments->EndDate) ? $this->objRecurringPayments->__toString($this->strEndDateDateTimeFormat) : null; } if ($this->chkAuthorizeFlag) { $this->chkAuthorizeFlag->Checked = $this->objRecurringPayments->AuthorizeFlag; } if ($this->lblAuthorizeFlag) { $this->lblAuthorizeFlag->Text = $this->objRecurringPayments->AuthorizeFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->txtCardHolderName) { $this->txtCardHolderName->Text = $this->objRecurringPayments->CardHolderName; } if ($this->lblCardHolderName) { $this->lblCardHolderName->Text = $this->objRecurringPayments->CardHolderName; } if ($this->txtAddress1) { $this->txtAddress1->Text = $this->objRecurringPayments->Address1; } if ($this->lblAddress1) { $this->lblAddress1->Text = $this->objRecurringPayments->Address1; } if ($this->txtAddress2) { $this->txtAddress2->Text = $this->objRecurringPayments->Address2; } if ($this->lblAddress2) { $this->lblAddress2->Text = $this->objRecurringPayments->Address2; } if ($this->txtCity) { $this->txtCity->Text = $this->objRecurringPayments->City; } if ($this->lblCity) { $this->lblCity->Text = $this->objRecurringPayments->City; } if ($this->txtState) { $this->txtState->Text = $this->objRecurringPayments->State; } if ($this->lblState) { $this->lblState->Text = $this->objRecurringPayments->State; } if ($this->txtZip) { $this->txtZip->Text = $this->objRecurringPayments->Zip; } if ($this->lblZip) { $this->lblZip->Text = $this->objRecurringPayments->Zip; } if ($this->lstCreditCardType) { $this->lstCreditCardType->SelectedValue = $this->objRecurringPayments->CreditCardTypeId; } if ($this->lblCreditCardTypeId) { $this->lblCreditCardTypeId->Text = $this->objRecurringPayments->CreditCardTypeId ? CreditCardType::$NameArray[$this->objRecurringPayments->CreditCardTypeId] : null; } if ($this->txtAccountNumber) { $this->txtAccountNumber->Text = $this->objRecurringPayments->AccountNumber; } if ($this->lblAccountNumber) { $this->lblAccountNumber->Text = $this->objRecurringPayments->AccountNumber; } if ($this->txtExpirationDate) { $this->txtExpirationDate->Text = $this->objRecurringPayments->ExpirationDate; } if ($this->lblExpirationDate) { $this->lblExpirationDate->Text = $this->objRecurringPayments->ExpirationDate; } if ($this->txtSecurityCode) { $this->txtSecurityCode->Text = $this->objRecurringPayments->SecurityCode; } if ($this->lblSecurityCode) { $this->lblSecurityCode->Text = $this->objRecurringPayments->SecurityCode; } if ($this->lstRecurringDonationAsRecurringPayment) { $this->lstRecurringDonationAsRecurringPayment->RemoveAllItems(); $this->lstRecurringDonationAsRecurringPayment->AddItem(QApplication::Translate('- Select One -'), null); $objRecurringDonationArray = RecurringDonation::LoadAll(); if ($objRecurringDonationArray) { foreach ($objRecurringDonationArray as $objRecurringDonation) { $objListItem = new QListItem($objRecurringDonation->__toString(), $objRecurringDonation->Id); if ($objRecurringDonation->RecurringPaymentId == $this->objRecurringPayments->Id) { $objListItem->Selected = true; } $this->lstRecurringDonationAsRecurringPayment->AddItem($objListItem); } } } if ($this->lblRecurringDonationAsRecurringPayment) { $this->lblRecurringDonationAsRecurringPayment->Text = $this->objRecurringPayments->RecurringDonationAsRecurringPayment ? $this->objRecurringPayments->RecurringDonationAsRecurringPayment->__toString() : null; } }
/** * Refresh this MetaControl with Data from the local RecurringDonationItems object. * @param boolean $blnReload reload RecurringDonationItems from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objRecurringDonationItems->Reload(); } if ($this->lblId) { if ($this->blnEditMode) { $this->lblId->Text = $this->objRecurringDonationItems->Id; } } if ($this->lstRecurringDonation) { $this->lstRecurringDonation->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstRecurringDonation->AddItem(QApplication::Translate('- Select One -'), null); } $objRecurringDonationArray = RecurringDonation::LoadAll(); if ($objRecurringDonationArray) { foreach ($objRecurringDonationArray as $objRecurringDonation) { $objListItem = new QListItem($objRecurringDonation->__toString(), $objRecurringDonation->Id); if ($this->objRecurringDonationItems->RecurringDonation && $this->objRecurringDonationItems->RecurringDonation->Id == $objRecurringDonation->Id) { $objListItem->Selected = true; } $this->lstRecurringDonation->AddItem($objListItem); } } } if ($this->lblRecurringDonationId) { $this->lblRecurringDonationId->Text = $this->objRecurringDonationItems->RecurringDonation ? $this->objRecurringDonationItems->RecurringDonation->__toString() : null; } if ($this->txtAmount) { $this->txtAmount->Text = $this->objRecurringDonationItems->Amount; } if ($this->lblAmount) { $this->lblAmount->Text = $this->objRecurringDonationItems->Amount; } if ($this->chkDonationFlag) { $this->chkDonationFlag->Checked = $this->objRecurringDonationItems->DonationFlag; } if ($this->lblDonationFlag) { $this->lblDonationFlag->Text = $this->objRecurringDonationItems->DonationFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->lstStewardshipFund) { $this->lstStewardshipFund->RemoveAllItems(); $this->lstStewardshipFund->AddItem(QApplication::Translate('- Select One -'), null); $objStewardshipFundArray = StewardshipFund::LoadAll(); if ($objStewardshipFundArray) { foreach ($objStewardshipFundArray as $objStewardshipFund) { $objListItem = new QListItem($objStewardshipFund->__toString(), $objStewardshipFund->Id); if ($this->objRecurringDonationItems->StewardshipFund && $this->objRecurringDonationItems->StewardshipFund->Id == $objStewardshipFund->Id) { $objListItem->Selected = true; } $this->lstStewardshipFund->AddItem($objListItem); } } } if ($this->lblStewardshipFundId) { $this->lblStewardshipFundId->Text = $this->objRecurringDonationItems->StewardshipFund ? $this->objRecurringDonationItems->StewardshipFund->__toString() : null; } if ($this->txtOther) { $this->txtOther->Text = $this->objRecurringDonationItems->Other; } if ($this->lblOther) { $this->lblOther->Text = $this->objRecurringDonationItems->Other; } }