コード例 #1
0
 /**
  * Refresh this MetaControl with Data from the local OnlineDonation object.
  * @param boolean $blnReload reload OnlineDonation from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objOnlineDonation->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objOnlineDonation->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->objOnlineDonation->Person && $this->objOnlineDonation->Person->Id == $objPerson->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstPerson->AddItem($objListItem);
             }
         }
     }
     if ($this->lblPersonId) {
         $this->lblPersonId->Text = $this->objOnlineDonation->Person ? $this->objOnlineDonation->Person->__toString() : null;
     }
     if ($this->txtConfirmationEmail) {
         $this->txtConfirmationEmail->Text = $this->objOnlineDonation->ConfirmationEmail;
     }
     if ($this->lblConfirmationEmail) {
         $this->lblConfirmationEmail->Text = $this->objOnlineDonation->ConfirmationEmail;
     }
     if ($this->txtAmount) {
         $this->txtAmount->Text = $this->objOnlineDonation->Amount;
     }
     if ($this->lblAmount) {
         $this->lblAmount->Text = $this->objOnlineDonation->Amount;
     }
     if ($this->lstCreditCardPayment) {
         $this->lstCreditCardPayment->RemoveAllItems();
         $this->lstCreditCardPayment->AddItem(QApplication::Translate('- Select One -'), null);
         $objCreditCardPaymentArray = CreditCardPayment::LoadAll();
         if ($objCreditCardPaymentArray) {
             foreach ($objCreditCardPaymentArray as $objCreditCardPayment) {
                 $objListItem = new QListItem($objCreditCardPayment->__toString(), $objCreditCardPayment->Id);
                 if ($this->objOnlineDonation->CreditCardPayment && $this->objOnlineDonation->CreditCardPayment->Id == $objCreditCardPayment->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstCreditCardPayment->AddItem($objListItem);
             }
         }
     }
     if ($this->lblCreditCardPaymentId) {
         $this->lblCreditCardPaymentId->Text = $this->objOnlineDonation->CreditCardPayment ? $this->objOnlineDonation->CreditCardPayment->__toString() : null;
     }
     if ($this->chkIsRecurringFlag) {
         $this->chkIsRecurringFlag->Checked = $this->objOnlineDonation->IsRecurringFlag;
     }
     if ($this->lblIsRecurringFlag) {
         $this->lblIsRecurringFlag->Text = $this->objOnlineDonation->IsRecurringFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
     }
     if ($this->txtStatus) {
         $this->txtStatus->Text = $this->objOnlineDonation->Status;
     }
     if ($this->lblStatus) {
         $this->lblStatus->Text = $this->objOnlineDonation->Status;
     }
     if ($this->lstRecurringPayment) {
         $this->lstRecurringPayment->RemoveAllItems();
         $this->lstRecurringPayment->AddItem(QApplication::Translate('- Select One -'), null);
         $objRecurringPaymentArray = RecurringPayments::LoadAll();
         if ($objRecurringPaymentArray) {
             foreach ($objRecurringPaymentArray as $objRecurringPayment) {
                 $objListItem = new QListItem($objRecurringPayment->__toString(), $objRecurringPayment->Id);
                 if ($this->objOnlineDonation->RecurringPayment && $this->objOnlineDonation->RecurringPayment->Id == $objRecurringPayment->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstRecurringPayment->AddItem($objListItem);
             }
         }
     }
     if ($this->lblRecurringPaymentId) {
         $this->lblRecurringPaymentId->Text = $this->objOnlineDonation->RecurringPayment ? $this->objOnlineDonation->RecurringPayment->__toString() : null;
     }
 }
コード例 #2
0
 /**
  * Refresh this MetaControl with Data from the local RecurringDonation object.
  * @param boolean $blnReload reload RecurringDonation from the database
  * @return void
  */
 public function Refresh($blnReload = false)
 {
     if ($blnReload) {
         $this->objRecurringDonation->Reload();
     }
     if ($this->lblId) {
         if ($this->blnEditMode) {
             $this->lblId->Text = $this->objRecurringDonation->Id;
         }
     }
     if ($this->txtPersonId) {
         $this->txtPersonId->Text = $this->objRecurringDonation->PersonId;
     }
     if ($this->lblPersonId) {
         $this->lblPersonId->Text = $this->objRecurringDonation->PersonId;
     }
     if ($this->lstRecurringPayment) {
         $this->lstRecurringPayment->RemoveAllItems();
         $this->lstRecurringPayment->AddItem(QApplication::Translate('- Select One -'), null);
         $objRecurringPaymentArray = RecurringPayments::LoadAll();
         if ($objRecurringPaymentArray) {
             foreach ($objRecurringPaymentArray as $objRecurringPayment) {
                 $objListItem = new QListItem($objRecurringPayment->__toString(), $objRecurringPayment->Id);
                 if ($this->objRecurringDonation->RecurringPayment && $this->objRecurringDonation->RecurringPayment->Id == $objRecurringPayment->Id) {
                     $objListItem->Selected = true;
                 }
                 $this->lstRecurringPayment->AddItem($objListItem);
             }
         }
     }
     if ($this->lblRecurringPaymentId) {
         $this->lblRecurringPaymentId->Text = $this->objRecurringDonation->RecurringPayment ? $this->objRecurringDonation->RecurringPayment->__toString() : null;
     }
     if ($this->txtAmount) {
         $this->txtAmount->Text = $this->objRecurringDonation->Amount;
     }
     if ($this->lblAmount) {
         $this->lblAmount->Text = $this->objRecurringDonation->Amount;
     }
     if ($this->txtConfirmationEmail) {
         $this->txtConfirmationEmail->Text = $this->objRecurringDonation->ConfirmationEmail;
     }
     if ($this->lblConfirmationEmail) {
         $this->lblConfirmationEmail->Text = $this->objRecurringDonation->ConfirmationEmail;
     }
 }