function addOlsubjects($sessionkey, $appcode, $Olsubjectsdata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Olsubjects = new Olsubjects();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "SUBJECTID":
                    $obj_Olsubjects->SubjectId = $child;
                    break;
                case "SUBJECTNAME":
                    $obj_Olsubjects->SubjectName = $child;
                    break;
                case "SUBJECTNUMBER":
                    $obj_Olsubjects->SubjectNumber = $child;
                    break;
            }
        }
        $obj_retResult_Olsubjects = DAL_manageOlsubjects::addOlsubjects($obj_Olsubjects);
        if ($obj_retResult_Olsubjects->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getOlsubjectsXml($obj_retResult_Olsubjects->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
 public static function addOlsubjects2($SubjectId, $SubjectName, $SubjectNumber)
 {
     $obj_retResult = new returnResult();
     $obj_newOlsubjects = new Olsubjects();
     $obj_newuser->setOlsubjects($SubjectId, $SubjectName, $SubjectNumber);
     // $isExist = BL_manageOlsubjects::isExist($obj_newOlsubjects->id);
     if (!$isExist) {
         $obj_retResult_Olsubjects = DAL_manageOlsubjects::addOlsubjects($obj_newOlsubjects);
         if ($obj_retResult_Olsubjects->type == 1) {
             $obj_retResult->type = 1;
             $obj_retResult->msg = "Success";
             $obj_retResult->data = $obj_retResult_Olsubjects->data;
         } else {
             $obj_retResult->type = 0;
             $obj_retResult->msg = "Failed";
         }
     } else {
         $obj_retResult->type = 0;
         $obj_retResult->msg = "Sorry! Olsubjects already exist";
     }
     return $obj_retResult;
 }