Exemplo n.º 1
0
 function Update($ID, &$arFields)
 {
     global $DB;
     $ID = IntVal($ID);
     if ($ID <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGS_NO_ID"), "NO_ID");
         return false;
     }
     if (!CSaleGroupAccessToFlag::CheckFields("UPDATE", $arFields, $ID)) {
         return false;
     }
     $strUpdate = $DB->PrepareUpdate("b_sale_order_flags2group", $arFields);
     $strSql = "UPDATE b_sale_order_flags2group SET " . $strUpdate . " WHERE ID = " . $ID . " ";
     $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     return True;
 }
Exemplo n.º 2
0
 public static function Add($arFields)
 {
     global $DB;
     if (!CSaleGroupAccessToFlag::CheckFields("ADD", $arFields)) {
         return false;
     }
     $arInsert = $DB->PrepareInsert("b_sale_order_flags2group", $arFields);
     $strSql = "INSERT INTO b_sale_order_flags2group(" . $arInsert[0] . ") " . "VALUES(" . $arInsert[1] . ")";
     $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     $ID = IntVal($DB->LastID());
     return $ID;
 }