Пример #1
0
 public static function addTalent2($TalentId, $TalentType, $TalentField, $Description, $TalentName)
 {
     $obj_retResult = new returnResult();
     $obj_newTalent = new Talent();
     $obj_newuser->setTalent($TalentId, $TalentType, $TalentField, $Description, $TalentName);
     // $isExist = BL_manageTalent::isExist($obj_newTalent->id);
     if (!$isExist) {
         $obj_retResult_Talent = DAL_manageTalent::addTalent($obj_newTalent);
         if ($obj_retResult_Talent->type == 1) {
             $obj_retResult->type = 1;
             $obj_retResult->msg = "Success";
             $obj_retResult->data = $obj_retResult_Talent->data;
         } else {
             $obj_retResult->type = 0;
             $obj_retResult->msg = "Failed";
         }
     } else {
         $obj_retResult->type = 0;
         $obj_retResult->msg = "Sorry! Talent already exist";
     }
     return $obj_retResult;
 }
Пример #2
0
function addTalent($sessionkey, $appcode, $Talentdata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Talent = new Talent();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "TALENTID":
                    $obj_Talent->TalentId = $child;
                    break;
                case "TALENTTYPE":
                    $obj_Talent->TalentType = $child;
                    break;
                case "TALENTFIELD":
                    $obj_Talent->TalentField = $child;
                    break;
                case "DESCRIPTION":
                    $obj_Talent->Description = $child;
                    break;
                case "TALENTNAME":
                    $obj_Talent->TalentName = $child;
                    break;
            }
        }
        $obj_retResult_Talent = DAL_manageTalent::addTalent($obj_Talent);
        if ($obj_retResult_Talent->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getTalentXml($obj_retResult_Talent->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}