function addTraditionalknowledgecategory($sessionkey, $appcode, $Traditionalknowledgecategorydata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Traditionalknowledgecategory = new Traditionalknowledgecategory();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "CATEGORYID":
                    $obj_Traditionalknowledgecategory->CategoryId = $child;
                    break;
                case "CATEGORYNAME":
                    $obj_Traditionalknowledgecategory->CategoryName = $child;
                    break;
                case "DESCRIPTION":
                    $obj_Traditionalknowledgecategory->Description = $child;
                    break;
            }
        }
        $obj_retResult_Traditionalknowledgecategory = DAL_manageTraditionalknowledgecategory::addTraditionalknowledgecategory($obj_Traditionalknowledgecategory);
        if ($obj_retResult_Traditionalknowledgecategory->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getTraditionalknowledgecategoryXml($obj_retResult_Traditionalknowledgecategory->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
 public static function addTraditionalknowledgecategory2($CategoryId, $CategoryName, $Description)
 {
     $obj_retResult = new returnResult();
     $obj_newTraditionalknowledgecategory = new Traditionalknowledgecategory();
     $obj_newuser->setTraditionalknowledgecategory($CategoryId, $CategoryName, $Description);
     // $isExist = BL_manageTraditionalknowledgecategory::isExist($obj_newTraditionalknowledgecategory->id);
     if (!$isExist) {
         $obj_retResult_Traditionalknowledgecategory = DAL_manageTraditionalknowledgecategory::addTraditionalknowledgecategory($obj_newTraditionalknowledgecategory);
         if ($obj_retResult_Traditionalknowledgecategory->type == 1) {
             $obj_retResult->type = 1;
             $obj_retResult->msg = "Success";
             $obj_retResult->data = $obj_retResult_Traditionalknowledgecategory->data;
         } else {
             $obj_retResult->type = 0;
             $obj_retResult->msg = "Failed";
         }
     } else {
         $obj_retResult->type = 0;
         $obj_retResult->msg = "Sorry! Traditionalknowledgecategory already exist";
     }
     return $obj_retResult;
 }