function addPerson_educationlevel($sessionkey, $appcode, $Person_educationleveldata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Person_educationlevel = new Person_educationlevel(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "EDUCATIONLEVELID": $obj_Person_educationlevel->EducationLevelId = $child; break; case "SCHOOLID": $obj_Person_educationlevel->SchoolId = $child; break; case "STARTYEAR": $obj_Person_educationlevel->StartYear = $child; break; case "STARTCLASS": $obj_Person_educationlevel->StartClass = $child; break; case "ENDYEAR": $obj_Person_educationlevel->EndYear = $child; break; case "ENDCLASS": $obj_Person_educationlevel->EndClass = $child; break; case "PERSONID": $obj_Person_educationlevel->PersonId = $child; break; } } $obj_retResult_Person_educationlevel = DAL_managePerson_educationlevel::addPerson_educationlevel($obj_Person_educationlevel); if ($obj_retResult_Person_educationlevel->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getPerson_educationlevelXml($obj_retResult_Person_educationlevel->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function addPerson_educationlevel2($EducationLevelId, $SchoolId, $StartYear, $StartClass, $EndYear, $EndClass, $PersonId) { $obj_retResult = new returnResult(); $obj_newPerson_educationlevel = new Person_educationlevel(); $obj_newuser->setPerson_educationlevel($EducationLevelId, $SchoolId, $StartYear, $StartClass, $EndYear, $EndClass, $PersonId); // $isExist = BL_managePerson_educationlevel::isExist($obj_newPerson_educationlevel->id); if (!$isExist) { $obj_retResult_Person_educationlevel = DAL_managePerson_educationlevel::addPerson_educationlevel($obj_newPerson_educationlevel); if ($obj_retResult_Person_educationlevel->type == 1) { $obj_retResult->type = 1; $obj_retResult->msg = "Success"; $obj_retResult->data = $obj_retResult_Person_educationlevel->data; } else { $obj_retResult->type = 0; $obj_retResult->msg = "Failed"; } } else { $obj_retResult->type = 0; $obj_retResult->msg = "Sorry! Person_educationlevel already exist"; } return $obj_retResult; }