当前位置: 首页>>代码示例>>PHP>>正文


PHP Location::LoadByShortDescription方法代码示例

本文整理汇总了PHP中Location::LoadByShortDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::LoadByShortDescription方法的具体用法?PHP Location::LoadByShortDescription怎么用?PHP Location::LoadByShortDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Location的用法示例。


在下文中一共展示了Location::LoadByShortDescription方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: btnSave_Click

 protected function btnSave_Click($strFormId, $strControlId, $strParameter)
 {
     if ($objLocation = Location::LoadByShortDescription($this->txtShortDescription->Text)) {
         $this->txtShortDescription->Warning = 'This Location Name is already in use. Please try another.';
     } else {
         try {
             $this->UpdateLocationFields();
             $this->objLocation->Save();
             $this->RedirectToListPage();
         } catch (QExtendedOptimisticLockingException $objExc) {
             $this->btnCancel->Warning = sprintf('This location has been updated by another user. You must <a href="location_edit.php?intLocationId=%s">Refresh</a> to edit this location.', $this->objLocation->LocationId);
         }
     }
 }
开发者ID:heshuai64,项目名称:einv2,代码行数:14,代码来源:location_edit.php

示例2: sprintf

require_once '../includes/prepend.inc.php';
QApplication::Authenticate();
$objDatabase = Location::GetDatabase();
// Load the Location Object by location_id=6
$objLocation = Location::Load(6);
// If the location exist or already updated
if ($objLocation && $objLocation->ShortDescription != 'Archived') {
    $objDatabase->NonQuery("SET FOREIGN_KEY_CHECKS = 0;");
    // Update location_id=6 to 'Archived'
    $strQuery = sprintf("UPDATE `location`\n                      SET `short_description`='Archived', `created_by`=NULL, `modified_by`=NULL, `creation_date`=NULL, `modified_date`=NULL, `long_description`=NULL\n                      WHERE `location_id`='6';");
    $objDatabase->NonQuery($strQuery);
    // Save existing location with new location_id
    $strQuery = sprintf("INSERT INTO `location` VALUES\n    (NULL, '{$objLocation->ShortDescription}', '{$objLocation->LongDescription}', '{$objLocation->CreatedBy}', '" . $objLocation->CreationDate->PHPDate('Y-m-d H:i:s') . "', '{$objLocation->ModifiedBy}', '{$objLocation->ModifiedDate}');");
    // Save and reload old location
    $objDatabase->NonQuery($strQuery);
    $objNewLocation = Location::LoadByShortDescription($objLocation->ShortDescription);
    // Get new location_id
    $objNewLocationId = $objNewLocation->LocationId;
    // Update all foreign keys and links
    // Added `modified_date`=`modified_date` to avoid the attribute "ON UPDATE CURRENT_TIMESTAMP"
    $strQuery = sprintf("UPDATE `asset`\n                      SET `location_id`='%s', `modified_date`=`modified_date`\n                      WHERE `location_id`='6';", $objNewLocationId);
    $objDatabase->NonQuery($strQuery);
    $strQuery = sprintf("UPDATE `audit_scan`\n                      SET `location_id`='%s'\n                      WHERE `location_id`='6';", $objNewLocationId);
    $objDatabase->NonQuery($strQuery);
    $strQuery = sprintf("UPDATE `inventory_location`\n                      SET `location_id`='%s', `modified_date`=`modified_date`\n                      WHERE `location_id`='6';", $objNewLocationId);
    $objDatabase->NonQuery($strQuery);
    $strQuery = sprintf("UPDATE `asset_transaction`\n                      SET `source_location_id`='%s', `modified_date`=`modified_date`\n                      WHERE `source_location_id`='6';", $objNewLocationId);
    $objDatabase->NonQuery($strQuery);
    $strQuery = sprintf("UPDATE `asset_transaction`\n                      SET `destination_location_id`='%s', `modified_date`=`modified_date`\n                      WHERE `destination_location_id`='6';", $objNewLocationId);
    $objDatabase->NonQuery($strQuery);
    $strQuery = sprintf("UPDATE `inventory_transaction`\n                      SET `source_location_id`='%s', `modified_date`=`modified_date`\n                      WHERE `source_location_id`='6';", $objNewLocationId);
开发者ID:brustj,项目名称:tracmor,代码行数:31,代码来源:asset_archive_update.php

示例3: Transaction

             if (QApplication::$TracmorSettings->StrictCheckinPolicy == '1' && $objUserAccount->UserAccountId != QApplication::$objUserAccount->UserAccountId) {
                 $blnError = true;
                 $strWarning .= $strAssetCode . " - That asset was not checked out by the current user.<br />";
             } else {
                 $arrCheckedAssetCode[] = $strAssetCode;
             }
         }
         if (!$blnError && $objNewAsset instanceof Asset) {
             $objAssetArray[] = $objNewAsset;
         }
     } else {
         $strWarning .= "Please enter an asset tag.<br />";
     }
 }
 if (!$blnError) {
     $objDestinationLocation = Location::LoadByShortDescription($_POST['destination_location']);
     if (!$objDestinationLocation) {
         $blnError = true;
         $strWarning .= $_POST['destination_location'] . " - Destination Location does not exist.<br />";
     } else {
         $intDestinationLocationId = $objDestinationLocation->LocationId;
         // There is a 1 to Many relationship between Transaction and AssetTransaction so each Transaction can have many AssetTransactions.
         $objTransaction = new Transaction();
         $objTransaction->EntityQtypeId = EntityQtype::Asset;
         $objTransaction->TransactionTypeId = 2;
         // Check in
         $objTransaction->Save();
         foreach ($objAssetArray as $objAsset) {
             $objAssetTransaction = new AssetTransaction();
             $objAssetTransaction->AssetId = $objAsset->AssetId;
             $objAssetTransaction->TransactionId = $objTransaction->TransactionId;
开发者ID:proxymoron,项目名称:tracmor,代码行数:31,代码来源:asset_check_in.php

示例4: elseif

 } elseif ($objNewAsset->LinkedFlag) {
     $blnError = true;
     $strWarning .= $strAssetCode . " - That asset is locked to a parent asset.";
 } elseif (!($objNewAsset->LocationId == 5 || $objNewAsset->LocationId == 2)) {
     $blnError = true;
     $strWarning .= $strAssetCode . " - That asset has already been received.<br />";
 } elseif (!($objPendingReceipt = AssetTransaction::PendingReceipt($objNewAsset->AssetId))) {
     $blnError = true;
     $strWarning .= $strAssetCode . " - That asset must be in a pending receipt.<br />";
 } elseif ($objNewAsset->CheckedOutFlag) {
     $blnError = true;
     $strWarning .= $strAssetCode . " - That asset is checked out.<br />";
 } elseif ($objNewAsset->ReservedFlag) {
     $blnError = true;
     $strWarning .= $strAssetCode . " - That asset is reserved.<br />";
 } elseif (!($objDestinationLocation = Location::LoadByShortDescription($strLocation))) {
     $blnError = true;
     $strWarning .= $strLocation . " - Destination Location does not exist.<br />";
 } else {
     if (!array_key_exists($objNewAsset->AssetId, $arrLocation)) {
         $arrLocation[$objNewAsset->AssetId] = $objDestinationLocation;
         $arrCheckedAssetCodeLocation[] = $strAssetCodeLocation;
     } else {
         $blnError = true;
         $strWarning .= $strAssetCode . " - That is a duplicate asset tag.<br />";
     }
 }
 if (!$blnError && $objNewAsset instanceof Asset) {
     $objAssetArray[] = $objNewAsset;
     $arrPendingReceiptId[] = $objPendingReceipt->Transaction->Receipt->ReceiptId;
     $objAssetTransactionArray[$objNewAsset->AssetId] = $objPendingReceipt;
开发者ID:proxymoron,项目名称:tracmor,代码行数:31,代码来源:asset_receive.php


注:本文中的Location::LoadByShortDescription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。