function addVillage_traditionalknowledge($sessionkey, $appcode, $Village_traditionalknowledgedata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Village_traditionalknowledge = new Village_traditionalknowledge();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "TBLID":
                    $obj_Village_traditionalknowledge->TblId = $child;
                    break;
                case "VILLAGEID":
                    $obj_Village_traditionalknowledge->VillageId = $child;
                    break;
                case "TRADITIONALKNOWLEDGECATEGORYID":
                    $obj_Village_traditionalknowledge->TraditionalKnowledgeCategoryID = $child;
                    break;
                case "DISCRIPTION":
                    $obj_Village_traditionalknowledge->Discription = $child;
                    break;
            }
        }
        $obj_retResult_Village_traditionalknowledge = DAL_manageVillage_traditionalknowledge::addVillage_traditionalknowledge($obj_Village_traditionalknowledge);
        if ($obj_retResult_Village_traditionalknowledge->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getVillage_traditionalknowledgeXml($obj_retResult_Village_traditionalknowledge->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
 public static function addVillage_traditionalknowledge2($TblId, $VillageId, $TraditionalKnowledgeCategoryID, $Discription)
 {
     $obj_retResult = new returnResult();
     $obj_newVillage_traditionalknowledge = new Village_traditionalknowledge();
     $obj_newuser->setVillage_traditionalknowledge($TblId, $VillageId, $TraditionalKnowledgeCategoryID, $Discription);
     // $isExist = BL_manageVillage_traditionalknowledge::isExist($obj_newVillage_traditionalknowledge->id);
     if (!$isExist) {
         $obj_retResult_Village_traditionalknowledge = DAL_manageVillage_traditionalknowledge::addVillage_traditionalknowledge($obj_newVillage_traditionalknowledge);
         if ($obj_retResult_Village_traditionalknowledge->type == 1) {
             $obj_retResult->type = 1;
             $obj_retResult->msg = "Success";
             $obj_retResult->data = $obj_retResult_Village_traditionalknowledge->data;
         } else {
             $obj_retResult->type = 0;
             $obj_retResult->msg = "Failed";
         }
     } else {
         $obj_retResult->type = 0;
         $obj_retResult->msg = "Sorry! Village_traditionalknowledge already exist";
     }
     return $obj_retResult;
 }