function addOrganizationtype($sessionkey, $appcode, $Organizationtypedata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Organizationtype = new Organizationtype(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "ORGANIZATIONTYPEID": $obj_Organizationtype->OrganizationTypeId = $child; break; case "ORGANIZATIONTYPENAME": $obj_Organizationtype->OrganizationTypeName = $child; break; case "DESCRIPTION": $obj_Organizationtype->Description = $child; break; } } $obj_retResult_Organizationtype = DAL_manageOrganizationtype::addOrganizationtype($obj_Organizationtype); if ($obj_retResult_Organizationtype->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getOrganizationtypeXml($obj_retResult_Organizationtype->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function addOrganizationtype2($OrganizationTypeId, $OrganizationTypeName, $Description) { $obj_retResult = new returnResult(); $obj_newOrganizationtype = new Organizationtype(); $obj_newuser->setOrganizationtype($OrganizationTypeId, $OrganizationTypeName, $Description); // $isExist = BL_manageOrganizationtype::isExist($obj_newOrganizationtype->id); if (!$isExist) { $obj_retResult_Organizationtype = DAL_manageOrganizationtype::addOrganizationtype($obj_newOrganizationtype); if ($obj_retResult_Organizationtype->type == 1) { $obj_retResult->type = 1; $obj_retResult->msg = "Success"; $obj_retResult->data = $obj_retResult_Organizationtype->data; } else { $obj_retResult->type = 0; $obj_retResult->msg = "Failed"; } } else { $obj_retResult->type = 0; $obj_retResult->msg = "Sorry! Organizationtype already exist"; } return $obj_retResult; }