protected function pxyEditFundSignupPayment_Click($strFormid, $strControlId, $strParameter) { $this->strEditingCode = substr($strParameter, 0, 1); $objSignupPayment = SignupPayment::Load(substr($strParameter, 1)); if ($objSignupPayment->CreditCardPayment->PaypalBatchId == $this->objBatch->Id) { $this->objEditing = $objSignupPayment; $this->lblDialogSplitFund->Text = 'Please specify the Funding account Details for the two separate line items you wish to split into The amount to be split is: $' . $objSignupPayment->Amount; if ($this->strEditingCode == 'd') { $this->lstDialogFund->SelectedValue = $objSignupPayment->DonationStewardshipFundId; } else { throw new Exception('Should Not Be Here -- Event Funds No Longer Editable'); } $this->dlgEditFund->ShowDialogBox(); $this->lstDialogFund_Change(); } }
public static function GetSoapArrayFromArray($objArray) { if (!$objArray) { return null; } $objArrayToReturn = array(); foreach ($objArray as $objObject) { array_push($objArrayToReturn, SignupPayment::GetSoapObjectFromObject($objObject, true)); } return unserialize(serialize($objArrayToReturn)); }
/** * Deletes all associated SignupPayments * @return void */ public function DeleteAllSignupPayments() { if (is_null($this->intId)) { throw new QUndefinedPrimaryKeyException('Unable to call UnassociateSignupPayment on this unsaved SignupEntry.'); } // Get the Database Object for this Class $objDatabase = SignupEntry::GetDatabase(); // Journaling if ($objDatabase->JournalingDatabase) { foreach (SignupPayment::LoadArrayBySignupEntryId($this->intId) as $objSignupPayment) { $objSignupPayment->Journal('DELETE'); } } // Perform the SQL Query $objDatabase->NonQuery(' DELETE FROM `signup_payment` WHERE `signup_entry_id` = ' . $objDatabase->SqlVariable($this->intId) . ' '); }
/** * Adds a payment records for this Entry * @param integer $intSignupPaymentTypeId * @param float $fltAmount * @param string $strTransactionDescription * @param QDateTime $dttTransactionDate optional, uses Now() if nothing is passed in * @return SignupPayment */ public function AddPayment($intSignupPaymentTypeId, $fltAmount, $strTransactionDescription, QDateTime $dttTransactionDate = null) { $objSignupPayment = new SignupPayment(); $objSignupPayment->SignupEntry = $this; $objSignupPayment->SignupPaymentTypeId = $intSignupPaymentTypeId; $objSignupPayment->TransactionDate = $dttTransactionDate ? $dttTransactionDate : QDateTime::Now(); $objSignupPayment->TransactionDescription = $strTransactionDescription; $objSignupPayment->Amount = $fltAmount; $objSignupPayment->Save(); $this->RefreshAmounts(); return $objSignupPayment; }
/** * @return boolean whether or not the save was successful */ protected function PerformPaymentSave() { if (!$this->objPayment->TransactionDate) { $this->objPayment->TransactionDate = QDateTime::Now(); } $this->objPayment->TransactionDescription = trim($this->txtTextbox->Text); $this->objPayment->Amount = $this->txtFloat->Text; $this->objPayment->Save(); return true; }
/** * Override method to perform a property "Get" * This will get the value of $strName * * @param string $strName Name of the property to get * @return mixed */ public function __get($strName) { switch ($strName) { /////////////////// // Member Variables /////////////////// case 'Id': // Gets the value for intId (Read-Only PK) // @return integer return $this->intId; case 'CreditCardStatusTypeId': // Gets the value for intCreditCardStatusTypeId (Not Null) // @return integer return $this->intCreditCardStatusTypeId; case 'CreditCardTypeId': // Gets the value for intCreditCardTypeId (Not Null) // @return integer return $this->intCreditCardTypeId; case 'CreditCardLastFour': // Gets the value for strCreditCardLastFour (Not Null) // @return string return $this->strCreditCardLastFour; case 'TransactionCode': // Gets the value for strTransactionCode (Unique) // @return string return $this->strTransactionCode; case 'AuthorizationCode': // Gets the value for strAuthorizationCode // @return string return $this->strAuthorizationCode; case 'AddressMatchCode': // Gets the value for strAddressMatchCode // @return string return $this->strAddressMatchCode; case 'DateAuthorized': // Gets the value for dttDateAuthorized // @return QDateTime return $this->dttDateAuthorized; case 'DateCaptured': // Gets the value for dttDateCaptured // @return QDateTime return $this->dttDateCaptured; case 'AmountCharged': // Gets the value for fltAmountCharged // @return double return $this->fltAmountCharged; case 'AmountFee': // Gets the value for fltAmountFee // @return double return $this->fltAmountFee; case 'AmountCleared': // Gets the value for fltAmountCleared // @return double return $this->fltAmountCleared; case 'PaypalBatchId': // Gets the value for intPaypalBatchId // @return integer return $this->intPaypalBatchId; case 'UnlinkedFlag': // Gets the value for blnUnlinkedFlag // @return boolean return $this->blnUnlinkedFlag; case 'StewardshipContributionId': // Gets the value for intStewardshipContributionId (Unique) // @return integer return $this->intStewardshipContributionId; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'PaypalBatch': // Gets the value for the PaypalBatch object referenced by intPaypalBatchId // @return PaypalBatch try { if (!$this->objPaypalBatch && !is_null($this->intPaypalBatchId)) { $this->objPaypalBatch = PaypalBatch::Load($this->intPaypalBatchId); } return $this->objPaypalBatch; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'StewardshipContribution': // Gets the value for the StewardshipContribution object referenced by intStewardshipContributionId (Unique) // @return StewardshipContribution try { if (!$this->objStewardshipContribution && !is_null($this->intStewardshipContributionId)) { $this->objStewardshipContribution = StewardshipContribution::Load($this->intStewardshipContributionId); } return $this->objStewardshipContribution; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'OnlineDonation': // Gets the value for the OnlineDonation object that uniquely references this CreditCardPayment // by objOnlineDonation (Unique) // @return OnlineDonation try { if ($this->objOnlineDonation === false) { // We've attempted early binding -- and the reverse reference object does not exist return null; } if (!$this->objOnlineDonation) { $this->objOnlineDonation = OnlineDonation::LoadByCreditCardPaymentId($this->intId); } return $this->objOnlineDonation; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'SignupPayment': // Gets the value for the SignupPayment object that uniquely references this CreditCardPayment // by objSignupPayment (Unique) // @return SignupPayment try { if ($this->objSignupPayment === false) { // We've attempted early binding -- and the reverse reference object does not exist return null; } if (!$this->objSignupPayment) { $this->objSignupPayment = SignupPayment::LoadByCreditCardPaymentId($this->intId); } return $this->objSignupPayment; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }
/** * Static Helper Method to Create using PK arguments * You must pass in the PK arguments on an object to load, or leave it blank to create a new one. * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo * static helper methods. Finally, specify a CreateType to define whether or not we are only allowed to * edit, or if we are also allowed to create a new one, etc. * * @param mixed $objParentObject QForm or QPanel which will be using this SignupPaymentMetaControl * @param integer $intId primary key value * @param QMetaControlCreateType $intCreateType rules governing SignupPayment object creation - defaults to CreateOrEdit * @return SignupPaymentMetaControl */ public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) { // Attempt to Load from PK Arguments if (strlen($intId)) { $objSignupPayment = SignupPayment::Load($intId); // SignupPayment was found -- return it! if ($objSignupPayment) { return new SignupPaymentMetaControl($objParentObject, $objSignupPayment); } else { if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) { throw new QCallerException('Could not find a SignupPayment object with PK arguments: ' . $intId); } } // If EditOnly is specified, throw an exception } else { if ($intCreateType == QMetaControlCreateType::EditOnly) { throw new QCallerException('No PK arguments specified'); } } // If we are here, then we need to create a new record return new SignupPaymentMetaControl($objParentObject, new SignupPayment()); }
/** * Main utility method to aid with data binding. It is used by the default BindAllRows() databinder but * could and should be used by any custom databind methods that would be used for instances of this * MetaDataGrid, by simply passing in a custom QQCondition and/or QQClause. * * 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). * * @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query * @return void */ public function MetaDataBinder(QQCondition $objCondition = null, $objOptionalClauses = null) { // Setup input parameters to default values if none passed in if (!$objCondition) { $objCondition = QQ::All(); } $objClauses = $objOptionalClauses ? $objOptionalClauses : array(); // We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below if ($this->Paginator) { $this->TotalItemCount = SignupPayment::QueryCount($objCondition, $objClauses); } // 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 SignupPayment, given the clauses above $this->DataSource = SignupPayment::QueryArray($objCondition, $objClauses); }
/** * This will save this object's CreditCardPayment instance, * updating only the fields which have had a control created for it. */ public function SaveCreditCardPayment() { try { // Update any fields for controls that have been created if ($this->lstCreditCardStatusType) { $this->objCreditCardPayment->CreditCardStatusTypeId = $this->lstCreditCardStatusType->SelectedValue; } if ($this->lstCreditCardType) { $this->objCreditCardPayment->CreditCardTypeId = $this->lstCreditCardType->SelectedValue; } if ($this->txtCreditCardLastFour) { $this->objCreditCardPayment->CreditCardLastFour = $this->txtCreditCardLastFour->Text; } if ($this->txtTransactionCode) { $this->objCreditCardPayment->TransactionCode = $this->txtTransactionCode->Text; } if ($this->txtAuthorizationCode) { $this->objCreditCardPayment->AuthorizationCode = $this->txtAuthorizationCode->Text; } if ($this->txtAddressMatchCode) { $this->objCreditCardPayment->AddressMatchCode = $this->txtAddressMatchCode->Text; } if ($this->calDateAuthorized) { $this->objCreditCardPayment->DateAuthorized = $this->calDateAuthorized->DateTime; } if ($this->calDateCaptured) { $this->objCreditCardPayment->DateCaptured = $this->calDateCaptured->DateTime; } if ($this->txtAmountCharged) { $this->objCreditCardPayment->AmountCharged = $this->txtAmountCharged->Text; } if ($this->txtAmountFee) { $this->objCreditCardPayment->AmountFee = $this->txtAmountFee->Text; } if ($this->txtAmountCleared) { $this->objCreditCardPayment->AmountCleared = $this->txtAmountCleared->Text; } if ($this->lstPaypalBatch) { $this->objCreditCardPayment->PaypalBatchId = $this->lstPaypalBatch->SelectedValue; } if ($this->chkUnlinkedFlag) { $this->objCreditCardPayment->UnlinkedFlag = $this->chkUnlinkedFlag->Checked; } if ($this->lstStewardshipContribution) { $this->objCreditCardPayment->StewardshipContributionId = $this->lstStewardshipContribution->SelectedValue; } // Update any UniqueReverseReferences (if any) for controls that have been created for it if ($this->lstOnlineDonation) { $this->objCreditCardPayment->OnlineDonation = OnlineDonation::Load($this->lstOnlineDonation->SelectedValue); } if ($this->lstSignupPayment) { $this->objCreditCardPayment->SignupPayment = SignupPayment::Load($this->lstSignupPayment->SelectedValue); } // Save the CreditCardPayment object $this->objCreditCardPayment->Save(); // Finally, update any ManyToManyReferences (if any) } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } }