function addBusinesstype($sessionkey, $appcode, $Businesstypedata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Businesstype = new Businesstype(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "BUSINESSTYPEID": $obj_Businesstype->BusinessTypeId = $child; break; case "BUSINESSTYPENAME": $obj_Businesstype->BusinessTypeName = $child; break; case "DESCRIPTION": $obj_Businesstype->Description = $child; break; } } $obj_retResult_Businesstype = DAL_manageBusinesstype::addBusinesstype($obj_Businesstype); if ($obj_retResult_Businesstype->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getBusinesstypeXml($obj_retResult_Businesstype->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function addBusinesstype2($BusinessTypeId, $BusinessTypeName, $Description) { $obj_retResult = new returnResult(); $obj_newBusinesstype = new Businesstype(); $obj_newuser->setBusinesstype($BusinessTypeId, $BusinessTypeName, $Description); // $isExist = BL_manageBusinesstype::isExist($obj_newBusinesstype->id); if (!$isExist) { $obj_retResult_Businesstype = DAL_manageBusinesstype::addBusinesstype($obj_newBusinesstype); if ($obj_retResult_Businesstype->type == 1) { $obj_retResult->type = 1; $obj_retResult->msg = "Success"; $obj_retResult->data = $obj_retResult_Businesstype->data; } else { $obj_retResult->type = 0; $obj_retResult->msg = "Failed"; } } else { $obj_retResult->type = 0; $obj_retResult->msg = "Sorry! Businesstype already exist"; } return $obj_retResult; }