function updateTransport($sessionkey, $appcode, $Transportdata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Transport = new Transport(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "TRANSPORTID": $obj_Transport->TransportId = $child; break; case "TRANSPORTNAME": $obj_Transport->TransportName = $child; break; case "TRANSPORTTYPE": $obj_Transport->TransportType = $child; break; case "DESCRIPTION": $obj_Transport->Description = $child; break; } } $obj_retResult_Transport = DAL_manageTransport::updateTransport($obj_Transport); if ($obj_retResult_Transport->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getTransportXml($obj_retResult_Transport->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function updateTransport2($TransportId, $TransportName, $TransportType, $Description) { $obj_retResult = new returnResult(); $obj_newTransport = new Transport(); $obj_newTransport->TransportId = $TransportId; $obj_newTransport->TransportName = $TransportName; $obj_newTransport->TransportType = $TransportType; $obj_newTransport->Description = $Description; $issuccess = DAL_manageTransport::updateTransport($obj_newTransport); if ($issuccess) { $obj_retResult->type = 1; // $obj_retResult->data = BL_manageTransport::getTransportByTransportId($obj_newTransport->TransportId); $obj_retResult->msg = "Transport updation is Success"; } else { $obj_retResult->type = 0; $obj_retResult->msg = "Transport updation is Failed"; } return $obj_retResult; }