Exemplo n.º 1
0
 protected function dtgShipmentReceipt_Bind()
 {
     // Get Total Count for Pagination
     $objClauses = array();
     $this->ctlAssetEdit->dtgShipmentReceipt->TotalItemCount = AssetTransaction::CountShipmentReceiptByAssetId($this->ctlAssetEdit->objAsset->AssetId);
     if ($this->ctlAssetEdit->dtgShipmentReceipt->TotalItemCount === 0) {
         $this->ctlAssetEdit->lblShipmentReceipt->Display = false;
         $this->ctlAssetEdit->dtgShipmentReceipt->ShowHeader = false;
     } else {
         $objClauses = array();
         if ($objClause = QQ::OrderBy(QQN::AssetTransaction()->Transaction->CreationDate, false)) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = $this->ctlAssetEdit->dtgShipmentReceipt->LimitClause) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = QQ::Expand(QQN::AssetTransaction()->Transaction->Shipment)) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = QQ::Expand(QQN::AssetTransaction()->Transaction->Receipt)) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = QQ::Expand(QQN::AssetTransaction()->SourceLocation)) {
             array_push($objClauses, $objClause);
         }
         if ($objClause = QQ::Expand(QQN::AssetTransaction()->DestinationLocation)) {
             array_push($objClauses, $objClause);
         }
         $objCondition = QQ::AndCondition(QQ::Equal(QQN::AssetTransaction()->AssetId, $this->ctlAssetEdit->objAsset->AssetId), QQ::OrCondition(QQ::Equal(QQN::AssetTransaction()->Transaction->TransactionTypeId, 6), QQ::Equal(QQN::AssetTransaction()->Transaction->TransactionTypeId, 7)));
         $this->ctlAssetEdit->dtgShipmentReceipt->DataSource = AssetTransaction::QueryArray($objCondition, $objClauses);
     }
 }