Ejemplo n.º 1
0
Archivo: view.php Proyecto: alcf/chms
 public function pxySetCurrentHomeAddress_Click($strFormId, $strControlId, $strParameter)
 {
     // Get and validate Address object
     $objAddress = Address::Load($strParameter);
     if (!$objAddress) {
         return;
     }
     if ($objAddress->HouseholdId != $this->objHousehold->Id) {
         return;
     }
     $this->objHousehold->SetAsCurrentAddress($objAddress);
     $this->dtgHomeAddresses->Refresh();
 }
Ejemplo n.º 2
0
 protected function SetupAddress()
 {
     // Lookup Object PK information from Query String (if applicable)
     // Set mode to Edit or New depending on what's found
     $intAddressId = QApplication::QueryString('intAddressId');
     if ($intAddressId) {
         $this->objAddress = Address::Load($intAddressId);
         if (!$this->objAddress) {
             throw new Exception('Could not find a Address object with PK arguments: ' . $intAddressId);
         }
         $this->strTitleVerb = QApplication::Translate('Edit');
         $this->blnEditMode = true;
     } else {
         $this->objAddress = new Address();
         $this->strTitleVerb = QApplication::Translate('Create');
         $this->blnEditMode = false;
     }
 }
Ejemplo n.º 3
0
 /**
  * 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 'SignupEntryId':
             // Gets the value for intSignupEntryId (Not Null)
             // @return integer
             return $this->intSignupEntryId;
         case 'FormQuestionId':
             // Gets the value for intFormQuestionId (Not Null)
             // @return integer
             return $this->intFormQuestionId;
         case 'TextValue':
             // Gets the value for strTextValue
             // @return string
             return $this->strTextValue;
         case 'AddressId':
             // Gets the value for intAddressId
             // @return integer
             return $this->intAddressId;
         case 'PhoneId':
             // Gets the value for intPhoneId
             // @return integer
             return $this->intPhoneId;
         case 'EmailId':
             // Gets the value for intEmailId
             // @return integer
             return $this->intEmailId;
         case 'IntegerValue':
             // Gets the value for intIntegerValue
             // @return integer
             return $this->intIntegerValue;
         case 'BooleanValue':
             // Gets the value for blnBooleanValue
             // @return boolean
             return $this->blnBooleanValue;
         case 'DateValue':
             // Gets the value for dttDateValue
             // @return QDateTime
             return $this->dttDateValue;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'SignupEntry':
             // Gets the value for the SignupEntry object referenced by intSignupEntryId (Not Null)
             // @return SignupEntry
             try {
                 if (!$this->objSignupEntry && !is_null($this->intSignupEntryId)) {
                     $this->objSignupEntry = SignupEntry::Load($this->intSignupEntryId);
                 }
                 return $this->objSignupEntry;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'FormQuestion':
             // Gets the value for the FormQuestion object referenced by intFormQuestionId (Not Null)
             // @return FormQuestion
             try {
                 if (!$this->objFormQuestion && !is_null($this->intFormQuestionId)) {
                     $this->objFormQuestion = FormQuestion::Load($this->intFormQuestionId);
                 }
                 return $this->objFormQuestion;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Address':
             // Gets the value for the Address object referenced by intAddressId
             // @return Address
             try {
                 if (!$this->objAddress && !is_null($this->intAddressId)) {
                     $this->objAddress = Address::Load($this->intAddressId);
                 }
                 return $this->objAddress;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Phone':
             // Gets the value for the Phone object referenced by intPhoneId
             // @return Phone
             try {
                 if (!$this->objPhone && !is_null($this->intPhoneId)) {
                     $this->objPhone = Phone::Load($this->intPhoneId);
                 }
                 return $this->objPhone;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Email':
             // Gets the value for the Email object referenced by intEmailId
             // @return Email
             try {
                 if (!$this->objEmail && !is_null($this->intEmailId)) {
                     $this->objEmail = Email::Load($this->intEmailId);
                 }
                 return $this->objEmail;
             } 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;
             }
     }
 }
Ejemplo n.º 4
0
 /**
  * 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 'CompanyId':
             // Gets the value for intCompanyId (Read-Only PK)
             // @return integer
             return $this->intCompanyId;
         case 'AddressId':
             // Gets the value for intAddressId
             // @return integer
             return $this->intAddressId;
         case 'ShortDescription':
             // Gets the value for strShortDescription (Unique)
             // @return string
             return $this->strShortDescription;
         case 'Website':
             // Gets the value for strWebsite
             // @return string
             return $this->strWebsite;
         case 'Telephone':
             // Gets the value for strTelephone
             // @return string
             return $this->strTelephone;
         case 'Fax':
             // Gets the value for strFax
             // @return string
             return $this->strFax;
         case 'Email':
             // Gets the value for strEmail
             // @return string
             return $this->strEmail;
         case 'LongDescription':
             // Gets the value for strLongDescription
             // @return string
             return $this->strLongDescription;
         case 'CreatedBy':
             // Gets the value for intCreatedBy
             // @return integer
             return $this->intCreatedBy;
         case 'CreationDate':
             // Gets the value for dttCreationDate
             // @return QDateTime
             return $this->dttCreationDate;
         case 'ModifiedBy':
             // Gets the value for intModifiedBy
             // @return integer
             return $this->intModifiedBy;
         case 'ModifiedDate':
             // Gets the value for strModifiedDate (Read-Only Timestamp)
             // @return string
             return $this->strModifiedDate;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'Address':
             // Gets the value for the Address object referenced by intAddressId
             // @return Address
             try {
                 if (!$this->objAddress && !is_null($this->intAddressId)) {
                     $this->objAddress = Address::Load($this->intAddressId);
                 }
                 return $this->objAddress;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'CreatedByObject':
             // Gets the value for the UserAccount object referenced by intCreatedBy
             // @return UserAccount
             try {
                 if (!$this->objCreatedByObject && !is_null($this->intCreatedBy)) {
                     $this->objCreatedByObject = UserAccount::Load($this->intCreatedBy);
                 }
                 return $this->objCreatedByObject;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ModifiedByObject':
             // Gets the value for the UserAccount object referenced by intModifiedBy
             // @return UserAccount
             try {
                 if (!$this->objModifiedByObject && !is_null($this->intModifiedBy)) {
                     $this->objModifiedByObject = UserAccount::Load($this->intModifiedBy);
                 }
                 return $this->objModifiedByObject;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'CompanyCustomFieldHelper':
             // Gets the value for the CompanyCustomFieldHelper object that uniquely references this Company
             // by objCompanyCustomFieldHelper (Unique)
             // @return CompanyCustomFieldHelper
             try {
                 if ($this->objCompanyCustomFieldHelper === false) {
                     // We've attempted early binding -- and the reverse reference object does not exist
                     return null;
                 }
                 if (!$this->objCompanyCustomFieldHelper) {
                     $this->objCompanyCustomFieldHelper = CompanyCustomFieldHelper::LoadByCompanyId($this->intCompanyId);
                 }
                 return $this->objCompanyCustomFieldHelper;
             } 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 '_Address':
             // Gets the value for the private _objAddress (Read-Only)
             // if set due to an expansion on the address.company_id reverse relationship
             // @return Address
             return $this->_objAddress;
         case '_AddressArray':
             // Gets the value for the private _objAddressArray (Read-Only)
             // if set due to an ExpandAsArray on the address.company_id reverse relationship
             // @return Address[]
             return (array) $this->_objAddressArray;
         case '_Contact':
             // Gets the value for the private _objContact (Read-Only)
             // if set due to an expansion on the contact.company_id reverse relationship
             // @return Contact
             return $this->_objContact;
         case '_ContactArray':
             // Gets the value for the private _objContactArray (Read-Only)
             // if set due to an ExpandAsArray on the contact.company_id reverse relationship
             // @return Contact[]
             return (array) $this->_objContactArray;
         case '_ReceiptAsFrom':
             // Gets the value for the private _objReceiptAsFrom (Read-Only)
             // if set due to an expansion on the receipt.from_company_id reverse relationship
             // @return Receipt
             return $this->_objReceiptAsFrom;
         case '_ReceiptAsFromArray':
             // Gets the value for the private _objReceiptAsFromArray (Read-Only)
             // if set due to an ExpandAsArray on the receipt.from_company_id reverse relationship
             // @return Receipt[]
             return (array) $this->_objReceiptAsFromArray;
         case '_ShipmentAsFrom':
             // Gets the value for the private _objShipmentAsFrom (Read-Only)
             // if set due to an expansion on the shipment.from_company_id reverse relationship
             // @return Shipment
             return $this->_objShipmentAsFrom;
         case '_ShipmentAsFromArray':
             // Gets the value for the private _objShipmentAsFromArray (Read-Only)
             // if set due to an ExpandAsArray on the shipment.from_company_id reverse relationship
             // @return Shipment[]
             return (array) $this->_objShipmentAsFromArray;
         case '_ShipmentAsTo':
             // Gets the value for the private _objShipmentAsTo (Read-Only)
             // if set due to an expansion on the shipment.to_company_id reverse relationship
             // @return Shipment
             return $this->_objShipmentAsTo;
         case '_ShipmentAsToArray':
             // Gets the value for the private _objShipmentAsToArray (Read-Only)
             // if set due to an ExpandAsArray on the shipment.to_company_id reverse relationship
             // @return Shipment[]
             return (array) $this->_objShipmentAsToArray;
         case '__Restored':
             return $this->__blnRestored;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
Ejemplo n.º 5
0
 /**
  * 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 'ShipmentId':
             // Gets the value for intShipmentId (Read-Only PK)
             // @return integer
             return $this->intShipmentId;
         case 'ShipmentNumber':
             // Gets the value for strShipmentNumber (Unique)
             // @return string
             return $this->strShipmentNumber;
         case 'TransactionId':
             // Gets the value for intTransactionId (Unique)
             // @return integer
             return $this->intTransactionId;
         case 'FromCompanyId':
             // Gets the value for intFromCompanyId (Not Null)
             // @return integer
             return $this->intFromCompanyId;
         case 'FromContactId':
             // Gets the value for intFromContactId (Not Null)
             // @return integer
             return $this->intFromContactId;
         case 'FromAddressId':
             // Gets the value for intFromAddressId (Not Null)
             // @return integer
             return $this->intFromAddressId;
         case 'ToCompanyId':
             // Gets the value for intToCompanyId (Not Null)
             // @return integer
             return $this->intToCompanyId;
         case 'ToContactId':
             // Gets the value for intToContactId (Not Null)
             // @return integer
             return $this->intToContactId;
         case 'ToAddressId':
             // Gets the value for intToAddressId (Not Null)
             // @return integer
             return $this->intToAddressId;
         case 'CourierId':
             // Gets the value for intCourierId
             // @return integer
             return $this->intCourierId;
         case 'TrackingNumber':
             // Gets the value for strTrackingNumber
             // @return string
             return $this->strTrackingNumber;
         case 'ShipDate':
             // Gets the value for dttShipDate (Not Null)
             // @return QDateTime
             return $this->dttShipDate;
         case 'ShippedFlag':
             // Gets the value for blnShippedFlag
             // @return boolean
             return $this->blnShippedFlag;
         case 'CreatedBy':
             // Gets the value for intCreatedBy
             // @return integer
             return $this->intCreatedBy;
         case 'CreationDate':
             // Gets the value for dttCreationDate
             // @return QDateTime
             return $this->dttCreationDate;
         case 'ModifiedBy':
             // Gets the value for intModifiedBy
             // @return integer
             return $this->intModifiedBy;
         case 'ModifiedDate':
             // Gets the value for strModifiedDate (Read-Only Timestamp)
             // @return string
             return $this->strModifiedDate;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'Transaction':
             // Gets the value for the Transaction object referenced by intTransactionId (Unique)
             // @return Transaction
             try {
                 if (!$this->objTransaction && !is_null($this->intTransactionId)) {
                     $this->objTransaction = Transaction::Load($this->intTransactionId);
                 }
                 return $this->objTransaction;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'FromCompany':
             // Gets the value for the Company object referenced by intFromCompanyId (Not Null)
             // @return Company
             try {
                 if (!$this->objFromCompany && !is_null($this->intFromCompanyId)) {
                     $this->objFromCompany = Company::Load($this->intFromCompanyId);
                 }
                 return $this->objFromCompany;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'FromContact':
             // Gets the value for the Contact object referenced by intFromContactId (Not Null)
             // @return Contact
             try {
                 if (!$this->objFromContact && !is_null($this->intFromContactId)) {
                     $this->objFromContact = Contact::Load($this->intFromContactId);
                 }
                 return $this->objFromContact;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'FromAddress':
             // Gets the value for the Address object referenced by intFromAddressId (Not Null)
             // @return Address
             try {
                 if (!$this->objFromAddress && !is_null($this->intFromAddressId)) {
                     $this->objFromAddress = Address::Load($this->intFromAddressId);
                 }
                 return $this->objFromAddress;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ToCompany':
             // Gets the value for the Company object referenced by intToCompanyId (Not Null)
             // @return Company
             try {
                 if (!$this->objToCompany && !is_null($this->intToCompanyId)) {
                     $this->objToCompany = Company::Load($this->intToCompanyId);
                 }
                 return $this->objToCompany;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ToContact':
             // Gets the value for the Contact object referenced by intToContactId (Not Null)
             // @return Contact
             try {
                 if (!$this->objToContact && !is_null($this->intToContactId)) {
                     $this->objToContact = Contact::Load($this->intToContactId);
                 }
                 return $this->objToContact;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ToAddress':
             // Gets the value for the Address object referenced by intToAddressId (Not Null)
             // @return Address
             try {
                 if (!$this->objToAddress && !is_null($this->intToAddressId)) {
                     $this->objToAddress = Address::Load($this->intToAddressId);
                 }
                 return $this->objToAddress;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Courier':
             // Gets the value for the Courier object referenced by intCourierId
             // @return Courier
             try {
                 if (!$this->objCourier && !is_null($this->intCourierId)) {
                     $this->objCourier = Courier::Load($this->intCourierId);
                 }
                 return $this->objCourier;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'CreatedByObject':
             // Gets the value for the UserAccount object referenced by intCreatedBy
             // @return UserAccount
             try {
                 if (!$this->objCreatedByObject && !is_null($this->intCreatedBy)) {
                     $this->objCreatedByObject = UserAccount::Load($this->intCreatedBy);
                 }
                 return $this->objCreatedByObject;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ModifiedByObject':
             // Gets the value for the UserAccount object referenced by intModifiedBy
             // @return UserAccount
             try {
                 if (!$this->objModifiedByObject && !is_null($this->intModifiedBy)) {
                     $this->objModifiedByObject = UserAccount::Load($this->intModifiedBy);
                 }
                 return $this->objModifiedByObject;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ShipmentCustomFieldHelper':
             // Gets the value for the ShipmentCustomFieldHelper object that uniquely references this Shipment
             // by objShipmentCustomFieldHelper (Unique)
             // @return ShipmentCustomFieldHelper
             try {
                 if ($this->objShipmentCustomFieldHelper === false) {
                     // We've attempted early binding -- and the reverse reference object does not exist
                     return null;
                 }
                 if (!$this->objShipmentCustomFieldHelper) {
                     $this->objShipmentCustomFieldHelper = ShipmentCustomFieldHelper::LoadByShipmentId($this->intShipmentId);
                 }
                 return $this->objShipmentCustomFieldHelper;
             } 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;
             }
     }
 }
Ejemplo n.º 6
0
 /**
  * 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 'MembershipStatusTypeId':
             // Gets the value for intMembershipStatusTypeId (Not Null)
             // @return integer
             return $this->intMembershipStatusTypeId;
         case 'MaritalStatusTypeId':
             // Gets the value for intMaritalStatusTypeId (Not Null)
             // @return integer
             return $this->intMaritalStatusTypeId;
         case 'FirstName':
             // Gets the value for strFirstName
             // @return string
             return $this->strFirstName;
         case 'MiddleName':
             // Gets the value for strMiddleName
             // @return string
             return $this->strMiddleName;
         case 'LastName':
             // Gets the value for strLastName
             // @return string
             return $this->strLastName;
         case 'MailingLabel':
             // Gets the value for strMailingLabel
             // @return string
             return $this->strMailingLabel;
         case 'PriorLastNames':
             // Gets the value for strPriorLastNames
             // @return string
             return $this->strPriorLastNames;
         case 'Nickname':
             // Gets the value for strNickname
             // @return string
             return $this->strNickname;
         case 'Title':
             // Gets the value for strTitle
             // @return string
             return $this->strTitle;
         case 'Suffix':
             // Gets the value for strSuffix
             // @return string
             return $this->strSuffix;
         case 'Gender':
             // Gets the value for strGender
             // @return string
             return $this->strGender;
         case 'DateOfBirth':
             // Gets the value for dttDateOfBirth
             // @return QDateTime
             return $this->dttDateOfBirth;
         case 'DobYearApproximateFlag':
             // Gets the value for blnDobYearApproximateFlag
             // @return boolean
             return $this->blnDobYearApproximateFlag;
         case 'DobGuessedFlag':
             // Gets the value for blnDobGuessedFlag
             // @return boolean
             return $this->blnDobGuessedFlag;
         case 'Age':
             // Gets the value for intAge
             // @return integer
             return $this->intAge;
         case 'DeceasedFlag':
             // Gets the value for blnDeceasedFlag (Not Null)
             // @return boolean
             return $this->blnDeceasedFlag;
         case 'DateDeceased':
             // Gets the value for dttDateDeceased
             // @return QDateTime
             return $this->dttDateDeceased;
         case 'CurrentHeadShotId':
             // Gets the value for intCurrentHeadShotId (Unique)
             // @return integer
             return $this->intCurrentHeadShotId;
         case 'MailingAddressId':
             // Gets the value for intMailingAddressId
             // @return integer
             return $this->intMailingAddressId;
         case 'StewardshipAddressId':
             // Gets the value for intStewardshipAddressId
             // @return integer
             return $this->intStewardshipAddressId;
         case 'PrimaryPhoneId':
             // Gets the value for intPrimaryPhoneId
             // @return integer
             return $this->intPrimaryPhoneId;
         case 'PrimaryEmailId':
             // Gets the value for intPrimaryEmailId (Unique)
             // @return integer
             return $this->intPrimaryEmailId;
         case 'CanMailFlag':
             // Gets the value for blnCanMailFlag
             // @return boolean
             return $this->blnCanMailFlag;
         case 'CanPhoneFlag':
             // Gets the value for blnCanPhoneFlag
             // @return boolean
             return $this->blnCanPhoneFlag;
         case 'CanEmailFlag':
             // Gets the value for blnCanEmailFlag
             // @return boolean
             return $this->blnCanEmailFlag;
         case 'PrimaryAddressText':
             // Gets the value for strPrimaryAddressText
             // @return string
             return $this->strPrimaryAddressText;
         case 'PrimaryCityText':
             // Gets the value for strPrimaryCityText
             // @return string
             return $this->strPrimaryCityText;
         case 'PrimaryStateText':
             // Gets the value for strPrimaryStateText
             // @return string
             return $this->strPrimaryStateText;
         case 'PrimaryZipCodeText':
             // Gets the value for strPrimaryZipCodeText
             // @return string
             return $this->strPrimaryZipCodeText;
         case 'PrimaryPhoneText':
             // Gets the value for strPrimaryPhoneText
             // @return string
             return $this->strPrimaryPhoneText;
         case 'PublicCreationFlag':
             // Gets the value for blnPublicCreationFlag
             // @return boolean
             return $this->blnPublicCreationFlag;
         case 'CoPrimary':
             // Gets the value for intCoPrimary
             // @return integer
             return $this->intCoPrimary;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'CurrentHeadShot':
             // Gets the value for the HeadShot object referenced by intCurrentHeadShotId (Unique)
             // @return HeadShot
             try {
                 if (!$this->objCurrentHeadShot && !is_null($this->intCurrentHeadShotId)) {
                     $this->objCurrentHeadShot = HeadShot::Load($this->intCurrentHeadShotId);
                 }
                 return $this->objCurrentHeadShot;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'MailingAddress':
             // Gets the value for the Address object referenced by intMailingAddressId
             // @return Address
             try {
                 if (!$this->objMailingAddress && !is_null($this->intMailingAddressId)) {
                     $this->objMailingAddress = Address::Load($this->intMailingAddressId);
                 }
                 return $this->objMailingAddress;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'StewardshipAddress':
             // Gets the value for the Address object referenced by intStewardshipAddressId
             // @return Address
             try {
                 if (!$this->objStewardshipAddress && !is_null($this->intStewardshipAddressId)) {
                     $this->objStewardshipAddress = Address::Load($this->intStewardshipAddressId);
                 }
                 return $this->objStewardshipAddress;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'PrimaryPhone':
             // Gets the value for the Phone object referenced by intPrimaryPhoneId
             // @return Phone
             try {
                 if (!$this->objPrimaryPhone && !is_null($this->intPrimaryPhoneId)) {
                     $this->objPrimaryPhone = Phone::Load($this->intPrimaryPhoneId);
                 }
                 return $this->objPrimaryPhone;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'PrimaryEmail':
             // Gets the value for the Email object referenced by intPrimaryEmailId (Unique)
             // @return Email
             try {
                 if (!$this->objPrimaryEmail && !is_null($this->intPrimaryEmailId)) {
                     $this->objPrimaryEmail = Email::Load($this->intPrimaryEmailId);
                 }
                 return $this->objPrimaryEmail;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'CoPrimaryObject':
             // Gets the value for the Person object referenced by intCoPrimary
             // @return Person
             try {
                 if (!$this->objCoPrimaryObject && !is_null($this->intCoPrimary)) {
                     $this->objCoPrimaryObject = Person::Load($this->intCoPrimary);
                 }
                 return $this->objCoPrimaryObject;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'HouseholdAsHead':
             // Gets the value for the Household object that uniquely references this Person
             // by objHouseholdAsHead (Unique)
             // @return Household
             try {
                 if ($this->objHouseholdAsHead === false) {
                     // We've attempted early binding -- and the reverse reference object does not exist
                     return null;
                 }
                 if (!$this->objHouseholdAsHead) {
                     $this->objHouseholdAsHead = Household::LoadByHeadPersonId($this->intId);
                 }
                 return $this->objHouseholdAsHead;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'PublicLogin':
             // Gets the value for the PublicLogin object that uniquely references this Person
             // by objPublicLogin (Unique)
             // @return PublicLogin
             try {
                 if ($this->objPublicLogin === false) {
                     // We've attempted early binding -- and the reverse reference object does not exist
                     return null;
                 }
                 if (!$this->objPublicLogin) {
                     $this->objPublicLogin = PublicLogin::LoadByPersonId($this->intId);
                 }
                 return $this->objPublicLogin;
             } 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 '_CheckingAccountLookup':
             // Gets the value for the private _objCheckingAccountLookup (Read-Only)
             // if set due to an expansion on the checkingaccountlookup_person_assn association table
             // @return CheckingAccountLookup
             return $this->_objCheckingAccountLookup;
         case '_CheckingAccountLookupArray':
             // Gets the value for the private _objCheckingAccountLookupArray (Read-Only)
             // if set due to an ExpandAsArray on the checkingaccountlookup_person_assn association table
             // @return CheckingAccountLookup[]
             return (array) $this->_objCheckingAccountLookupArray;
         case '_CommunicationList':
             // Gets the value for the private _objCommunicationList (Read-Only)
             // if set due to an expansion on the communicationlist_person_assn association table
             // @return CommunicationList
             return $this->_objCommunicationList;
         case '_CommunicationListArray':
             // Gets the value for the private _objCommunicationListArray (Read-Only)
             // if set due to an ExpandAsArray on the communicationlist_person_assn association table
             // @return CommunicationList[]
             return (array) $this->_objCommunicationListArray;
         case '_NameItem':
             // Gets the value for the private _objNameItem (Read-Only)
             // if set due to an expansion on the person_nameitem_assn association table
             // @return NameItem
             return $this->_objNameItem;
         case '_NameItemArray':
             // Gets the value for the private _objNameItemArray (Read-Only)
             // if set due to an ExpandAsArray on the person_nameitem_assn association table
             // @return NameItem[]
             return (array) $this->_objNameItemArray;
         case '_Address':
             // Gets the value for the private _objAddress (Read-Only)
             // if set due to an expansion on the address.person_id reverse relationship
             // @return Address
             return $this->_objAddress;
         case '_AddressArray':
             // Gets the value for the private _objAddressArray (Read-Only)
             // if set due to an ExpandAsArray on the address.person_id reverse relationship
             // @return Address[]
             return (array) $this->_objAddressArray;
         case '_AttributeValue':
             // Gets the value for the private _objAttributeValue (Read-Only)
             // if set due to an expansion on the attribute_value.person_id reverse relationship
             // @return AttributeValue
             return $this->_objAttributeValue;
         case '_AttributeValueArray':
             // Gets the value for the private _objAttributeValueArray (Read-Only)
             // if set due to an ExpandAsArray on the attribute_value.person_id reverse relationship
             // @return AttributeValue[]
             return (array) $this->_objAttributeValueArray;
         case '_ClassRegistration':
             // Gets the value for the private _objClassRegistration (Read-Only)
             // if set due to an expansion on the class_registration.person_id reverse relationship
             // @return ClassRegistration
             return $this->_objClassRegistration;
         case '_ClassRegistrationArray':
             // Gets the value for the private _objClassRegistrationArray (Read-Only)
             // if set due to an ExpandAsArray on the class_registration.person_id reverse relationship
             // @return ClassRegistration[]
             return (array) $this->_objClassRegistrationArray;
         case '_Comment':
             // Gets the value for the private _objComment (Read-Only)
             // if set due to an expansion on the comment.person_id reverse relationship
             // @return Comment
             return $this->_objComment;
         case '_CommentArray':
             // Gets the value for the private _objCommentArray (Read-Only)
             // if set due to an ExpandAsArray on the comment.person_id reverse relationship
             // @return Comment[]
             return (array) $this->_objCommentArray;
         case '_Email':
             // Gets the value for the private _objEmail (Read-Only)
             // if set due to an expansion on the email.person_id reverse relationship
             // @return Email
             return $this->_objEmail;
         case '_EmailArray':
             // Gets the value for the private _objEmailArray (Read-Only)
             // if set due to an ExpandAsArray on the email.person_id reverse relationship
             // @return Email[]
             return (array) $this->_objEmailArray;
         case '_EmailMessageRoute':
             // Gets the value for the private _objEmailMessageRoute (Read-Only)
             // if set due to an expansion on the email_message_route.person_id reverse relationship
             // @return EmailMessageRoute
             return $this->_objEmailMessageRoute;
         case '_EmailMessageRouteArray':
             // Gets the value for the private _objEmailMessageRouteArray (Read-Only)
             // if set due to an ExpandAsArray on the email_message_route.person_id reverse relationship
             // @return EmailMessageRoute[]
             return (array) $this->_objEmailMessageRouteArray;
         case '_GroupAuthorizedSender':
             // Gets the value for the private _objGroupAuthorizedSender (Read-Only)
             // if set due to an expansion on the group_authorized_sender.person_id reverse relationship
             // @return GroupAuthorizedSender
             return $this->_objGroupAuthorizedSender;
         case '_GroupAuthorizedSenderArray':
             // Gets the value for the private _objGroupAuthorizedSenderArray (Read-Only)
             // if set due to an ExpandAsArray on the group_authorized_sender.person_id reverse relationship
             // @return GroupAuthorizedSender[]
             return (array) $this->_objGroupAuthorizedSenderArray;
         case '_GroupParticipation':
             // Gets the value for the private _objGroupParticipation (Read-Only)
             // if set due to an expansion on the group_participation.person_id reverse relationship
             // @return GroupParticipation
             return $this->_objGroupParticipation;
         case '_GroupParticipationArray':
             // Gets the value for the private _objGroupParticipationArray (Read-Only)
             // if set due to an ExpandAsArray on the group_participation.person_id reverse relationship
             // @return GroupParticipation[]
             return (array) $this->_objGroupParticipationArray;
         case '_HeadShot':
             // Gets the value for the private _objHeadShot (Read-Only)
             // if set due to an expansion on the head_shot.person_id reverse relationship
             // @return HeadShot
             return $this->_objHeadShot;
         case '_HeadShotArray':
             // Gets the value for the private _objHeadShotArray (Read-Only)
             // if set due to an ExpandAsArray on the head_shot.person_id reverse relationship
             // @return HeadShot[]
             return (array) $this->_objHeadShotArray;
         case '_HouseholdParticipation':
             // Gets the value for the private _objHouseholdParticipation (Read-Only)
             // if set due to an expansion on the household_participation.person_id reverse relationship
             // @return HouseholdParticipation
             return $this->_objHouseholdParticipation;
         case '_HouseholdParticipationArray':
             // Gets the value for the private _objHouseholdParticipationArray (Read-Only)
             // if set due to an ExpandAsArray on the household_participation.person_id reverse relationship
             // @return HouseholdParticipation[]
             return (array) $this->_objHouseholdParticipationArray;
         case '_Marriage':
             // Gets the value for the private _objMarriage (Read-Only)
             // if set due to an expansion on the marriage.person_id reverse relationship
             // @return Marriage
             return $this->_objMarriage;
         case '_MarriageArray':
             // Gets the value for the private _objMarriageArray (Read-Only)
             // if set due to an ExpandAsArray on the marriage.person_id reverse relationship
             // @return Marriage[]
             return (array) $this->_objMarriageArray;
         case '_MarriageAsMarriedTo':
             // Gets the value for the private _objMarriageAsMarriedTo (Read-Only)
             // if set due to an expansion on the marriage.married_to_person_id reverse relationship
             // @return Marriage
             return $this->_objMarriageAsMarriedTo;
         case '_MarriageAsMarriedToArray':
             // Gets the value for the private _objMarriageAsMarriedToArray (Read-Only)
             // if set due to an ExpandAsArray on the marriage.married_to_person_id reverse relationship
             // @return Marriage[]
             return (array) $this->_objMarriageAsMarriedToArray;
         case '_Membership':
             // Gets the value for the private _objMembership (Read-Only)
             // if set due to an expansion on the membership.person_id reverse relationship
             // @return Membership
             return $this->_objMembership;
         case '_MembershipArray':
             // Gets the value for the private _objMembershipArray (Read-Only)
             // if set due to an ExpandAsArray on the membership.person_id reverse relationship
             // @return Membership[]
             return (array) $this->_objMembershipArray;
         case '_OnlineDonation':
             // Gets the value for the private _objOnlineDonation (Read-Only)
             // if set due to an expansion on the online_donation.person_id reverse relationship
             // @return OnlineDonation
             return $this->_objOnlineDonation;
         case '_OnlineDonationArray':
             // Gets the value for the private _objOnlineDonationArray (Read-Only)
             // if set due to an ExpandAsArray on the online_donation.person_id reverse relationship
             // @return OnlineDonation[]
             return (array) $this->_objOnlineDonationArray;
         case '_OtherContactInfo':
             // Gets the value for the private _objOtherContactInfo (Read-Only)
             // if set due to an expansion on the other_contact_info.person_id reverse relationship
             // @return OtherContactInfo
             return $this->_objOtherContactInfo;
         case '_OtherContactInfoArray':
             // Gets the value for the private _objOtherContactInfoArray (Read-Only)
             // if set due to an ExpandAsArray on the other_contact_info.person_id reverse relationship
             // @return OtherContactInfo[]
             return (array) $this->_objOtherContactInfoArray;
         case '_ParentPagerIndividual':
             // Gets the value for the private _objParentPagerIndividual (Read-Only)
             // if set due to an expansion on the parent_pager_individual.person_id reverse relationship
             // @return ParentPagerIndividual
             return $this->_objParentPagerIndividual;
         case '_ParentPagerIndividualArray':
             // Gets the value for the private _objParentPagerIndividualArray (Read-Only)
             // if set due to an ExpandAsArray on the parent_pager_individual.person_id reverse relationship
             // @return ParentPagerIndividual[]
             return (array) $this->_objParentPagerIndividualArray;
         case '_PersonAsCoPrimary':
             // Gets the value for the private _objPersonAsCoPrimary (Read-Only)
             // if set due to an expansion on the person.co_primary reverse relationship
             // @return Person
             return $this->_objPersonAsCoPrimary;
         case '_PersonAsCoPrimaryArray':
             // Gets the value for the private _objPersonAsCoPrimaryArray (Read-Only)
             // if set due to an ExpandAsArray on the person.co_primary reverse relationship
             // @return Person[]
             return (array) $this->_objPersonAsCoPrimaryArray;
         case '_Phone':
             // Gets the value for the private _objPhone (Read-Only)
             // if set due to an expansion on the phone.person_id reverse relationship
             // @return Phone
             return $this->_objPhone;
         case '_PhoneArray':
             // Gets the value for the private _objPhoneArray (Read-Only)
             // if set due to an ExpandAsArray on the phone.person_id reverse relationship
             // @return Phone[]
             return (array) $this->_objPhoneArray;
         case '_Relationship':
             // Gets the value for the private _objRelationship (Read-Only)
             // if set due to an expansion on the relationship.person_id reverse relationship
             // @return Relationship
             return $this->_objRelationship;
         case '_RelationshipArray':
             // Gets the value for the private _objRelationshipArray (Read-Only)
             // if set due to an ExpandAsArray on the relationship.person_id reverse relationship
             // @return Relationship[]
             return (array) $this->_objRelationshipArray;
         case '_RelationshipAsRelatedTo':
             // Gets the value for the private _objRelationshipAsRelatedTo (Read-Only)
             // if set due to an expansion on the relationship.related_to_person_id reverse relationship
             // @return Relationship
             return $this->_objRelationshipAsRelatedTo;
         case '_RelationshipAsRelatedToArray':
             // Gets the value for the private _objRelationshipAsRelatedToArray (Read-Only)
             // if set due to an ExpandAsArray on the relationship.related_to_person_id reverse relationship
             // @return Relationship[]
             return (array) $this->_objRelationshipAsRelatedToArray;
         case '_SearchQuery':
             // Gets the value for the private _objSearchQuery (Read-Only)
             // if set due to an expansion on the search_query.person_id reverse relationship
             // @return SearchQuery
             return $this->_objSearchQuery;
         case '_SearchQueryArray':
             // Gets the value for the private _objSearchQueryArray (Read-Only)
             // if set due to an ExpandAsArray on the search_query.person_id reverse relationship
             // @return SearchQuery[]
             return (array) $this->_objSearchQueryArray;
         case '_SignupEntry':
             // Gets the value for the private _objSignupEntry (Read-Only)
             // if set due to an expansion on the signup_entry.person_id reverse relationship
             // @return SignupEntry
             return $this->_objSignupEntry;
         case '_SignupEntryArray':
             // Gets the value for the private _objSignupEntryArray (Read-Only)
             // if set due to an ExpandAsArray on the signup_entry.person_id reverse relationship
             // @return SignupEntry[]
             return (array) $this->_objSignupEntryArray;
         case '_SignupEntryAsSignupBy':
             // Gets the value for the private _objSignupEntryAsSignupBy (Read-Only)
             // if set due to an expansion on the signup_entry.signup_by_person_id reverse relationship
             // @return SignupEntry
             return $this->_objSignupEntryAsSignupBy;
         case '_SignupEntryAsSignupByArray':
             // Gets the value for the private _objSignupEntryAsSignupByArray (Read-Only)
             // if set due to an ExpandAsArray on the signup_entry.signup_by_person_id reverse relationship
             // @return SignupEntry[]
             return (array) $this->_objSignupEntryAsSignupByArray;
         case '_StewardshipContribution':
             // Gets the value for the private _objStewardshipContribution (Read-Only)
             // if set due to an expansion on the stewardship_contribution.person_id reverse relationship
             // @return StewardshipContribution
             return $this->_objStewardshipContribution;
         case '_StewardshipContributionArray':
             // Gets the value for the private _objStewardshipContributionArray (Read-Only)
             // if set due to an ExpandAsArray on the stewardship_contribution.person_id reverse relationship
             // @return StewardshipContribution[]
             return (array) $this->_objStewardshipContributionArray;
         case '_StewardshipPledge':
             // Gets the value for the private _objStewardshipPledge (Read-Only)
             // if set due to an expansion on the stewardship_pledge.person_id reverse relationship
             // @return StewardshipPledge
             return $this->_objStewardshipPledge;
         case '_StewardshipPledgeArray':
             // Gets the value for the private _objStewardshipPledgeArray (Read-Only)
             // if set due to an ExpandAsArray on the stewardship_pledge.person_id reverse relationship
             // @return StewardshipPledge[]
             return (array) $this->_objStewardshipPledgeArray;
         case '_StewardshipPostLineItem':
             // Gets the value for the private _objStewardshipPostLineItem (Read-Only)
             // if set due to an expansion on the stewardship_post_line_item.person_id reverse relationship
             // @return StewardshipPostLineItem
             return $this->_objStewardshipPostLineItem;
         case '_StewardshipPostLineItemArray':
             // Gets the value for the private _objStewardshipPostLineItemArray (Read-Only)
             // if set due to an ExpandAsArray on the stewardship_post_line_item.person_id reverse relationship
             // @return StewardshipPostLineItem[]
             return (array) $this->_objStewardshipPostLineItemArray;
         case '__Restored':
             return $this->__blnRestored;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
Ejemplo n.º 7
0
 /**
  * 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 'CompanyId':
             /**
              * Gets the value for intCompanyId (Read-Only PK)
              * @return integer
              */
             return $this->intCompanyId;
         case 'AddressId':
             /**
              * Gets the value for intAddressId 
              * @return integer
              */
             return $this->intAddressId;
         case 'ShortDescription':
             /**
              * Gets the value for strShortDescription (Unique)
              * @return string
              */
             return $this->strShortDescription;
         case 'Website':
             /**
              * Gets the value for strWebsite 
              * @return string
              */
             return $this->strWebsite;
         case 'Telephone':
             /**
              * Gets the value for strTelephone 
              * @return string
              */
             return $this->strTelephone;
         case 'Fax':
             /**
              * Gets the value for strFax 
              * @return string
              */
             return $this->strFax;
         case 'Email':
             /**
              * Gets the value for strEmail 
              * @return string
              */
             return $this->strEmail;
         case 'LongDescription':
             /**
              * Gets the value for strLongDescription 
              * @return string
              */
             return $this->strLongDescription;
         case 'CreatedBy':
             /**
              * Gets the value for intCreatedBy 
              * @return integer
              */
             return $this->intCreatedBy;
         case 'CreationDate':
             /**
              * Gets the value for dttCreationDate 
              * @return QDateTime
              */
             return $this->dttCreationDate;
         case 'ModifiedBy':
             /**
              * Gets the value for intModifiedBy 
              * @return integer
              */
             return $this->intModifiedBy;
         case 'ModifiedDate':
             /**
              * Gets the value for strModifiedDate (Read-Only Timestamp)
              * @return string
              */
             return $this->strModifiedDate;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'Address':
             /**
              * Gets the value for the Address object referenced by intAddressId 
              * @return Address
              */
             try {
                 if (!$this->objAddress && !is_null($this->intAddressId)) {
                     $this->objAddress = Address::Load($this->intAddressId);
                 }
                 return $this->objAddress;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'CreatedByObject':
             /**
              * Gets the value for the UserAccount object referenced by intCreatedBy 
              * @return UserAccount
              */
             try {
                 if (!$this->objCreatedByObject && !is_null($this->intCreatedBy)) {
                     $this->objCreatedByObject = UserAccount::Load($this->intCreatedBy);
                 }
                 return $this->objCreatedByObject;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ModifiedByObject':
             /**
              * Gets the value for the UserAccount object referenced by intModifiedBy 
              * @return UserAccount
              */
             try {
                 if (!$this->objModifiedByObject && !is_null($this->intModifiedBy)) {
                     $this->objModifiedByObject = UserAccount::Load($this->intModifiedBy);
                 }
                 return $this->objModifiedByObject;
             } 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 '_Address':
             /**
              * Gets the value for the private _objAddress (Read-Only)
              * if set due to an expansion on the address.company_id reverse relationship
              * @return Address
              */
             return $this->_objAddress;
         case '_AddressArray':
             /**
              * Gets the value for the private _objAddressArray (Read-Only)
              * if set due to an ExpandAsArray on the address.company_id reverse relationship
              * @return Address[]
              */
             return (array) $this->_objAddressArray;
         case '_Contact':
             /**
              * Gets the value for the private _objContact (Read-Only)
              * if set due to an expansion on the contact.company_id reverse relationship
              * @return Contact
              */
             return $this->_objContact;
         case '_ContactArray':
             /**
              * Gets the value for the private _objContactArray (Read-Only)
              * if set due to an ExpandAsArray on the contact.company_id reverse relationship
              * @return Contact[]
              */
             return (array) $this->_objContactArray;
         case '_ReceiptAsFrom':
             /**
              * Gets the value for the private _objReceiptAsFrom (Read-Only)
              * if set due to an expansion on the receipt.from_company_id reverse relationship
              * @return Receipt
              */
             return $this->_objReceiptAsFrom;
         case '_ReceiptAsFromArray':
             /**
              * Gets the value for the private _objReceiptAsFromArray (Read-Only)
              * if set due to an ExpandAsArray on the receipt.from_company_id reverse relationship
              * @return Receipt[]
              */
             return (array) $this->_objReceiptAsFromArray;
         case '_ShipmentAsFrom':
             /**
              * Gets the value for the private _objShipmentAsFrom (Read-Only)
              * if set due to an expansion on the shipment.from_company_id reverse relationship
              * @return Shipment
              */
             return $this->_objShipmentAsFrom;
         case '_ShipmentAsFromArray':
             /**
              * Gets the value for the private _objShipmentAsFromArray (Read-Only)
              * if set due to an ExpandAsArray on the shipment.from_company_id reverse relationship
              * @return Shipment[]
              */
             return (array) $this->_objShipmentAsFromArray;
         case '_ShipmentAsTo':
             /**
              * Gets the value for the private _objShipmentAsTo (Read-Only)
              * if set due to an expansion on the shipment.to_company_id reverse relationship
              * @return Shipment
              */
             return $this->_objShipmentAsTo;
         case '_ShipmentAsToArray':
             /**
              * Gets the value for the private _objShipmentAsToArray (Read-Only)
              * if set due to an ExpandAsArray on the shipment.to_company_id reverse relationship
              * @return Shipment[]
              */
             return (array) $this->_objShipmentAsToArray;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
 /**
  * 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 'AddressId':
             // Gets the value for intAddressId (PK)
             // @return integer
             return $this->intAddressId;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'Address':
             // Gets the value for the Address object referenced by intAddressId (PK)
             // @return Address
             try {
                 if (!$this->objAddress && !is_null($this->intAddressId)) {
                     $this->objAddress = Address::Load($this->intAddressId);
                 }
                 return $this->objAddress;
             } 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;
             }
     }
 }
Ejemplo n.º 9
0
 /**
  * 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 'ReceiptId':
             /**
              * Gets the value for intReceiptId (Read-Only PK)
              * @return integer
              */
             return $this->intReceiptId;
         case 'TransactionId':
             /**
              * Gets the value for intTransactionId (Unique)
              * @return integer
              */
             return $this->intTransactionId;
         case 'FromCompanyId':
             /**
              * Gets the value for intFromCompanyId (Not Null)
              * @return integer
              */
             return $this->intFromCompanyId;
         case 'FromContactId':
             /**
              * Gets the value for intFromContactId (Not Null)
              * @return integer
              */
             return $this->intFromContactId;
         case 'ToContactId':
             /**
              * Gets the value for intToContactId (Not Null)
              * @return integer
              */
             return $this->intToContactId;
         case 'ToAddressId':
             /**
              * Gets the value for intToAddressId (Not Null)
              * @return integer
              */
             return $this->intToAddressId;
         case 'ReceiptNumber':
             /**
              * Gets the value for strReceiptNumber (Unique)
              * @return string
              */
             return $this->strReceiptNumber;
         case 'DueDate':
             /**
              * Gets the value for dttDueDate 
              * @return QDateTime
              */
             return $this->dttDueDate;
         case 'ReceiptDate':
             /**
              * Gets the value for dttReceiptDate 
              * @return QDateTime
              */
             return $this->dttReceiptDate;
         case 'ReceivedFlag':
             /**
              * Gets the value for blnReceivedFlag 
              * @return boolean
              */
             return $this->blnReceivedFlag;
         case 'CreatedBy':
             /**
              * Gets the value for intCreatedBy 
              * @return integer
              */
             return $this->intCreatedBy;
         case 'CreationDate':
             /**
              * Gets the value for dttCreationDate 
              * @return QDateTime
              */
             return $this->dttCreationDate;
         case 'ModifiedBy':
             /**
              * Gets the value for intModifiedBy 
              * @return integer
              */
             return $this->intModifiedBy;
         case 'ModifiedDate':
             /**
              * Gets the value for strModifiedDate (Read-Only Timestamp)
              * @return string
              */
             return $this->strModifiedDate;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'Transaction':
             /**
              * Gets the value for the Transaction object referenced by intTransactionId (Unique)
              * @return Transaction
              */
             try {
                 if (!$this->objTransaction && !is_null($this->intTransactionId)) {
                     $this->objTransaction = Transaction::Load($this->intTransactionId);
                 }
                 return $this->objTransaction;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'FromCompany':
             /**
              * Gets the value for the Company object referenced by intFromCompanyId (Not Null)
              * @return Company
              */
             try {
                 if (!$this->objFromCompany && !is_null($this->intFromCompanyId)) {
                     $this->objFromCompany = Company::Load($this->intFromCompanyId);
                 }
                 return $this->objFromCompany;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'FromContact':
             /**
              * Gets the value for the Contact object referenced by intFromContactId (Not Null)
              * @return Contact
              */
             try {
                 if (!$this->objFromContact && !is_null($this->intFromContactId)) {
                     $this->objFromContact = Contact::Load($this->intFromContactId);
                 }
                 return $this->objFromContact;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ToContact':
             /**
              * Gets the value for the Contact object referenced by intToContactId (Not Null)
              * @return Contact
              */
             try {
                 if (!$this->objToContact && !is_null($this->intToContactId)) {
                     $this->objToContact = Contact::Load($this->intToContactId);
                 }
                 return $this->objToContact;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ToAddress':
             /**
              * Gets the value for the Address object referenced by intToAddressId (Not Null)
              * @return Address
              */
             try {
                 if (!$this->objToAddress && !is_null($this->intToAddressId)) {
                     $this->objToAddress = Address::Load($this->intToAddressId);
                 }
                 return $this->objToAddress;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'CreatedByObject':
             /**
              * Gets the value for the UserAccount object referenced by intCreatedBy 
              * @return UserAccount
              */
             try {
                 if (!$this->objCreatedByObject && !is_null($this->intCreatedBy)) {
                     $this->objCreatedByObject = UserAccount::Load($this->intCreatedBy);
                 }
                 return $this->objCreatedByObject;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ModifiedByObject':
             /**
              * Gets the value for the UserAccount object referenced by intModifiedBy 
              * @return UserAccount
              */
             try {
                 if (!$this->objModifiedByObject && !is_null($this->intModifiedBy)) {
                     $this->objModifiedByObject = UserAccount::Load($this->intModifiedBy);
                 }
                 return $this->objModifiedByObject;
             } 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)
         ////////////////////////////
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
Ejemplo n.º 10
0
 public function btnSave_Click($strFormId, $strControlId, $strParameter)
 {
     try {
         if ($this->intEditAddressId == -1) {
             $objRecord = new Address();
         } else {
             $objRecord = Address::Load($this->intEditAddressId);
         }
         $objRecord->Street = $this->txtStreet->Text;
         $objRecord->City = $this->txtCity->Text;
         $objRecord->Save();
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     $this->btnCancel_Click($strFormId, $strControlId, $strParameter);
 }
Ejemplo n.º 11
0
 protected function btnSave_Click($strFormId, $strControlId, $strParameter)
 {
     $blnError = false;
     if ($this->objAssetTransactionArray && $this->objInventoryTransactionArray) {
         $intEntityQtypeId = EntityQtype::AssetInventory;
     } elseif ($this->objAssetTransactionArray) {
         $intEntityQtypeId = EntityQtype::Asset;
     } elseif ($this->objInventoryTransactionArray) {
         $intEntityQtypeId = EntityQtype::Inventory;
     } else {
         $blnError = true;
         $this->btnCancel->Warning = 'There are no assets or inventory in this shipment.';
     }
     if (QApplication::$TracmorSettings->CustomShipmentNumbers) {
         if ($objShipment = Shipment::LoadByShipmentNumber($this->txtShipmentNumber->Text)) {
             if ($objShipment->ShipmentId != $this->objShipment->ShipmentId) {
                 $blnError = true;
                 $this->txtShipmentNumber->Warning = 'That is a duplicate shipment number.';
             }
         }
     }
     if ($this->lstFxServiceType->SelectedValue) {
         $objtoFxAddress = Address::Load($this->lstToAddress->SelectedValue);
         if (!$objtoFxAddress || !$objtoFxAddress->PostalCode || !$objtoFxAddress->CountryId || !$objtoFxAddress->Address1) {
             $blnError = true;
             $this->lstFxServiceType->Warning = "Not a valid To Address.";
         }
         $objfromFxAddress = Address::Load($this->lstFromAddress->SelectedValue);
         if (!$objfromFxAddress || !$objfromFxAddress->PostalCode || !$objfromFxAddress->Address1 || !$objfromFxAddress->CountryId) {
             $blnError = true;
             $this->lstFxServiceType->Warning = "Not a valid From Address.";
         }
         $objfromFxContact = Contact::Load($this->lstFromContact->SelectedValue);
         if (!$objfromFxContact) {
             $blnError = true;
             $this->lstFxServiceType->Warning = "Not a valid From Contact.";
         }
         $objfromFxCompany = Company::Load($this->lstFromCompany->SelectedValue);
         if (!$objfromFxCompany) {
             $blnError = true;
             $this->lstFxServiceType->Warning = "Not a valid From Company.";
         } elseif (!$objfromFxCompany->Telephone) {
             $blnError = true;
             $this->lstFxServiceType->Warning = "The Shipping Company must have a telephone number.";
         }
         $objShippingAccount = ShippingAccount::Load($this->lstShippingAccount->SelectedValue);
         if (!$objShippingAccount) {
             $blnError = true;
             $this->lstFxServiceType->Warning = "Not a valid Shipping Account.";
         }
         /*				$fed = new FedExDC($objShippingAccount->Value);
         
         				$aRet = $fed->subscribe(
         					array(
         						1 => $this->lblShipmentNumber->Text, // Don't really need this but can be used for ref
         						4003 => $objfromFxContact->__toString(),
         						4008 => $objfromFxAddress->Address1,
         						4009 => $objfromFxAddress->Address2,
         						4011 => $objfromFxAddress->City,
         						4012 => $objfromFxAddress->__toStringStateProvinceAbbreviation(),
         						4013 => $objfromFxAddress->PostalCode,
         						4014 => $objfromFxAddress->__toStringCountryAbbreviation(),
         						4015 => $this->FxStrip($objfromFxCompany->Telephone),
         					)
         				);
         
         				if ($error = $fed->getError()) {
         					$blnError = true;
         					$this->lstFxServiceType->Warning = $error;
         				}
         				elseif (!$aRet[498]) {
         					$blnError = true;
         					$this->lstFxServiceType->Warning = "Fedex response is improperly formed.";
         				}
         				else {
         					$this->objShipment->FedexMeterNumber = $aRet[498];
         				}*/
     }
     if (!$blnError) {
         if (!$this->blnEditMode) {
             try {
                 // Get an instance of the database
                 $objDatabase = QApplication::$Database[1];
                 // Begin a MySQL Transaction to be either committed or rolled back
                 $objDatabase->TransactionBegin();
                 // Create the new transaction object and save it
                 $this->objTransaction = new Transaction();
                 $this->objTransaction->EntityQtypeId = $intEntityQtypeId;
                 $this->objTransaction->TransactionTypeId = 6;
                 $this->objTransaction->Note = $this->txtNote->Text;
                 $this->objTransaction->Save();
                 if ($intEntityQtypeId == EntityQtype::AssetInventory || $intEntityQtypeId == EntityQtype::Asset) {
                     // Assign different source and destinations depending on transaction type
                     foreach ($this->objAssetTransactionArray as $objAssetTransaction) {
                         if ($objAssetTransaction->Asset instanceof Asset) {
                             // Save the asset just to update the modified_date field so it can trigger an Optimistic Locking Exception when appropriate
                             $objAssetTransaction->Asset->Save();
                             // Assign the TransactionId
                             $objAssetTransaction->TransactionId = $this->objTransaction->TransactionId;
                             // Create the new asset if it was scheduled for receipt
                             if ($objAssetTransaction->ScheduleReceiptFlag && $objAssetTransaction->NewAsset && $objAssetTransaction->NewAsset instanceof Asset) {
                                 $objReceiptAsset = new Asset();
                                 $objReceiptAsset->AssetModelId = $objAssetTransaction->NewAsset->AssetModelId;
                                 $objReceiptAsset->LocationId = $objAssetTransaction->NewAsset->LocationId;
                                 //if ($objReceiptAsset->AssetCode == '') {
                                 if ($objAssetTransaction->NewAsset->AssetCode == '') {
                                     $objReceiptAsset->AssetCode = Asset::GenerateAssetCode();
                                 } else {
                                     $objReceiptAsset->AssetCode = $objAssetTransaction->NewAsset->AssetCode;
                                 }
                                 $objReceiptAsset->Save();
                                 // Assign any default custom field values
                                 CustomField::AssignNewEntityDefaultValues(1, $objReceiptAsset->AssetId);
                                 // Associate the new Asset with the AssetTransaction
                                 $objAssetTransaction->NewAsset = $objReceiptAsset;
                             }
                             // $objAssetTransaction->DestinationLocationId = $DestinationLocationId;
                             $objAssetTransaction->Save();
                             /*$objLinkedAssetArray = Asset::LoadChildLinkedArrayByParentAssetId($objAssetTransaction->Asset->AssetId);
                             		if ($objLinkedAssetArray) {
                             		  foreach ($objLinkedAssetArray as $objLinkedAsset) {
                             		    $objLinkedAssetTransaction = new AssetTransaction();
                                						$objLinkedAssetTransaction->AssetId = $objLinkedAsset->AssetId;
                                						$objLinkedAssetTransaction->SourceLocationId = $objLinkedAsset->LocationId;
                                						$objLinkedAssetTransaction->TransactionId = $objAssetTransaction->TransactionId;
                                						$objLinkedAssetTransaction->Save();
                             		  }
                             		}*/
                         }
                     }
                 }
                 if ($intEntityQtypeId == EntityQtype::AssetInventory || $intEntityQtypeId == EntityQtype::Inventory) {
                     // Assign different source and destinations depending on transaction type
                     foreach ($this->objInventoryTransactionArray as $objInventoryTransaction) {
                         // Save the inventory location just to update the modified_date field so it can triggern an Optimistic Locking Exception when appropriate
                         $objInventoryTransaction->InventoryLocation->Save();
                         // Assign the TransactionId
                         $objInventoryTransaction->TransactionId = $this->objTransaction->TransactionId;
                         // $objInventoryTransaction->DestinationLocationId = $DestinationLocationId;
                         $objInventoryTransaction->Save();
                     }
                 }
                 $this->UpdateShipmentFields();
                 $this->objShipment->ShippedFlag = false;
                 $this->objShipment->Save();
                 if ($this->arrCustomFields) {
                     // Save the values from all of the custom field controls to save the shipment
                     CustomField::SaveControls($this->objShipment->objCustomFieldArray, $this->blnEditMode, $this->arrCustomFields, $this->objShipment->ShipmentId, 10);
                 }
                 // If the courier is FedEx, create new fedexShipment
                 if ($this->lstCourier->SelectedValue === 1) {
                     $this->objFedexShipment = new FedexShipment();
                     $this->objFedexShipment->Shipment = $this->objShipment;
                     $this->UpdateFedexFields();
                     $this->objFedexShipment->Save();
                 }
                 $objDatabase->TransactionCommit();
                 QApplication::Redirect('shipment_list.php');
             } catch (QExtendedOptimisticLockingException $objExc) {
                 // Rollback the database
                 $objDatabase->TransactionRollback();
                 if ($objExc->Class == 'Asset') {
                     // $this->btnRemoveAssetTransaction_Click($this->FormId, 'btnRemoveAsset' . $objExc->EntityId, $objExc->EntityId);
                     $this->btnRemoveAssetTransaction_Click($this->FormId, null, $objExc->EntityId);
                     $objAsset = Asset::Load($objExc->EntityId);
                     if ($objAsset) {
                         $this->btnCancel->Warning = sprintf('The Asset %s has been modified by another user and removed from this shipment. You may add the asset again or save the transaction without it.', $objAsset->AssetCode);
                     } else {
                         $this->btnCancel->Warning = 'An Asset has been deleted by another user and removed from this shipment.';
                     }
                 }
                 if ($objExc->Class == 'InventoryLocation') {
                     $this->btnRemoveInventory_Click($this->FormId, 'btnRemoveInventory' . $objExc->EntityId, $objExc->EntityId);
                     $objInventoryLocation = InventoryLocation::Load($objExc->EntityId);
                     if ($objInventoryLocation) {
                         $this->btnCancel->Warning = sprintf('The Inventory %s has been modified by another user and removed from this shipment. You may add the inventory again or save the shipment without it.', $objInventoryLocation->InventoryModel->InventoryModelCode);
                     } else {
                         $this->btnCancel->Warning = 'Inventory has been deleted by another user and removed from this shipment.';
                     }
                 }
             }
         } elseif ($this->blnEditMode) {
             try {
                 // Get an instance of the database
                 $objDatabase = QApplication::$Database[1];
                 // Begin a MySQL Transaction to be either committed or rolled back
                 $objDatabase->TransactionBegin();
                 $this->objTransaction = Transaction::Load($this->objShipment->TransactionId);
                 $this->objTransaction->EntityQtypeId = $intEntityQtypeId;
                 $this->objTransaction->Note = $this->txtNote->Text;
                 $this->objTransaction->Save();
                 // Remove AssetTransactions that were removed when editing
                 if ($this->arrAssetTransactionToDelete) {
                     foreach ($this->arrAssetTransactionToDelete as $intAssetTransactionId) {
                         $objAssetTransactionToDelete = AssetTransaction::Load($intAssetTransactionId);
                         // Make sure that it wasn't added and then removed
                         if ($objAssetTransactionToDelete) {
                             // Change back location
                             $objAssetTransactionToDelete->Asset->LocationId = $objAssetTransactionToDelete->SourceLocationId;
                             $objAssetTransactionToDelete->Asset->Save();
                             // Delete the asset that was created for a new receipt
                             if ($objAssetTransactionToDelete->NewAsset && $objAssetTransactionToDelete->NewAsset instanceof Asset && $objAssetTransactionToDelete->ScheduleReceiptFlag) {
                                 $objAssetTransactionToDelete->NewAsset->Delete();
                             }
                             // Delete the asset transaction
                             $objAssetTransactionToDelete->Delete();
                             unset($objAssetTransactionToDelete);
                         }
                     }
                 }
                 // Save new AssetTransactions
                 if ($this->objAssetTransactionArray) {
                     foreach ($this->objAssetTransactionArray as $objAssetTransaction) {
                         // If the AssetTransaction has not been saved
                         if (!$objAssetTransaction->AssetTransactionId) {
                             $objAssetTransaction->TransactionId = $this->objTransaction->TransactionId;
                             // Save the asset just to update the modified_date field so it can trigger an Optimistic Locking Exception when appropriate
                             $objAssetTransaction->Asset->Save();
                             // Create the new asset if it was scheduled for receipt
                             // $DestinationLocationId = 2; // Shipped
                             // $objAssetTransaction->DestinationLocationId = $DestinationLocationId;
                             // $objAssetTransaction->Asset->LocationId = $DestinationLocationId;
                             // $objAssetTransaction->Asset->Save();
                         }
                         if ($objAssetTransaction->ScheduleReceiptFlag && $objAssetTransaction->NewAsset && $objAssetTransaction->NewAsset instanceof Asset && !$objAssetTransaction->NewAssetId) {
                             $objReceiptAsset = new Asset();
                             $objReceiptAsset->AssetModelId = $objAssetTransaction->NewAsset->AssetModelId;
                             $objReceiptAsset->LocationId = $objAssetTransaction->NewAsset->LocationId;
                             if ($objAssetTransaction->NewAsset->AssetCode == '') {
                                 $objReceiptAsset->AssetCode = Asset::GenerateAssetCode();
                             } else {
                                 $objReceiptAsset->AssetCode = $objAssetTransaction->NewAsset->AssetCode;
                             }
                             $objReceiptAsset->Save();
                             // Assign any default custom field values
                             CustomField::AssignNewEntityDefaultValues(1, $objReceiptAsset->AssetId);
                             // Associate the new Asset with the AssetTransaction
                             $objAssetTransaction->NewAsset = $objReceiptAsset;
                         }
                         $objAssetTransaction->Save();
                     }
                 }
                 // Remove InventoryTransactions
                 if ($this->arrInventoryTransactionToDelete) {
                     foreach ($this->arrInventoryTransactionToDelete as $intInventoryTransactionId) {
                         $objInventoryTransactionToDelete = InventoryTransaction::Load($intInventoryTransactionId);
                         // Make sure that it wasn't added then removed
                         if ($objInventoryTransactionToDelete) {
                             // Change back the quantity
                             $objInventoryTransactionToDelete->InventoryLocation->Quantity += $objInventoryTransactionToDelete->Quantity;
                             $objInventoryTransactionToDelete->InventoryLocation->Save();
                             // Delete the InventoryTransaction
                             $objInventoryTransactionToDelete->Delete();
                             unset($objInventoryTransactionToDelete);
                         }
                     }
                 }
                 // Save InventoryTransactions
                 if ($this->objInventoryTransactionArray) {
                     foreach ($this->objInventoryTransactionArray as $objInventoryTransaction) {
                         if (!$objInventoryTransaction->InventoryTransactionId) {
                             // Reload the InventoryLocation. If it was deleted and added in the same save click, then it will throw an Optimistic Locking Exception
                             $objInventoryTransaction->InventoryLocation = InventoryLocation::Load($objInventoryTransaction->InventoryLocationId);
                             $objInventoryTransaction->TransactionId = $this->objTransaction->TransactionId;
                             // Save the inventory location just to update the modified_date field so it can triggern an Optimistic Locking Exception when appropriate
                             $objInventoryTransaction->InventoryLocation->Save();
                             // $DestinationLocationId = 2; // Shipped
                             // $objInventoryTransaction->DestinationLocationId = $DestinationLocationId;
                             // $objInventoryTransaction->InventoryLocation->Quantity -= $objInventoryTransaction->Quantity;
                             // $objInventoryTransaction->InventoryLocation->Save();
                             $objInventoryTransaction->Save();
                         }
                     }
                 }
                 $this->UpdateShipmentFields();
                 // $this->objShipment->Save(false, true);
                 $this->objShipment->Save();
                 if ($this->arrCustomFields) {
                     // Save the values from all of the custom field controls to save the shipment
                     CustomField::SaveControls($this->objShipment->objCustomFieldArray, $this->blnEditMode, $this->arrCustomFields, $this->objShipment->ShipmentId, 10);
                 }
                 // If the courier is FedEx, save the fedexShipment
                 if ($this->lstCourier->SelectedValue === 1) {
                     if ($this->objFedexShipment) {
                         // FedexShipment already exists, so update it
                         $this->UpdateFedexFields();
                         $this->objFedexShipment->Save();
                     } else {
                         // FedexShipment doesn't exist yet, so create it
                         $this->objFedexShipment = new FedexShipment();
                         $this->objFedexShipment->Shipment = $this->objShipment;
                         $this->UpdateFedexFields();
                         $this->objFedexShipment->Save();
                     }
                 } else {
                     if ($this->objFedexShipment) {
                         // FedexShipment exists - delete it because the selected courier is no longer FedEx
                         $this->objFedexShipment->Delete();
                         $this->objFedexShipment = null;
                     }
                 }
                 $objDatabase->TransactionCommit();
                 $this->UpdateShipmentLabels();
                 $this->SetupShipment();
                 $this->DisplayLabels();
                 if ($this->objShipment->CourierId == 1) {
                     $this->txtTrackingNumber->Enabled = false;
                     $this->lstPackageType->Enabled = true;
                 } else {
                     $this->txtTrackingNumber->Enabled = true;
                     $this->lstPackageType->Enabled = false;
                 }
                 // Reload lstPackageType
                 $this->lstPackageType->RemoveAllItems();
                 $this->LoadPackageTypes();
             } catch (QExtendedOptimisticLockingException $objExc) {
                 $objDatabase->TransactionRollback();
                 if ($objExc->Class == 'Shipment') {
                     $this->btnCancel->Warning = sprintf('This shipment has been modified by another user. You must <a href="shipment_edit.php?intShipmentId=%s">Refresh</a> to edit this shipment.', $this->objShipment->ShipmentId);
                 } elseif ($objExc->Class == 'Asset') {
                     //$this->btnRemoveAssetTransaction_Click($this->FormId, 'btnRemoveAsset' . $objExc->EntityId, $objExc->EntityId);
                     $this->btnRemoveAssetTransaction_Click($this->FormId, null, $objExc->EntityId);
                     $objAsset = Asset::Load($objExc->EntityId);
                     if ($objAsset) {
                         $this->btnCancel->Warning = sprintf('The Asset %s has been modified by another user and removed from this shipment. You may add the asset again or save the transaction without it.', $objAsset->AssetCode);
                     } else {
                         $this->btnCancel->Warning = 'An Asset has been deleted by another user and removed from this shipment.';
                     }
                 } elseif ($objExc->Class == 'InventoryLocation') {
                     $this->btnRemoveInventory_Click($this->FormId, 'btnRemoveInventory' . $objExc->EntityId, $objExc->EntityId);
                     $objInventoryLocation = InventoryLocation::Load($objExc->EntityId);
                     if ($objInventoryLocation) {
                         $this->btnCancel->Warning = sprintf('The Inventory %s has been modified by another user and removed from this shipment. You may add the inventory again or save the shipment without it.', $objInventoryLocation->InventoryModel->InventoryModelCode);
                     } else {
                         $this->btnCancel->Warning = 'Inventory has been deleted by another user and removed from this shipment.';
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 12
0
 public function rblAddress_Change($strFormId, $strControlId, $strParameter)
 {
     $strControlIdRoot = str_replace('switch', '', $strControlId);
     $rblAddress = $this->GetControl($strControlId);
     $txtAddress1 = $this->GetControl($strControlIdRoot . 'address1');
     $txtAddress2 = $this->GetControl($strControlIdRoot . 'address2');
     $txtCity = $this->GetControl($strControlIdRoot . 'city');
     $lstState = $this->GetControl($strControlIdRoot . 'state');
     $txtZipCode = $this->GetControl($strControlIdRoot . 'zipcode');
     if ($rblAddress->SelectedValue) {
         $objAddress = Address::Load($rblAddress->SelectedValue);
         $txtAddress1->Text = $objAddress->Address1;
         $txtAddress2->Text = $objAddress->Address2;
         $txtCity->Text = $objAddress->City;
         $lstState->SelectedValue = $objAddress->State;
         $txtZipCode->Text = $objAddress->ZipCode;
         $txtAddress1->Enabled = false;
         $txtAddress2->Enabled = false;
         $txtCity->Enabled = false;
         $lstState->Enabled = false;
         $txtZipCode->Enabled = false;
     } else {
         $txtAddress1->Enabled = true;
         $txtAddress2->Enabled = true;
         $txtCity->Enabled = true;
         $lstState->Enabled = true;
         $txtZipCode->Enabled = true;
         $txtAddress1->Focus();
     }
 }
Ejemplo n.º 13
0
 public function btnEdit_Click($strFormId, $strControlId, $strParameter)
 {
     $strParameterArray = explode(',', $strParameter);
     $objAddress = Address::Load($strParameterArray[0]);
     $objEditPanel = new AddressEditPanel($this, $this->strCloseEditPanelMethod, $objAddress);
     $strMethodName = $this->strSetEditPanelMethod;
     $this->objForm->{$strMethodName}($objEditPanel);
 }
Ejemplo n.º 14
0
 /**
  * Reload this Address from the database.
  * @return void
  */
 public function Reload()
 {
     // Make sure we are actually Restored from the database
     if (!$this->__blnRestored) {
         throw new QCallerException('Cannot call Reload() on a new, unsaved Address object.');
     }
     // Reload the Object
     $objReloaded = Address::Load($this->intId);
     // Update $this's local variables to match
     $this->AddressTypeId = $objReloaded->AddressTypeId;
     $this->PersonId = $objReloaded->PersonId;
     $this->HouseholdId = $objReloaded->HouseholdId;
     $this->PrimaryPhoneId = $objReloaded->PrimaryPhoneId;
     $this->strAddress1 = $objReloaded->strAddress1;
     $this->strAddress2 = $objReloaded->strAddress2;
     $this->strAddress3 = $objReloaded->strAddress3;
     $this->strCity = $objReloaded->strCity;
     $this->strState = $objReloaded->strState;
     $this->strZipCode = $objReloaded->strZipCode;
     $this->strCountry = $objReloaded->strCountry;
     $this->blnCurrentFlag = $objReloaded->blnCurrentFlag;
     $this->blnInvalidFlag = $objReloaded->blnInvalidFlag;
     $this->blnVerificationCheckedFlag = $objReloaded->blnVerificationCheckedFlag;
     $this->dttDateUntilWhen = $objReloaded->dttDateUntilWhen;
     $this->blnInternationalFlag = $objReloaded->blnInternationalFlag;
 }
Ejemplo n.º 15
0
 /**
  * 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 'PhoneTypeId':
             // Gets the value for intPhoneTypeId (Not Null)
             // @return integer
             return $this->intPhoneTypeId;
         case 'AddressId':
             // Gets the value for intAddressId
             // @return integer
             return $this->intAddressId;
         case 'PersonId':
             // Gets the value for intPersonId
             // @return integer
             return $this->intPersonId;
         case 'MobileProviderId':
             // Gets the value for intMobileProviderId
             // @return integer
             return $this->intMobileProviderId;
         case 'Number':
             // Gets the value for strNumber
             // @return string
             return $this->strNumber;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'Address':
             // Gets the value for the Address object referenced by intAddressId
             // @return Address
             try {
                 if (!$this->objAddress && !is_null($this->intAddressId)) {
                     $this->objAddress = Address::Load($this->intAddressId);
                 }
                 return $this->objAddress;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Person':
             // Gets the value for the Person object referenced by intPersonId
             // @return Person
             try {
                 if (!$this->objPerson && !is_null($this->intPersonId)) {
                     $this->objPerson = Person::Load($this->intPersonId);
                 }
                 return $this->objPerson;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'MobileProvider':
             // Gets the value for the MobileProvider object referenced by intMobileProviderId
             // @return MobileProvider
             try {
                 if (!$this->objMobileProvider && !is_null($this->intMobileProviderId)) {
                     $this->objMobileProvider = MobileProvider::Load($this->intMobileProviderId);
                 }
                 return $this->objMobileProvider;
             } 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 '_AddressAsPrimary':
             // Gets the value for the private _objAddressAsPrimary (Read-Only)
             // if set due to an expansion on the address.primary_phone_id reverse relationship
             // @return Address
             return $this->_objAddressAsPrimary;
         case '_AddressAsPrimaryArray':
             // Gets the value for the private _objAddressAsPrimaryArray (Read-Only)
             // if set due to an ExpandAsArray on the address.primary_phone_id reverse relationship
             // @return Address[]
             return (array) $this->_objAddressAsPrimaryArray;
         case '_FormAnswer':
             // Gets the value for the private _objFormAnswer (Read-Only)
             // if set due to an expansion on the form_answer.phone_id reverse relationship
             // @return FormAnswer
             return $this->_objFormAnswer;
         case '_FormAnswerArray':
             // Gets the value for the private _objFormAnswerArray (Read-Only)
             // if set due to an ExpandAsArray on the form_answer.phone_id reverse relationship
             // @return FormAnswer[]
             return (array) $this->_objFormAnswerArray;
         case '_PersonAsPrimary':
             // Gets the value for the private _objPersonAsPrimary (Read-Only)
             // if set due to an expansion on the person.primary_phone_id reverse relationship
             // @return Person
             return $this->_objPersonAsPrimary;
         case '_PersonAsPrimaryArray':
             // Gets the value for the private _objPersonAsPrimaryArray (Read-Only)
             // if set due to an ExpandAsArray on the person.primary_phone_id reverse relationship
             // @return Person[]
             return (array) $this->_objPersonAsPrimaryArray;
         case '__Restored':
             return $this->__blnRestored;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
Ejemplo n.º 16
0
 protected function lstToAddress_Select()
 {
     $objAddress = Address::Load($this->lstToAddress->SelectedValue);
     if ($objAddress) {
         $this->lblToAddressFull->Text = $objAddress->__toStringFullAddress();
     } else {
         $this->lblToAddressFull->Text = '';
     }
     //$this->lstFxServiceType_Update();
 }
Ejemplo n.º 17
0
 /**
  * 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 AddressMetaControl
  * @param integer $intId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing Address object creation - defaults to CreateOrEdit
  * @return AddressMetaControl
  */
 public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intId)) {
         $objAddress = Address::Load($intId);
         // Address was found -- return it!
         if ($objAddress) {
             return new AddressMetaControl($objParentObject, $objAddress);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a Address 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 AddressMetaControl($objParentObject, new Address());
 }
Ejemplo n.º 18
0
 /**
  * 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 'ShipmentId':
             /**
              * Gets the value for intShipmentId (Read-Only PK)
              * @return integer
              */
             return $this->intShipmentId;
         case 'ShipmentNumber':
             /**
              * Gets the value for strShipmentNumber (Unique)
              * @return string
              */
             return $this->strShipmentNumber;
         case 'TransactionId':
             /**
              * Gets the value for intTransactionId (Unique)
              * @return integer
              */
             return $this->intTransactionId;
         case 'FromCompanyId':
             /**
              * Gets the value for intFromCompanyId (Not Null)
              * @return integer
              */
             return $this->intFromCompanyId;
         case 'FromContactId':
             /**
              * Gets the value for intFromContactId (Not Null)
              * @return integer
              */
             return $this->intFromContactId;
         case 'FromAddressId':
             /**
              * Gets the value for intFromAddressId (Not Null)
              * @return integer
              */
             return $this->intFromAddressId;
         case 'ToCompanyId':
             /**
              * Gets the value for intToCompanyId (Not Null)
              * @return integer
              */
             return $this->intToCompanyId;
         case 'ToContactId':
             /**
              * Gets the value for intToContactId (Not Null)
              * @return integer
              */
             return $this->intToContactId;
         case 'ToAddressId':
             /**
              * Gets the value for intToAddressId (Not Null)
              * @return integer
              */
             return $this->intToAddressId;
         case 'CourierId':
             /**
              * Gets the value for intCourierId 
              * @return integer
              */
             return $this->intCourierId;
         case 'TrackingNumber':
             /**
              * Gets the value for strTrackingNumber 
              * @return string
              */
             return $this->strTrackingNumber;
         case 'ShipDate':
             /**
              * Gets the value for dttShipDate (Not Null)
              * @return QDateTime
              */
             return $this->dttShipDate;
         case 'ShippedFlag':
             /**
              * Gets the value for blnShippedFlag 
              * @return boolean
              */
             return $this->blnShippedFlag;
         case 'CreatedBy':
             /**
              * Gets the value for intCreatedBy 
              * @return integer
              */
             return $this->intCreatedBy;
         case 'CreationDate':
             /**
              * Gets the value for dttCreationDate 
              * @return QDateTime
              */
             return $this->dttCreationDate;
         case 'ModifiedBy':
             /**
              * Gets the value for intModifiedBy 
              * @return integer
              */
             return $this->intModifiedBy;
         case 'ModifiedDate':
             /**
              * Gets the value for strModifiedDate (Read-Only Timestamp)
              * @return string
              */
             return $this->strModifiedDate;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'Transaction':
             /**
              * Gets the value for the Transaction object referenced by intTransactionId (Unique)
              * @return Transaction
              */
             try {
                 if (!$this->objTransaction && !is_null($this->intTransactionId)) {
                     $this->objTransaction = Transaction::Load($this->intTransactionId);
                 }
                 return $this->objTransaction;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'FromCompany':
             /**
              * Gets the value for the Company object referenced by intFromCompanyId (Not Null)
              * @return Company
              */
             try {
                 if (!$this->objFromCompany && !is_null($this->intFromCompanyId)) {
                     $this->objFromCompany = Company::Load($this->intFromCompanyId);
                 }
                 return $this->objFromCompany;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'FromContact':
             /**
              * Gets the value for the Contact object referenced by intFromContactId (Not Null)
              * @return Contact
              */
             try {
                 if (!$this->objFromContact && !is_null($this->intFromContactId)) {
                     $this->objFromContact = Contact::Load($this->intFromContactId);
                 }
                 return $this->objFromContact;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'FromAddress':
             /**
              * Gets the value for the Address object referenced by intFromAddressId (Not Null)
              * @return Address
              */
             try {
                 if (!$this->objFromAddress && !is_null($this->intFromAddressId)) {
                     $this->objFromAddress = Address::Load($this->intFromAddressId);
                 }
                 return $this->objFromAddress;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ToCompany':
             /**
              * Gets the value for the Company object referenced by intToCompanyId (Not Null)
              * @return Company
              */
             try {
                 if (!$this->objToCompany && !is_null($this->intToCompanyId)) {
                     $this->objToCompany = Company::Load($this->intToCompanyId);
                 }
                 return $this->objToCompany;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ToContact':
             /**
              * Gets the value for the Contact object referenced by intToContactId (Not Null)
              * @return Contact
              */
             try {
                 if (!$this->objToContact && !is_null($this->intToContactId)) {
                     $this->objToContact = Contact::Load($this->intToContactId);
                 }
                 return $this->objToContact;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ToAddress':
             /**
              * Gets the value for the Address object referenced by intToAddressId (Not Null)
              * @return Address
              */
             try {
                 if (!$this->objToAddress && !is_null($this->intToAddressId)) {
                     $this->objToAddress = Address::Load($this->intToAddressId);
                 }
                 return $this->objToAddress;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Courier':
             /**
              * Gets the value for the Courier object referenced by intCourierId 
              * @return Courier
              */
             try {
                 if (!$this->objCourier && !is_null($this->intCourierId)) {
                     $this->objCourier = Courier::Load($this->intCourierId);
                 }
                 return $this->objCourier;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'CreatedByObject':
             /**
              * Gets the value for the UserAccount object referenced by intCreatedBy 
              * @return UserAccount
              */
             try {
                 if (!$this->objCreatedByObject && !is_null($this->intCreatedBy)) {
                     $this->objCreatedByObject = UserAccount::Load($this->intCreatedBy);
                 }
                 return $this->objCreatedByObject;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ModifiedByObject':
             /**
              * Gets the value for the UserAccount object referenced by intModifiedBy 
              * @return UserAccount
              */
             try {
                 if (!$this->objModifiedByObject && !is_null($this->intModifiedBy)) {
                     $this->objModifiedByObject = UserAccount::Load($this->intModifiedBy);
                 }
                 return $this->objModifiedByObject;
             } 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 '_FedexShipment':
             /**
              * Gets the value for the private _objFedexShipment (Read-Only)
              * if set due to an expansion on the fedex_shipment.shipment_id reverse relationship
              * @return FedexShipment
              */
             return $this->_objFedexShipment;
         case '_FedexShipmentArray':
             /**
              * Gets the value for the private _objFedexShipmentArray (Read-Only)
              * if set due to an ExpandAsArray on the fedex_shipment.shipment_id reverse relationship
              * @return FedexShipment[]
              */
             return (array) $this->_objFedexShipmentArray;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
Ejemplo n.º 19
0
 /**
  * Reload this Address from the database.
  * @return void
  */
 public function Reload()
 {
     // Make sure we are actually Restored from the database
     if (!$this->__blnRestored) {
         throw new QCallerException('Cannot call Reload() on a new, unsaved Address object.');
     }
     // Reload the Object
     $objReloaded = Address::Load($this->intAddressId);
     // Update $this's local variables to match
     $this->CompanyId = $objReloaded->CompanyId;
     $this->strShortDescription = $objReloaded->strShortDescription;
     $this->CountryId = $objReloaded->CountryId;
     $this->strAddress1 = $objReloaded->strAddress1;
     $this->strAddress2 = $objReloaded->strAddress2;
     $this->strCity = $objReloaded->strCity;
     $this->StateProvinceId = $objReloaded->StateProvinceId;
     $this->strPostalCode = $objReloaded->strPostalCode;
     $this->CreatedBy = $objReloaded->CreatedBy;
     $this->dttCreationDate = $objReloaded->dttCreationDate;
     $this->ModifiedBy = $objReloaded->ModifiedBy;
     $this->strModifiedDate = $objReloaded->strModifiedDate;
 }