function Update($ID, $arFields) { global $DB; $ID = IntVal($ID); if (!CSaleOrderTax::CheckFields("UPDATE", $arFields)) { return false; } $strUpdate = $DB->PrepareUpdate("b_sale_order_tax", $arFields); $strSql = "UPDATE b_sale_order_tax SET " . "\t" . $strUpdate . " " . "WHERE ID = " . $ID . " "; $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__); return $ID; }
function Add($arFields) { global $DB; if (!CSaleOrderTax::CheckFields("ADD", $arFields)) { return false; } $arInsert = $DB->PrepareInsert("b_sale_order_tax", $arFields); $strSql = "INSERT INTO b_sale_order_tax(" . $arInsert[0] . ") " . "VALUES(" . $arInsert[1] . ")"; $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__); $ID = IntVal($DB->LastID()); return $ID; }
function Add($arFields) { global $DB; if (!CSaleOrderTax::CheckFields("ADD", $arFields)) { return false; } $dbResult = CSaleOrderTax::GetList(array(), array("ORDER_ID" => $arFields['ORDER_ID'], "TAX_NAME" => $arFields['TAX_NAME'], "CODE" => $arFields['CODE']), false, false, array("ID")); if ($dbResult->Fetch()) { return false; } $arInsert = $DB->PrepareInsert("b_sale_order_tax", $arFields); $strSql = "INSERT INTO b_sale_order_tax(" . $arInsert[0] . ") " . "VALUES(" . $arInsert[1] . ")"; $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__); $ID = IntVal($DB->LastID()); return $ID; }