protected function lstTransaction_Create() { $this->lstTransaction = new QListBox($this); $this->lstTransaction->Name = QApplication::Translate('Transaction'); $this->lstTransaction->Required = true; if (!$this->blnEditMode) { $this->lstTransaction->AddItem(QApplication::Translate('- Select One -'), null); } $objTransactionArray = Transaction::LoadAll(); if ($objTransactionArray) { foreach ($objTransactionArray as $objTransaction) { $objListItem = new QListItem($objTransaction->__toString(), $objTransaction->TransactionId); if ($this->objShipment->Transaction && $this->objShipment->Transaction->TransactionId == $objTransaction->TransactionId) { $objListItem->Selected = true; } $this->lstTransaction->AddItem($objListItem); } } }
/** * Refresh this MetaControl with Data from the local Shipment object. * @param boolean $blnReload reload Shipment from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objShipment->Reload(); } if ($this->lblShipmentId) { if ($this->blnEditMode) { $this->lblShipmentId->Text = $this->objShipment->ShipmentId; } } if ($this->txtShipmentNumber) { $this->txtShipmentNumber->Text = $this->objShipment->ShipmentNumber; } if ($this->lblShipmentNumber) { $this->lblShipmentNumber->Text = $this->objShipment->ShipmentNumber; } if ($this->lstTransaction) { $this->lstTransaction->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstTransaction->AddItem(QApplication::Translate('- Select One -'), null); } $objTransactionArray = Transaction::LoadAll(); if ($objTransactionArray) { foreach ($objTransactionArray as $objTransaction) { $objListItem = new QListItem($objTransaction->__toString(), $objTransaction->TransactionId); if ($this->objShipment->Transaction && $this->objShipment->Transaction->TransactionId == $objTransaction->TransactionId) { $objListItem->Selected = true; } $this->lstTransaction->AddItem($objListItem); } } } if ($this->lblTransactionId) { $this->lblTransactionId->Text = $this->objShipment->Transaction ? $this->objShipment->Transaction->__toString() : null; } if ($this->lstFromCompany) { $this->lstFromCompany->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstFromCompany->AddItem(QApplication::Translate('- Select One -'), null); } $objFromCompanyArray = Company::LoadAll(); if ($objFromCompanyArray) { foreach ($objFromCompanyArray as $objFromCompany) { $objListItem = new QListItem($objFromCompany->__toString(), $objFromCompany->CompanyId); if ($this->objShipment->FromCompany && $this->objShipment->FromCompany->CompanyId == $objFromCompany->CompanyId) { $objListItem->Selected = true; } $this->lstFromCompany->AddItem($objListItem); } } } if ($this->lblFromCompanyId) { $this->lblFromCompanyId->Text = $this->objShipment->FromCompany ? $this->objShipment->FromCompany->__toString() : null; } if ($this->lstFromContact) { $this->lstFromContact->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstFromContact->AddItem(QApplication::Translate('- Select One -'), null); } $objFromContactArray = Contact::LoadAll(); if ($objFromContactArray) { foreach ($objFromContactArray as $objFromContact) { $objListItem = new QListItem($objFromContact->__toString(), $objFromContact->ContactId); if ($this->objShipment->FromContact && $this->objShipment->FromContact->ContactId == $objFromContact->ContactId) { $objListItem->Selected = true; } $this->lstFromContact->AddItem($objListItem); } } } if ($this->lblFromContactId) { $this->lblFromContactId->Text = $this->objShipment->FromContact ? $this->objShipment->FromContact->__toString() : null; } if ($this->lstFromAddress) { $this->lstFromAddress->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstFromAddress->AddItem(QApplication::Translate('- Select One -'), null); } $objFromAddressArray = Address::LoadAll(); if ($objFromAddressArray) { foreach ($objFromAddressArray as $objFromAddress) { $objListItem = new QListItem($objFromAddress->__toString(), $objFromAddress->AddressId); if ($this->objShipment->FromAddress && $this->objShipment->FromAddress->AddressId == $objFromAddress->AddressId) { $objListItem->Selected = true; } $this->lstFromAddress->AddItem($objListItem); } } } if ($this->lblFromAddressId) { $this->lblFromAddressId->Text = $this->objShipment->FromAddress ? $this->objShipment->FromAddress->__toString() : null; } if ($this->lstToCompany) { $this->lstToCompany->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstToCompany->AddItem(QApplication::Translate('- Select One -'), null); } $objToCompanyArray = Company::LoadAll(); if ($objToCompanyArray) { foreach ($objToCompanyArray as $objToCompany) { $objListItem = new QListItem($objToCompany->__toString(), $objToCompany->CompanyId); if ($this->objShipment->ToCompany && $this->objShipment->ToCompany->CompanyId == $objToCompany->CompanyId) { $objListItem->Selected = true; } $this->lstToCompany->AddItem($objListItem); } } } if ($this->lblToCompanyId) { $this->lblToCompanyId->Text = $this->objShipment->ToCompany ? $this->objShipment->ToCompany->__toString() : null; } if ($this->lstToContact) { $this->lstToContact->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstToContact->AddItem(QApplication::Translate('- Select One -'), null); } $objToContactArray = Contact::LoadAll(); if ($objToContactArray) { foreach ($objToContactArray as $objToContact) { $objListItem = new QListItem($objToContact->__toString(), $objToContact->ContactId); if ($this->objShipment->ToContact && $this->objShipment->ToContact->ContactId == $objToContact->ContactId) { $objListItem->Selected = true; } $this->lstToContact->AddItem($objListItem); } } } if ($this->lblToContactId) { $this->lblToContactId->Text = $this->objShipment->ToContact ? $this->objShipment->ToContact->__toString() : null; } if ($this->lstToAddress) { $this->lstToAddress->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstToAddress->AddItem(QApplication::Translate('- Select One -'), null); } $objToAddressArray = Address::LoadAll(); if ($objToAddressArray) { foreach ($objToAddressArray as $objToAddress) { $objListItem = new QListItem($objToAddress->__toString(), $objToAddress->AddressId); if ($this->objShipment->ToAddress && $this->objShipment->ToAddress->AddressId == $objToAddress->AddressId) { $objListItem->Selected = true; } $this->lstToAddress->AddItem($objListItem); } } } if ($this->lblToAddressId) { $this->lblToAddressId->Text = $this->objShipment->ToAddress ? $this->objShipment->ToAddress->__toString() : null; } if ($this->lstCourier) { $this->lstCourier->RemoveAllItems(); $this->lstCourier->AddItem(QApplication::Translate('- Select One -'), null); $objCourierArray = Courier::LoadAll(); if ($objCourierArray) { foreach ($objCourierArray as $objCourier) { $objListItem = new QListItem($objCourier->__toString(), $objCourier->CourierId); if ($this->objShipment->Courier && $this->objShipment->Courier->CourierId == $objCourier->CourierId) { $objListItem->Selected = true; } $this->lstCourier->AddItem($objListItem); } } } if ($this->lblCourierId) { $this->lblCourierId->Text = $this->objShipment->Courier ? $this->objShipment->Courier->__toString() : null; } if ($this->txtTrackingNumber) { $this->txtTrackingNumber->Text = $this->objShipment->TrackingNumber; } if ($this->lblTrackingNumber) { $this->lblTrackingNumber->Text = $this->objShipment->TrackingNumber; } if ($this->calShipDate) { $this->calShipDate->DateTime = $this->objShipment->ShipDate; } if ($this->lblShipDate) { $this->lblShipDate->Text = sprintf($this->objShipment->ShipDate) ? $this->objShipment->__toString($this->strShipDateDateTimeFormat) : null; } if ($this->chkShippedFlag) { $this->chkShippedFlag->Checked = $this->objShipment->ShippedFlag; } if ($this->lblShippedFlag) { $this->lblShippedFlag->Text = $this->objShipment->ShippedFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->lstCreatedByObject) { $this->lstCreatedByObject->RemoveAllItems(); $this->lstCreatedByObject->AddItem(QApplication::Translate('- Select One -'), null); $objCreatedByObjectArray = UserAccount::LoadAll(); if ($objCreatedByObjectArray) { foreach ($objCreatedByObjectArray as $objCreatedByObject) { $objListItem = new QListItem($objCreatedByObject->__toString(), $objCreatedByObject->UserAccountId); if ($this->objShipment->CreatedByObject && $this->objShipment->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objShipment->CreatedByObject ? $this->objShipment->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objShipment->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objShipment->CreationDate) ? $this->objShipment->__toString($this->strCreationDateDateTimeFormat) : null; } if ($this->lstModifiedByObject) { $this->lstModifiedByObject->RemoveAllItems(); $this->lstModifiedByObject->AddItem(QApplication::Translate('- Select One -'), null); $objModifiedByObjectArray = UserAccount::LoadAll(); if ($objModifiedByObjectArray) { foreach ($objModifiedByObjectArray as $objModifiedByObject) { $objListItem = new QListItem($objModifiedByObject->__toString(), $objModifiedByObject->UserAccountId); if ($this->objShipment->ModifiedByObject && $this->objShipment->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objShipment->ModifiedByObject ? $this->objShipment->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objShipment->ModifiedDate; } } if ($this->lstShipmentCustomFieldHelper) { $this->lstShipmentCustomFieldHelper->RemoveAllItems(); $this->lstShipmentCustomFieldHelper->AddItem(QApplication::Translate('- Select One -'), null); $objShipmentCustomFieldHelperArray = ShipmentCustomFieldHelper::LoadAll(); if ($objShipmentCustomFieldHelperArray) { foreach ($objShipmentCustomFieldHelperArray as $objShipmentCustomFieldHelper) { $objListItem = new QListItem($objShipmentCustomFieldHelper->__toString(), $objShipmentCustomFieldHelper->ShipmentId); if ($objShipmentCustomFieldHelper->ShipmentId == $this->objShipment->ShipmentId) { $objListItem->Selected = true; } $this->lstShipmentCustomFieldHelper->AddItem($objListItem); } } // Because ShipmentCustomFieldHelper's ShipmentCustomFieldHelper is not null, if a value is already selected, it cannot be changed. if ($this->lstShipmentCustomFieldHelper->SelectedValue) { $this->lstShipmentCustomFieldHelper->Enabled = false; } else { $this->lstShipmentCustomFieldHelper->Enabled = true; } } if ($this->lblShipmentCustomFieldHelper) { $this->lblShipmentCustomFieldHelper->Text = $this->objShipment->ShipmentCustomFieldHelper ? $this->objShipment->ShipmentCustomFieldHelper->__toString() : null; } }
/** * Refresh this MetaControl with Data from the local InventoryTransaction object. * @param boolean $blnReload reload InventoryTransaction from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objInventoryTransaction->Reload(); } if ($this->lblInventoryTransactionId) { if ($this->blnEditMode) { $this->lblInventoryTransactionId->Text = $this->objInventoryTransaction->InventoryTransactionId; } } if ($this->lstInventoryLocation) { $this->lstInventoryLocation->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstInventoryLocation->AddItem(QApplication::Translate('- Select One -'), null); } $objInventoryLocationArray = InventoryLocation::LoadAll(); if ($objInventoryLocationArray) { foreach ($objInventoryLocationArray as $objInventoryLocation) { $objListItem = new QListItem($objInventoryLocation->__toString(), $objInventoryLocation->InventoryLocationId); if ($this->objInventoryTransaction->InventoryLocation && $this->objInventoryTransaction->InventoryLocation->InventoryLocationId == $objInventoryLocation->InventoryLocationId) { $objListItem->Selected = true; } $this->lstInventoryLocation->AddItem($objListItem); } } } if ($this->lblInventoryLocationId) { $this->lblInventoryLocationId->Text = $this->objInventoryTransaction->InventoryLocation ? $this->objInventoryTransaction->InventoryLocation->__toString() : null; } if ($this->lstTransaction) { $this->lstTransaction->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstTransaction->AddItem(QApplication::Translate('- Select One -'), null); } $objTransactionArray = Transaction::LoadAll(); if ($objTransactionArray) { foreach ($objTransactionArray as $objTransaction) { $objListItem = new QListItem($objTransaction->__toString(), $objTransaction->TransactionId); if ($this->objInventoryTransaction->Transaction && $this->objInventoryTransaction->Transaction->TransactionId == $objTransaction->TransactionId) { $objListItem->Selected = true; } $this->lstTransaction->AddItem($objListItem); } } } if ($this->lblTransactionId) { $this->lblTransactionId->Text = $this->objInventoryTransaction->Transaction ? $this->objInventoryTransaction->Transaction->__toString() : null; } if ($this->txtQuantity) { $this->txtQuantity->Text = $this->objInventoryTransaction->Quantity; } if ($this->lblQuantity) { $this->lblQuantity->Text = $this->objInventoryTransaction->Quantity; } if ($this->lstSourceLocation) { $this->lstSourceLocation->RemoveAllItems(); $this->lstSourceLocation->AddItem(QApplication::Translate('- Select One -'), null); $objSourceLocationArray = Location::LoadAll(); if ($objSourceLocationArray) { foreach ($objSourceLocationArray as $objSourceLocation) { $objListItem = new QListItem($objSourceLocation->__toString(), $objSourceLocation->LocationId); if ($this->objInventoryTransaction->SourceLocation && $this->objInventoryTransaction->SourceLocation->LocationId == $objSourceLocation->LocationId) { $objListItem->Selected = true; } $this->lstSourceLocation->AddItem($objListItem); } } } if ($this->lblSourceLocationId) { $this->lblSourceLocationId->Text = $this->objInventoryTransaction->SourceLocation ? $this->objInventoryTransaction->SourceLocation->__toString() : null; } if ($this->lstDestinationLocation) { $this->lstDestinationLocation->RemoveAllItems(); $this->lstDestinationLocation->AddItem(QApplication::Translate('- Select One -'), null); $objDestinationLocationArray = Location::LoadAll(); if ($objDestinationLocationArray) { foreach ($objDestinationLocationArray as $objDestinationLocation) { $objListItem = new QListItem($objDestinationLocation->__toString(), $objDestinationLocation->LocationId); if ($this->objInventoryTransaction->DestinationLocation && $this->objInventoryTransaction->DestinationLocation->LocationId == $objDestinationLocation->LocationId) { $objListItem->Selected = true; } $this->lstDestinationLocation->AddItem($objListItem); } } } if ($this->lblDestinationLocationId) { $this->lblDestinationLocationId->Text = $this->objInventoryTransaction->DestinationLocation ? $this->objInventoryTransaction->DestinationLocation->__toString() : null; } if ($this->lstCreatedByObject) { $this->lstCreatedByObject->RemoveAllItems(); $this->lstCreatedByObject->AddItem(QApplication::Translate('- Select One -'), null); $objCreatedByObjectArray = UserAccount::LoadAll(); if ($objCreatedByObjectArray) { foreach ($objCreatedByObjectArray as $objCreatedByObject) { $objListItem = new QListItem($objCreatedByObject->__toString(), $objCreatedByObject->UserAccountId); if ($this->objInventoryTransaction->CreatedByObject && $this->objInventoryTransaction->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objInventoryTransaction->CreatedByObject ? $this->objInventoryTransaction->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objInventoryTransaction->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objInventoryTransaction->CreationDate) ? $this->objInventoryTransaction->__toString($this->strCreationDateDateTimeFormat) : null; } if ($this->lstModifiedByObject) { $this->lstModifiedByObject->RemoveAllItems(); $this->lstModifiedByObject->AddItem(QApplication::Translate('- Select One -'), null); $objModifiedByObjectArray = UserAccount::LoadAll(); if ($objModifiedByObjectArray) { foreach ($objModifiedByObjectArray as $objModifiedByObject) { $objListItem = new QListItem($objModifiedByObject->__toString(), $objModifiedByObject->UserAccountId); if ($this->objInventoryTransaction->ModifiedByObject && $this->objInventoryTransaction->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objInventoryTransaction->ModifiedByObject ? $this->objInventoryTransaction->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objInventoryTransaction->ModifiedDate; } } }
public function dtgTransaction_Bind() { // Get Total Count b/c of Pagination $this->dtgTransaction->TotalItemCount = Transaction::CountAll(); $objClauses = array(); if ($objClause = $this->dtgTransaction->OrderByClause) { array_push($objClauses, $objClause); } if ($objClause = $this->dtgTransaction->LimitClause) { array_push($objClauses, $objClause); } $this->dtgTransaction->DataSource = Transaction::LoadAll($objClauses); }
/** * Refresh this MetaControl with Data from the local AssetTransaction object. * @param boolean $blnReload reload AssetTransaction from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objAssetTransaction->Reload(); } if ($this->lblAssetTransactionId) { if ($this->blnEditMode) { $this->lblAssetTransactionId->Text = $this->objAssetTransaction->AssetTransactionId; } } if ($this->lstAsset) { $this->lstAsset->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstAsset->AddItem(QApplication::Translate('- Select One -'), null); } $objAssetArray = Asset::LoadAll(); if ($objAssetArray) { foreach ($objAssetArray as $objAsset) { $objListItem = new QListItem($objAsset->__toString(), $objAsset->AssetId); if ($this->objAssetTransaction->Asset && $this->objAssetTransaction->Asset->AssetId == $objAsset->AssetId) { $objListItem->Selected = true; } $this->lstAsset->AddItem($objListItem); } } } if ($this->lblAssetId) { $this->lblAssetId->Text = $this->objAssetTransaction->Asset ? $this->objAssetTransaction->Asset->__toString() : null; } if ($this->lstTransaction) { $this->lstTransaction->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstTransaction->AddItem(QApplication::Translate('- Select One -'), null); } $objTransactionArray = Transaction::LoadAll(); if ($objTransactionArray) { foreach ($objTransactionArray as $objTransaction) { $objListItem = new QListItem($objTransaction->__toString(), $objTransaction->TransactionId); if ($this->objAssetTransaction->Transaction && $this->objAssetTransaction->Transaction->TransactionId == $objTransaction->TransactionId) { $objListItem->Selected = true; } $this->lstTransaction->AddItem($objListItem); } } } if ($this->lblTransactionId) { $this->lblTransactionId->Text = $this->objAssetTransaction->Transaction ? $this->objAssetTransaction->Transaction->__toString() : null; } if ($this->lstParentAssetTransaction) { $this->lstParentAssetTransaction->RemoveAllItems(); $this->lstParentAssetTransaction->AddItem(QApplication::Translate('- Select One -'), null); $objParentAssetTransactionArray = AssetTransaction::LoadAll(); if ($objParentAssetTransactionArray) { foreach ($objParentAssetTransactionArray as $objParentAssetTransaction) { $objListItem = new QListItem($objParentAssetTransaction->__toString(), $objParentAssetTransaction->AssetTransactionId); if ($this->objAssetTransaction->ParentAssetTransaction && $this->objAssetTransaction->ParentAssetTransaction->AssetTransactionId == $objParentAssetTransaction->AssetTransactionId) { $objListItem->Selected = true; } $this->lstParentAssetTransaction->AddItem($objListItem); } } } if ($this->lblParentAssetTransactionId) { $this->lblParentAssetTransactionId->Text = $this->objAssetTransaction->ParentAssetTransaction ? $this->objAssetTransaction->ParentAssetTransaction->__toString() : null; } if ($this->lstSourceLocation) { $this->lstSourceLocation->RemoveAllItems(); $this->lstSourceLocation->AddItem(QApplication::Translate('- Select One -'), null); $objSourceLocationArray = Location::LoadAll(); if ($objSourceLocationArray) { foreach ($objSourceLocationArray as $objSourceLocation) { $objListItem = new QListItem($objSourceLocation->__toString(), $objSourceLocation->LocationId); if ($this->objAssetTransaction->SourceLocation && $this->objAssetTransaction->SourceLocation->LocationId == $objSourceLocation->LocationId) { $objListItem->Selected = true; } $this->lstSourceLocation->AddItem($objListItem); } } } if ($this->lblSourceLocationId) { $this->lblSourceLocationId->Text = $this->objAssetTransaction->SourceLocation ? $this->objAssetTransaction->SourceLocation->__toString() : null; } if ($this->lstDestinationLocation) { $this->lstDestinationLocation->RemoveAllItems(); $this->lstDestinationLocation->AddItem(QApplication::Translate('- Select One -'), null); $objDestinationLocationArray = Location::LoadAll(); if ($objDestinationLocationArray) { foreach ($objDestinationLocationArray as $objDestinationLocation) { $objListItem = new QListItem($objDestinationLocation->__toString(), $objDestinationLocation->LocationId); if ($this->objAssetTransaction->DestinationLocation && $this->objAssetTransaction->DestinationLocation->LocationId == $objDestinationLocation->LocationId) { $objListItem->Selected = true; } $this->lstDestinationLocation->AddItem($objListItem); } } } if ($this->lblDestinationLocationId) { $this->lblDestinationLocationId->Text = $this->objAssetTransaction->DestinationLocation ? $this->objAssetTransaction->DestinationLocation->__toString() : null; } if ($this->chkNewAssetFlag) { $this->chkNewAssetFlag->Checked = $this->objAssetTransaction->NewAssetFlag; } if ($this->lblNewAssetFlag) { $this->lblNewAssetFlag->Text = $this->objAssetTransaction->NewAssetFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->lstNewAsset) { $this->lstNewAsset->RemoveAllItems(); $this->lstNewAsset->AddItem(QApplication::Translate('- Select One -'), null); $objNewAssetArray = Asset::LoadAll(); if ($objNewAssetArray) { foreach ($objNewAssetArray as $objNewAsset) { $objListItem = new QListItem($objNewAsset->__toString(), $objNewAsset->AssetId); if ($this->objAssetTransaction->NewAsset && $this->objAssetTransaction->NewAsset->AssetId == $objNewAsset->AssetId) { $objListItem->Selected = true; } $this->lstNewAsset->AddItem($objListItem); } } } if ($this->lblNewAssetId) { $this->lblNewAssetId->Text = $this->objAssetTransaction->NewAsset ? $this->objAssetTransaction->NewAsset->__toString() : null; } if ($this->chkScheduleReceiptFlag) { $this->chkScheduleReceiptFlag->Checked = $this->objAssetTransaction->ScheduleReceiptFlag; } if ($this->lblScheduleReceiptFlag) { $this->lblScheduleReceiptFlag->Text = $this->objAssetTransaction->ScheduleReceiptFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } if ($this->calScheduleReceiptDueDate) { $this->calScheduleReceiptDueDate->DateTime = $this->objAssetTransaction->ScheduleReceiptDueDate; } if ($this->lblScheduleReceiptDueDate) { $this->lblScheduleReceiptDueDate->Text = sprintf($this->objAssetTransaction->ScheduleReceiptDueDate) ? $this->objAssetTransaction->__toString($this->strScheduleReceiptDueDateDateTimeFormat) : null; } if ($this->lstCreatedByObject) { $this->lstCreatedByObject->RemoveAllItems(); $this->lstCreatedByObject->AddItem(QApplication::Translate('- Select One -'), null); $objCreatedByObjectArray = UserAccount::LoadAll(); if ($objCreatedByObjectArray) { foreach ($objCreatedByObjectArray as $objCreatedByObject) { $objListItem = new QListItem($objCreatedByObject->__toString(), $objCreatedByObject->UserAccountId); if ($this->objAssetTransaction->CreatedByObject && $this->objAssetTransaction->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objAssetTransaction->CreatedByObject ? $this->objAssetTransaction->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objAssetTransaction->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objAssetTransaction->CreationDate) ? $this->objAssetTransaction->__toString($this->strCreationDateDateTimeFormat) : null; } if ($this->lstModifiedByObject) { $this->lstModifiedByObject->RemoveAllItems(); $this->lstModifiedByObject->AddItem(QApplication::Translate('- Select One -'), null); $objModifiedByObjectArray = UserAccount::LoadAll(); if ($objModifiedByObjectArray) { foreach ($objModifiedByObjectArray as $objModifiedByObject) { $objListItem = new QListItem($objModifiedByObject->__toString(), $objModifiedByObject->UserAccountId); if ($this->objAssetTransaction->ModifiedByObject && $this->objAssetTransaction->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objAssetTransaction->ModifiedByObject ? $this->objAssetTransaction->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objAssetTransaction->ModifiedDate; } } if ($this->lstAssetTransactionCheckout) { $this->lstAssetTransactionCheckout->RemoveAllItems(); $this->lstAssetTransactionCheckout->AddItem(QApplication::Translate('- Select One -'), null); $objAssetTransactionCheckoutArray = AssetTransactionCheckout::LoadAll(); if ($objAssetTransactionCheckoutArray) { foreach ($objAssetTransactionCheckoutArray as $objAssetTransactionCheckout) { $objListItem = new QListItem($objAssetTransactionCheckout->__toString(), $objAssetTransactionCheckout->AssetTransactionCheckoutId); if ($objAssetTransactionCheckout->AssetTransactionId == $this->objAssetTransaction->AssetTransactionId) { $objListItem->Selected = true; } $this->lstAssetTransactionCheckout->AddItem($objListItem); } } // Because AssetTransactionCheckout's AssetTransactionCheckout is not null, if a value is already selected, it cannot be changed. if ($this->lstAssetTransactionCheckout->SelectedValue) { $this->lstAssetTransactionCheckout->Enabled = false; } else { $this->lstAssetTransactionCheckout->Enabled = true; } } if ($this->lblAssetTransactionCheckout) { $this->lblAssetTransactionCheckout->Text = $this->objAssetTransaction->AssetTransactionCheckout ? $this->objAssetTransaction->AssetTransactionCheckout->__toString() : null; } }
protected function dtgTransaction_Bind() { // Because we want to enable pagination AND sorting, we need to setup the $objClauses array to send to LoadAll() // Remember! We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below $this->dtgTransaction->TotalItemCount = Transaction::CountAll(); // Setup the $objClauses Array $objClauses = array(); // If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add // the OrderByClause to the $objClauses array if ($objClause = $this->dtgTransaction->OrderByClause) { array_push($objClauses, $objClause); } // Add the LimitClause information, as well if ($objClause = $this->dtgTransaction->LimitClause) { array_push($objClauses, $objClause); } // Set the DataSource to be the array of all Transaction objects, given the clauses above $this->dtgTransaction->DataSource = Transaction::LoadAll($objClauses); }