function addPerson_olresult($sessionkey, $appcode, $Person_olresultdata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Person_olresult = new Person_olresult();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "OLRESULTID":
                    $obj_Person_olresult->OLResultId = $child;
                    break;
                case "SUBJECTID":
                    $obj_Person_olresult->SubjectId = $child;
                    break;
                case "SCHOOLID":
                    $obj_Person_olresult->SchoolId = $child;
                    break;
                case "GRADE":
                    $obj_Person_olresult->Grade = $child;
                    break;
                case "LANGUAGE":
                    $obj_Person_olresult->Language = $child;
                    break;
                case "DATETIME":
                    $obj_Person_olresult->DateTime = $child;
                    break;
                case "PERSONID":
                    $obj_Person_olresult->PersonId = $child;
                    break;
            }
        }
        $obj_retResult_Person_olresult = DAL_managePerson_olresult::addPerson_olresult($obj_Person_olresult);
        if ($obj_retResult_Person_olresult->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getPerson_olresultXml($obj_retResult_Person_olresult->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
 public static function addPerson_olresult2($OLResultId, $SubjectId, $SchoolId, $Grade, $Language, $DateTime, $PersonId)
 {
     $obj_retResult = new returnResult();
     $obj_newPerson_olresult = new Person_olresult();
     $obj_newuser->setPerson_olresult($OLResultId, $SubjectId, $SchoolId, $Grade, $Language, $DateTime, $PersonId);
     // $isExist = BL_managePerson_olresult::isExist($obj_newPerson_olresult->id);
     if (!$isExist) {
         $obj_retResult_Person_olresult = DAL_managePerson_olresult::addPerson_olresult($obj_newPerson_olresult);
         if ($obj_retResult_Person_olresult->type == 1) {
             $obj_retResult->type = 1;
             $obj_retResult->msg = "Success";
             $obj_retResult->data = $obj_retResult_Person_olresult->data;
         } else {
             $obj_retResult->type = 0;
             $obj_retResult->msg = "Failed";
         }
     } else {
         $obj_retResult->type = 0;
         $obj_retResult->msg = "Sorry! Person_olresult already exist";
     }
     return $obj_retResult;
 }