function addVillage_othernames($sessionkey, $appcode, $Village_othernamesdata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Village_othernames = new Village_othernames();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "VILLAGEID":
                    $obj_Village_othernames->VillageId = $child;
                    break;
                case "VILLAGENAMES":
                    $obj_Village_othernames->VillageNames = $child;
                    break;
            }
        }
        $obj_retResult_Village_othernames = DAL_manageVillage_othernames::addVillage_othernames($obj_Village_othernames);
        if ($obj_retResult_Village_othernames->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getVillage_othernamesXml($obj_retResult_Village_othernames->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
 public static function addVillage_othernames2($VillageId, $VillageNames)
 {
     $obj_retResult = new returnResult();
     $obj_newVillage_othernames = new Village_othernames();
     $obj_newuser->setVillage_othernames($VillageId, $VillageNames);
     // $isExist = BL_manageVillage_othernames::isExist($obj_newVillage_othernames->id);
     if (!$isExist) {
         $obj_retResult_Village_othernames = DAL_manageVillage_othernames::addVillage_othernames($obj_newVillage_othernames);
         if ($obj_retResult_Village_othernames->type == 1) {
             $obj_retResult->type = 1;
             $obj_retResult->msg = "Success";
             $obj_retResult->data = $obj_retResult_Village_othernames->data;
         } else {
             $obj_retResult->type = 0;
             $obj_retResult->msg = "Failed";
         }
     } else {
         $obj_retResult->type = 0;
         $obj_retResult->msg = "Sorry! Village_othernames already exist";
     }
     return $obj_retResult;
 }