function addVillage_geologicalvariation($sessionkey, $appcode, $Village_geologicalvariationdata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Village_geologicalvariation = new Village_geologicalvariation();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "TBLID":
                    $obj_Village_geologicalvariation->TblId = $child;
                    break;
                case "VILLAGEID":
                    $obj_Village_geologicalvariation->VillageId = $child;
                    break;
                case "VARIATION":
                    $obj_Village_geologicalvariation->Variation = $child;
                    break;
                case "DESCRIPTION":
                    $obj_Village_geologicalvariation->Description = $child;
                    break;
                case "PRIMARYGEOLAYERTYPEID":
                    $obj_Village_geologicalvariation->PrimaryGeoLayerTypeId = $child;
                    break;
                case "SOILTYPEID":
                    $obj_Village_geologicalvariation->SoilTypeId = $child;
                    break;
            }
        }
        $obj_retResult_Village_geologicalvariation = DAL_manageVillage_geologicalvariation::addVillage_geologicalvariation($obj_Village_geologicalvariation);
        if ($obj_retResult_Village_geologicalvariation->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getVillage_geologicalvariationXml($obj_retResult_Village_geologicalvariation->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
 public static function addVillage_geologicalvariation2($TblId, $VillageId, $Variation, $Description, $PrimaryGeoLayerTypeId, $SoilTypeId)
 {
     $obj_retResult = new returnResult();
     $obj_newVillage_geologicalvariation = new Village_geologicalvariation();
     $obj_newuser->setVillage_geologicalvariation($TblId, $VillageId, $Variation, $Description, $PrimaryGeoLayerTypeId, $SoilTypeId);
     // $isExist = BL_manageVillage_geologicalvariation::isExist($obj_newVillage_geologicalvariation->id);
     if (!$isExist) {
         $obj_retResult_Village_geologicalvariation = DAL_manageVillage_geologicalvariation::addVillage_geologicalvariation($obj_newVillage_geologicalvariation);
         if ($obj_retResult_Village_geologicalvariation->type == 1) {
             $obj_retResult->type = 1;
             $obj_retResult->msg = "Success";
             $obj_retResult->data = $obj_retResult_Village_geologicalvariation->data;
         } else {
             $obj_retResult->type = 0;
             $obj_retResult->msg = "Failed";
         }
     } else {
         $obj_retResult->type = 0;
         $obj_retResult->msg = "Sorry! Village_geologicalvariation already exist";
     }
     return $obj_retResult;
 }