function addPerson_talent($sessionkey, $appcode, $Person_talentdata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Person_talent = new Person_talent(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "TBLID": $obj_Person_talent->TblId = $child; break; case "PERSONID": $obj_Person_talent->PersonId = $child; break; case "TALENTID": $obj_Person_talent->TalentId = $child; break; } } $obj_retResult_Person_talent = DAL_managePerson_talent::addPerson_talent($obj_Person_talent); if ($obj_retResult_Person_talent->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getPerson_talentXml($obj_retResult_Person_talent->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function addPerson_talent2($TblId, $PersonId, $TalentId) { $obj_retResult = new returnResult(); $obj_newPerson_talent = new Person_talent(); $obj_newuser->setPerson_talent($TblId, $PersonId, $TalentId); // $isExist = BL_managePerson_talent::isExist($obj_newPerson_talent->id); if (!$isExist) { $obj_retResult_Person_talent = DAL_managePerson_talent::addPerson_talent($obj_newPerson_talent); if ($obj_retResult_Person_talent->type == 1) { $obj_retResult->type = 1; $obj_retResult->msg = "Success"; $obj_retResult->data = $obj_retResult_Person_talent->data; } else { $obj_retResult->type = 0; $obj_retResult->msg = "Failed"; } } else { $obj_retResult->type = 0; $obj_retResult->msg = "Sorry! Person_talent already exist"; } return $obj_retResult; }