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


PHP CSaleOrderTax::DeleteEx方法代码示例

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


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

示例1: _Delete

 function _Delete($ID)
 {
     global $DB;
     $ID = IntVal($ID);
     $bSuccess = True;
     foreach (GetModuleEvents("sale", "OnBeforeOrderDelete", true) as $arEvent) {
         if (ExecuteModuleEventEx($arEvent, array($ID)) === false) {
             return false;
         }
     }
     $DB->StartTransaction();
     if ($bSuccess) {
         $dbBasket = CSaleBasket::GetList(array(), array("ORDER_ID" => $ID));
         while ($arBasket = $dbBasket->Fetch()) {
             $bSuccess = CSaleBasket::Delete($arBasket["ID"]);
             if (!$bSuccess) {
                 break;
             }
         }
     }
     if ($bSuccess) {
         $dbRecurring = CSaleRecurring::GetList(array(), array("ORDER_ID" => $ID));
         while ($arRecurring = $dbRecurring->Fetch()) {
             $bSuccess = CSaleRecurring::Delete($arRecurring["ID"]);
             if (!$bSuccess) {
                 break;
             }
         }
     }
     if ($bSuccess) {
         $bSuccess = CSaleOrderPropsValue::DeleteByOrder($ID);
     }
     if ($bSuccess) {
         $bSuccess = CSaleOrderTax::DeleteEx($ID);
     }
     if ($bSuccess) {
         $bSuccess = CSaleUserTransact::DeleteByOrder($ID);
     }
     if ($bSuccess) {
         unset($GLOBALS["SALE_ORDER"]["SALE_ORDER_CACHE_" . $ID]);
     }
     if ($bSuccess) {
         $bSuccess = $DB->Query("DELETE FROM b_sale_order WHERE ID = " . $ID . "", true);
     }
     if ($bSuccess) {
         $DB->Commit();
     } else {
         $DB->Rollback();
     }
     foreach (GetModuleEvents("sale", "OnOrderDelete", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array($ID, $bSuccess));
     }
     return $bSuccess;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:54,代码来源:order.php

示例2: _Delete

	function _Delete($ID)
	{
		global $DB, $USER_FIELD_MANAGER;

		$ID = IntVal($ID);
		$bSuccess = True;

		foreach(GetModuleEvents("sale", "OnBeforeOrderDelete", true) as $arEvent)
			if (ExecuteModuleEventEx($arEvent, Array($ID))===false)
				return false;

		$DB->StartTransaction();

		if ($bSuccess)
		{
			$dbBasket = CSaleBasket::GetList(array(), array("ORDER_ID" => $ID));
			while ($arBasket = $dbBasket->Fetch())
			{
				if (CSaleBasketHelper::isSetItem($arBasket)) // set items are deleted when parent is deleted
					continue;

				$bSuccess = CSaleBasket::Delete($arBasket["ID"]);
				if (!$bSuccess)
					break;
			}
		}

		if ($bSuccess)
		{
			$dbRecurring = CSaleRecurring::GetList(array(), array("ORDER_ID" => $ID));
			while ($arRecurring = $dbRecurring->Fetch())
			{
				$bSuccess = CSaleRecurring::Delete($arRecurring["ID"]);
				if (!$bSuccess)
					break;
			}
		}

		if ($bSuccess)
			$bSuccess = CSaleOrderPropsValue::DeleteByOrder($ID);

		if ($bSuccess)
			$bSuccess = CSaleOrderTax::DeleteEx($ID);

		if($bSuccess)
			$bSuccess = CSaleUserTransact::DeleteByOrder($ID);

		if ($bSuccess)
			unset($GLOBALS["SALE_ORDER"]["SALE_ORDER_CACHE_".$ID]);

		if ($bSuccess)
			$bSuccess = $DB->Query("DELETE FROM b_sale_order WHERE ID = ".$ID."", true);

		if ($bSuccess)
			$USER_FIELD_MANAGER->Delete("ORDER", $ID);

		if ($bSuccess)
			$DB->Commit();
		else
			$DB->Rollback();

		foreach(GetModuleEvents("sale", "OnOrderDelete", true) as $arEvent)
			ExecuteModuleEventEx($arEvent, Array($ID, $bSuccess));


		return $bSuccess;
	}
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:67,代码来源:order.php


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