function addOrganization_subtype($sessionkey, $appcode, $Organization_subtypedata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Organization_subtype = new Organization_subtype(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "ORGANIZATIONSUBTYPEID": $obj_Organization_subtype->OrganizationSubTypeId = $child; break; case "ORGANIZATIONSUBTYPENAME": $obj_Organization_subtype->OrganizationSubTypeName = $child; break; case "DESCRIPTION": $obj_Organization_subtype->Description = $child; break; } } $obj_retResult_Organization_subtype = DAL_manageOrganization_subtype::addOrganization_subtype($obj_Organization_subtype); if ($obj_retResult_Organization_subtype->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getOrganization_subtypeXml($obj_retResult_Organization_subtype->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function addOrganization_subtype2($OrganizationSubTypeId, $OrganizationSubTypeName, $Description) { $obj_retResult = new returnResult(); $obj_newOrganization_subtype = new Organization_subtype(); $obj_newuser->setOrganization_subtype($OrganizationSubTypeId, $OrganizationSubTypeName, $Description); // $isExist = BL_manageOrganization_subtype::isExist($obj_newOrganization_subtype->id); if (!$isExist) { $obj_retResult_Organization_subtype = DAL_manageOrganization_subtype::addOrganization_subtype($obj_newOrganization_subtype); if ($obj_retResult_Organization_subtype->type == 1) { $obj_retResult->type = 1; $obj_retResult->msg = "Success"; $obj_retResult->data = $obj_retResult_Organization_subtype->data; } else { $obj_retResult->type = 0; $obj_retResult->msg = "Failed"; } } else { $obj_retResult->type = 0; $obj_retResult->msg = "Sorry! Organization_subtype already exist"; } return $obj_retResult; }