protected function dtgTransactionType_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->dtgTransactionType->TotalItemCount = TransactionType::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->dtgTransactionType->OrderByClause) { array_push($objClauses, $objClause); } // Add the LimitClause information, as well if ($objClause = $this->dtgTransactionType->LimitClause) { array_push($objClauses, $objClause); } // Set the DataSource to be the array of all TransactionType objects, given the clauses above $this->dtgTransactionType->DataSource = TransactionType::LoadAll($objClauses); }
protected function lstTransactionType_Create() { $this->lstTransactionType = new QListBox($this); $this->lstTransactionType->Name = QApplication::Translate('Transaction Type'); $this->lstTransactionType->Required = true; if (!$this->blnEditMode) { $this->lstTransactionType->AddItem(QApplication::Translate('- Select One -'), null); } $objTransactionTypeArray = TransactionType::LoadAll(); if ($objTransactionTypeArray) { foreach ($objTransactionTypeArray as $objTransactionType) { $objListItem = new QListItem($objTransactionType->__toString(), $objTransactionType->TransactionTypeId); if ($this->objTransaction->TransactionType && $this->objTransaction->TransactionType->TransactionTypeId == $objTransactionType->TransactionTypeId) { $objListItem->Selected = true; } $this->lstTransactionType->AddItem($objListItem); } } }
public function dtgTransactionType_Bind() { // Get Total Count b/c of Pagination $this->dtgTransactionType->TotalItemCount = TransactionType::CountAll(); $objClauses = array(); if ($objClause = $this->dtgTransactionType->OrderByClause) { array_push($objClauses, $objClause); } if ($objClause = $this->dtgTransactionType->LimitClause) { array_push($objClauses, $objClause); } $this->dtgTransactionType->DataSource = TransactionType::LoadAll($objClauses); }
/** * Refresh this MetaControl with Data from the local Transaction object. * @param boolean $blnReload reload Transaction from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objTransaction->Reload(); } if ($this->lblTransactionId) { if ($this->blnEditMode) { $this->lblTransactionId->Text = $this->objTransaction->TransactionId; } } if ($this->lstEntityQtype) { $this->lstEntityQtype->SelectedValue = $this->objTransaction->EntityQtypeId; } if ($this->lblEntityQtypeId) { $this->lblEntityQtypeId->Text = $this->objTransaction->EntityQtypeId ? EntityQtype::$NameArray[$this->objTransaction->EntityQtypeId] : null; } if ($this->lstTransactionType) { $this->lstTransactionType->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstTransactionType->AddItem(QApplication::Translate('- Select One -'), null); } $objTransactionTypeArray = TransactionType::LoadAll(); if ($objTransactionTypeArray) { foreach ($objTransactionTypeArray as $objTransactionType) { $objListItem = new QListItem($objTransactionType->__toString(), $objTransactionType->TransactionTypeId); if ($this->objTransaction->TransactionType && $this->objTransaction->TransactionType->TransactionTypeId == $objTransactionType->TransactionTypeId) { $objListItem->Selected = true; } $this->lstTransactionType->AddItem($objListItem); } } } if ($this->lblTransactionTypeId) { $this->lblTransactionTypeId->Text = $this->objTransaction->TransactionType ? $this->objTransaction->TransactionType->__toString() : null; } if ($this->txtNote) { $this->txtNote->Text = $this->objTransaction->Note; } if ($this->lblNote) { $this->lblNote->Text = $this->objTransaction->Note; } 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->objTransaction->CreatedByObject && $this->objTransaction->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objTransaction->CreatedByObject ? $this->objTransaction->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objTransaction->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objTransaction->CreationDate) ? $this->objTransaction->__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->objTransaction->ModifiedByObject && $this->objTransaction->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objTransaction->ModifiedByObject ? $this->objTransaction->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objTransaction->ModifiedDate; } } if ($this->lstReceipt) { $this->lstReceipt->RemoveAllItems(); $this->lstReceipt->AddItem(QApplication::Translate('- Select One -'), null); $objReceiptArray = Receipt::LoadAll(); if ($objReceiptArray) { foreach ($objReceiptArray as $objReceipt) { $objListItem = new QListItem($objReceipt->__toString(), $objReceipt->ReceiptId); if ($objReceipt->TransactionId == $this->objTransaction->TransactionId) { $objListItem->Selected = true; } $this->lstReceipt->AddItem($objListItem); } } // Because Receipt's Receipt is not null, if a value is already selected, it cannot be changed. if ($this->lstReceipt->SelectedValue) { $this->lstReceipt->Enabled = false; } else { $this->lstReceipt->Enabled = true; } } if ($this->lblReceipt) { $this->lblReceipt->Text = $this->objTransaction->Receipt ? $this->objTransaction->Receipt->__toString() : null; } if ($this->lstShipment) { $this->lstShipment->RemoveAllItems(); $this->lstShipment->AddItem(QApplication::Translate('- Select One -'), null); $objShipmentArray = Shipment::LoadAll(); if ($objShipmentArray) { foreach ($objShipmentArray as $objShipment) { $objListItem = new QListItem($objShipment->__toString(), $objShipment->ShipmentId); if ($objShipment->TransactionId == $this->objTransaction->TransactionId) { $objListItem->Selected = true; } $this->lstShipment->AddItem($objListItem); } } // Because Shipment's Shipment is not null, if a value is already selected, it cannot be changed. if ($this->lstShipment->SelectedValue) { $this->lstShipment->Enabled = false; } else { $this->lstShipment->Enabled = true; } } if ($this->lblShipment) { $this->lblShipment->Text = $this->objTransaction->Shipment ? $this->objTransaction->Shipment->__toString() : null; } }
/** * Refresh this MetaControl with Data from the local RoleTransactionTypeAuthorization object. * @param boolean $blnReload reload RoleTransactionTypeAuthorization from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objRoleTransactionTypeAuthorization->Reload(); } if ($this->lblRoleTransactionTypeAuthorizationId) { if ($this->blnEditMode) { $this->lblRoleTransactionTypeAuthorizationId->Text = $this->objRoleTransactionTypeAuthorization->RoleTransactionTypeAuthorizationId; } } if ($this->lstRole) { $this->lstRole->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstRole->AddItem(QApplication::Translate('- Select One -'), null); } $objRoleArray = Role::LoadAll(); if ($objRoleArray) { foreach ($objRoleArray as $objRole) { $objListItem = new QListItem($objRole->__toString(), $objRole->RoleId); if ($this->objRoleTransactionTypeAuthorization->Role && $this->objRoleTransactionTypeAuthorization->Role->RoleId == $objRole->RoleId) { $objListItem->Selected = true; } $this->lstRole->AddItem($objListItem); } } } if ($this->lblRoleId) { $this->lblRoleId->Text = $this->objRoleTransactionTypeAuthorization->Role ? $this->objRoleTransactionTypeAuthorization->Role->__toString() : null; } if ($this->lstTransactionType) { $this->lstTransactionType->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstTransactionType->AddItem(QApplication::Translate('- Select One -'), null); } $objTransactionTypeArray = TransactionType::LoadAll(); if ($objTransactionTypeArray) { foreach ($objTransactionTypeArray as $objTransactionType) { $objListItem = new QListItem($objTransactionType->__toString(), $objTransactionType->TransactionTypeId); if ($this->objRoleTransactionTypeAuthorization->TransactionType && $this->objRoleTransactionTypeAuthorization->TransactionType->TransactionTypeId == $objTransactionType->TransactionTypeId) { $objListItem->Selected = true; } $this->lstTransactionType->AddItem($objListItem); } } } if ($this->lblTransactionTypeId) { $this->lblTransactionTypeId->Text = $this->objRoleTransactionTypeAuthorization->TransactionType ? $this->objRoleTransactionTypeAuthorization->TransactionType->__toString() : null; } if ($this->lstAuthorizationLevel) { $this->lstAuthorizationLevel->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstAuthorizationLevel->AddItem(QApplication::Translate('- Select One -'), null); } $objAuthorizationLevelArray = AuthorizationLevel::LoadAll(); if ($objAuthorizationLevelArray) { foreach ($objAuthorizationLevelArray as $objAuthorizationLevel) { $objListItem = new QListItem($objAuthorizationLevel->__toString(), $objAuthorizationLevel->AuthorizationLevelId); if ($this->objRoleTransactionTypeAuthorization->AuthorizationLevel && $this->objRoleTransactionTypeAuthorization->AuthorizationLevel->AuthorizationLevelId == $objAuthorizationLevel->AuthorizationLevelId) { $objListItem->Selected = true; } $this->lstAuthorizationLevel->AddItem($objListItem); } } } if ($this->lblAuthorizationLevelId) { $this->lblAuthorizationLevelId->Text = $this->objRoleTransactionTypeAuthorization->AuthorizationLevel ? $this->objRoleTransactionTypeAuthorization->AuthorizationLevel->__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->objRoleTransactionTypeAuthorization->CreatedByObject && $this->objRoleTransactionTypeAuthorization->CreatedByObject->UserAccountId == $objCreatedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstCreatedByObject->AddItem($objListItem); } } } if ($this->lblCreatedBy) { $this->lblCreatedBy->Text = $this->objRoleTransactionTypeAuthorization->CreatedByObject ? $this->objRoleTransactionTypeAuthorization->CreatedByObject->__toString() : null; } if ($this->calCreationDate) { $this->calCreationDate->DateTime = $this->objRoleTransactionTypeAuthorization->CreationDate; } if ($this->lblCreationDate) { $this->lblCreationDate->Text = sprintf($this->objRoleTransactionTypeAuthorization->CreationDate) ? $this->objRoleTransactionTypeAuthorization->__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->objRoleTransactionTypeAuthorization->ModifiedByObject && $this->objRoleTransactionTypeAuthorization->ModifiedByObject->UserAccountId == $objModifiedByObject->UserAccountId) { $objListItem->Selected = true; } $this->lstModifiedByObject->AddItem($objListItem); } } } if ($this->lblModifiedBy) { $this->lblModifiedBy->Text = $this->objRoleTransactionTypeAuthorization->ModifiedByObject ? $this->objRoleTransactionTypeAuthorization->ModifiedByObject->__toString() : null; } if ($this->lblModifiedDate) { if ($this->blnEditMode) { $this->lblModifiedDate->Text = $this->objRoleTransactionTypeAuthorization->ModifiedDate; } } }
/** * Refresh this MetaControl with Data from the local Shortcut object. * @param boolean $blnReload reload Shortcut from the database * @return void */ public function Refresh($blnReload = false) { if ($blnReload) { $this->objShortcut->Reload(); } if ($this->lblShortcutId) { if ($this->blnEditMode) { $this->lblShortcutId->Text = $this->objShortcut->ShortcutId; } } if ($this->lstModule) { $this->lstModule->RemoveAllItems(); if (!$this->blnEditMode) { $this->lstModule->AddItem(QApplication::Translate('- Select One -'), null); } $objModuleArray = Module::LoadAll(); if ($objModuleArray) { foreach ($objModuleArray as $objModule) { $objListItem = new QListItem($objModule->__toString(), $objModule->ModuleId); if ($this->objShortcut->Module && $this->objShortcut->Module->ModuleId == $objModule->ModuleId) { $objListItem->Selected = true; } $this->lstModule->AddItem($objListItem); } } } if ($this->lblModuleId) { $this->lblModuleId->Text = $this->objShortcut->Module ? $this->objShortcut->Module->__toString() : null; } if ($this->lstAuthorization) { $this->lstAuthorization->RemoveAllItems(); $this->lstAuthorization->AddItem(QApplication::Translate('- Select One -'), null); $objAuthorizationArray = Authorization::LoadAll(); if ($objAuthorizationArray) { foreach ($objAuthorizationArray as $objAuthorization) { $objListItem = new QListItem($objAuthorization->__toString(), $objAuthorization->AuthorizationId); if ($this->objShortcut->Authorization && $this->objShortcut->Authorization->AuthorizationId == $objAuthorization->AuthorizationId) { $objListItem->Selected = true; } $this->lstAuthorization->AddItem($objListItem); } } } if ($this->lblAuthorizationId) { $this->lblAuthorizationId->Text = $this->objShortcut->Authorization ? $this->objShortcut->Authorization->__toString() : null; } if ($this->lstTransactionType) { $this->lstTransactionType->RemoveAllItems(); $this->lstTransactionType->AddItem(QApplication::Translate('- Select One -'), null); $objTransactionTypeArray = TransactionType::LoadAll(); if ($objTransactionTypeArray) { foreach ($objTransactionTypeArray as $objTransactionType) { $objListItem = new QListItem($objTransactionType->__toString(), $objTransactionType->TransactionTypeId); if ($this->objShortcut->TransactionType && $this->objShortcut->TransactionType->TransactionTypeId == $objTransactionType->TransactionTypeId) { $objListItem->Selected = true; } $this->lstTransactionType->AddItem($objListItem); } } } if ($this->lblTransactionTypeId) { $this->lblTransactionTypeId->Text = $this->objShortcut->TransactionType ? $this->objShortcut->TransactionType->__toString() : null; } if ($this->txtShortDescription) { $this->txtShortDescription->Text = $this->objShortcut->ShortDescription; } if ($this->lblShortDescription) { $this->lblShortDescription->Text = $this->objShortcut->ShortDescription; } if ($this->txtLink) { $this->txtLink->Text = $this->objShortcut->Link; } if ($this->lblLink) { $this->lblLink->Text = $this->objShortcut->Link; } if ($this->txtImagePath) { $this->txtImagePath->Text = $this->objShortcut->ImagePath; } if ($this->lblImagePath) { $this->lblImagePath->Text = $this->objShortcut->ImagePath; } if ($this->lstEntityQtype) { $this->lstEntityQtype->SelectedValue = $this->objShortcut->EntityQtypeId; } if ($this->lblEntityQtypeId) { $this->lblEntityQtypeId->Text = $this->objShortcut->EntityQtypeId ? EntityQtype::$NameArray[$this->objShortcut->EntityQtypeId] : null; } if ($this->chkCreateFlag) { $this->chkCreateFlag->Checked = $this->objShortcut->CreateFlag; } if ($this->lblCreateFlag) { $this->lblCreateFlag->Text = $this->objShortcut->CreateFlag ? QApplication::Translate('Yes') : QApplication::Translate('No'); } }