function addBusiness_product($sessionkey, $appcode, $Business_productdata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Business_product = new Business_product(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "BUSINESSID": $obj_Business_product->BusinessId = $child; break; case "PRODUCTID": $obj_Business_product->ProductId = $child; break; } } $obj_retResult_Business_product = DAL_manageBusiness_product::addBusiness_product($obj_Business_product); if ($obj_retResult_Business_product->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getBusiness_productXml($obj_retResult_Business_product->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function addBusiness_product2($BusinessId, $ProductId) { $obj_retResult = new returnResult(); $obj_newBusiness_product = new Business_product(); $obj_newuser->setBusiness_product($BusinessId, $ProductId); // $isExist = BL_manageBusiness_product::isExist($obj_newBusiness_product->id); if (!$isExist) { $obj_retResult_Business_product = DAL_manageBusiness_product::addBusiness_product($obj_newBusiness_product); if ($obj_retResult_Business_product->type == 1) { $obj_retResult->type = 1; $obj_retResult->msg = "Success"; $obj_retResult->data = $obj_retResult_Business_product->data; } else { $obj_retResult->type = 0; $obj_retResult->msg = "Failed"; } } else { $obj_retResult->type = 0; $obj_retResult->msg = "Sorry! Business_product already exist"; } return $obj_retResult; }