function updateVillage_industrial($sessionkey, $appcode, $Village_industrialdata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Village_industrial = new Village_industrial();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "INDUSTRIALID":
                    $obj_Village_industrial->IndustrialId = $child;
                    break;
                case "VILLAGEID":
                    $obj_Village_industrial->VillageId = $child;
                    break;
                case "BUSINESSID":
                    $obj_Village_industrial->BusinessId = $child;
                    break;
                case "DESCRIPTION":
                    $obj_Village_industrial->Description = $child;
                    break;
            }
        }
        $obj_retResult_Village_industrial = DAL_manageVillage_industrial::updateVillage_industrial($obj_Village_industrial);
        if ($obj_retResult_Village_industrial->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getVillage_industrialXml($obj_retResult_Village_industrial->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
 public static function addVillage_industrial($obj_Village_industrial)
 {
     $db = config::dbconfig();
     $obj_retresult = new returnResult();
     $obj_Village_industrial->BusinessId = DAL_manageVillage_industrial::getLastVillage_industrialId() + 1;
     $sql = "INSERT INTO tbl_village_industrial (IndustrialId,VillageId,BusinessId,Description) \n\t\tVALUES (" . common::noSqlInject($obj_Village_industrial->IndustrialId) . "," . common::noSqlInject($obj_Village_industrial->VillageId) . "," . common::noSqlInject($obj_Village_industrial->BusinessId) . "," . "'" . common::noSqlInject($obj_Village_industrial->Description) . "'" . ");";
     $rs = mysql_query($sql);
     if (mysql_affected_rows() > 0) {
         $obj_retresult->type = 1;
         $obj_retresult->msg = "success";
         $obj_retresult->data = $obj_Village_industrial;
     } else {
         $obj_retresult->type = 0;
         $obj_retresult->msg = "failed";
     }
     return $obj_retresult;
 }
 public static function isChildVillage_industrial($BusinessId, $ChildBusinessId)
 {
     $ischild = false;
     $obj_retResult = DAL_manageVillage_industrial::getVillage_industrialListByBusinessId($ChildBusinessId);
     //get child node
     if ($obj_retResult->type == 1) {
         $arr_Village_industrialList = $obj_retResult->data;
         $obj_Village_industrial = $arr_Village_industrialList[0];
         $arrParentIds = explode(",", $obj_Village_industrial->Url);
         foreach ($arrParentIds as $Village_industrialParentId) {
             if ($Village_industrialParentId == $BusinessId) {
                 $ischild = true;
             }
         }
     }
     return $ischild;
 }