function addGeographytype($sessionkey, $appcode, $Geographytypedata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Geographytype = new Geographytype(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "GEOGROPHYTYPEID": $obj_Geographytype->GeogrophyTypeId = $child; break; case "NAME": $obj_Geographytype->Name = $child; break; case "DESCRIPTION": $obj_Geographytype->Description = $child; break; } } $obj_retResult_Geographytype = DAL_manageGeographytype::addGeographytype($obj_Geographytype); if ($obj_retResult_Geographytype->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getGeographytypeXml($obj_retResult_Geographytype->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function addGeographytype2($GeogrophyTypeId, $Name, $Description) { $obj_retResult = new returnResult(); $obj_newGeographytype = new Geographytype(); $obj_newuser->setGeographytype($GeogrophyTypeId, $Name, $Description); // $isExist = BL_manageGeographytype::isExist($obj_newGeographytype->id); if (!$isExist) { $obj_retResult_Geographytype = DAL_manageGeographytype::addGeographytype($obj_newGeographytype); if ($obj_retResult_Geographytype->type == 1) { $obj_retResult->type = 1; $obj_retResult->msg = "Success"; $obj_retResult->data = $obj_retResult_Geographytype->data; } else { $obj_retResult->type = 0; $obj_retResult->msg = "Failed"; } } else { $obj_retResult->type = 0; $obj_retResult->msg = "Sorry! Geographytype already exist"; } return $obj_retResult; }