function updateLocation($sessionkey, $appcode, $Locationdata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Location = new Location();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "LOCATIONID":
                    $obj_Location->LocationId = $child;
                    break;
                case "NAME":
                    $obj_Location->Name = $child;
                    break;
                case "LOCATIONTYPE":
                    $obj_Location->LocationType = $child;
                    break;
                case "DESCRIPTION":
                    $obj_Location->Description = $child;
                    break;
            }
        }
        $obj_retResult_Location = DAL_manageLocation::updateLocation($obj_Location);
        if ($obj_retResult_Location->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getLocationXml($obj_retResult_Location->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
 public static function updateLocation2($LocationId, $Name, $LocationType, $Description)
 {
     $obj_retResult = new returnResult();
     $obj_newLocation = new Location();
     $obj_newLocation->LocationId = $LocationId;
     $obj_newLocation->Name = $Name;
     $obj_newLocation->LocationType = $LocationType;
     $obj_newLocation->Description = $Description;
     $issuccess = DAL_manageLocation::updateLocation($obj_newLocation);
     if ($issuccess) {
         $obj_retResult->type = 1;
         //	$obj_retResult->data = BL_manageLocation::getLocationByLocationId($obj_newLocation->LocationId);
         $obj_retResult->msg = "Location updation is Success";
     } else {
         $obj_retResult->type = 0;
         $obj_retResult->msg = "Location updation is Failed";
     }
     return $obj_retResult;
 }