function addService($sessionkey, $appcode, $Servicedata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Service = new Service(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "SERVICEID": $obj_Service->ServiceId = $child; break; case "SERVICENAME": $obj_Service->ServiceName = $child; break; case "DESCRIPTION": $obj_Service->Description = $child; break; } } $obj_retResult_Service = DAL_manageService::addService($obj_Service); if ($obj_retResult_Service->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getServiceXml($obj_retResult_Service->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function addService2($ServiceId, $ServiceName, $Description) { $obj_retResult = new returnResult(); $obj_newService = new Service(); $obj_newuser->setService($ServiceId, $ServiceName, $Description); // $isExist = BL_manageService::isExist($obj_newService->id); if (!$isExist) { $obj_retResult_Service = DAL_manageService::addService($obj_newService); if ($obj_retResult_Service->type == 1) { $obj_retResult->type = 1; $obj_retResult->msg = "Success"; $obj_retResult->data = $obj_retResult_Service->data; } else { $obj_retResult->type = 0; $obj_retResult->msg = "Failed"; } } else { $obj_retResult->type = 0; $obj_retResult->msg = "Sorry! Service already exist"; } return $obj_retResult; }