function addVillage_society($sessionkey, $appcode, $Village_societydata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Village_society = new Village_society();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "SOCIETYID":
                    $obj_Village_society->SocietyId = $child;
                    break;
                case "VILLAGEID":
                    $obj_Village_society->VillageId = $child;
                    break;
                case "VILLAGESOCIETYID":
                    $obj_Village_society->VillageSocietyId = $child;
                    break;
            }
        }
        $obj_retResult_Village_society = DAL_manageVillage_society::addVillage_society($obj_Village_society);
        if ($obj_retResult_Village_society->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getVillage_societyXml($obj_retResult_Village_society->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
 public static function addVillage_society2($SocietyId, $VillageId, $VillageSocietyId)
 {
     $obj_retResult = new returnResult();
     $obj_newVillage_society = new Village_society();
     $obj_newuser->setVillage_society($SocietyId, $VillageId, $VillageSocietyId);
     // $isExist = BL_manageVillage_society::isExist($obj_newVillage_society->id);
     if (!$isExist) {
         $obj_retResult_Village_society = DAL_manageVillage_society::addVillage_society($obj_newVillage_society);
         if ($obj_retResult_Village_society->type == 1) {
             $obj_retResult->type = 1;
             $obj_retResult->msg = "Success";
             $obj_retResult->data = $obj_retResult_Village_society->data;
         } else {
             $obj_retResult->type = 0;
             $obj_retResult->msg = "Failed";
         }
     } else {
         $obj_retResult->type = 0;
         $obj_retResult->msg = "Sorry! Village_society already exist";
     }
     return $obj_retResult;
 }