function addPrimarygeolayertype($sessionkey, $appcode, $Primarygeolayertypedata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Primarygeolayertype = new Primarygeolayertype(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "PRIMARYGEOLAYERTYPEID": $obj_Primarygeolayertype->PrimaryGeoLayerTypeId = $child; break; case "PRIMARYGEOLAYERNAME": $obj_Primarygeolayertype->PrimaryGeoLayerName = $child; break; case "DESCRIPTION": $obj_Primarygeolayertype->Description = $child; break; } } $obj_retResult_Primarygeolayertype = DAL_managePrimarygeolayertype::addPrimarygeolayertype($obj_Primarygeolayertype); if ($obj_retResult_Primarygeolayertype->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getPrimarygeolayertypeXml($obj_retResult_Primarygeolayertype->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function addPrimarygeolayertype2($PrimaryGeoLayerTypeId, $PrimaryGeoLayerName, $Description) { $obj_retResult = new returnResult(); $obj_newPrimarygeolayertype = new Primarygeolayertype(); $obj_newuser->setPrimarygeolayertype($PrimaryGeoLayerTypeId, $PrimaryGeoLayerName, $Description); // $isExist = BL_managePrimarygeolayertype::isExist($obj_newPrimarygeolayertype->id); if (!$isExist) { $obj_retResult_Primarygeolayertype = DAL_managePrimarygeolayertype::addPrimarygeolayertype($obj_newPrimarygeolayertype); if ($obj_retResult_Primarygeolayertype->type == 1) { $obj_retResult->type = 1; $obj_retResult->msg = "Success"; $obj_retResult->data = $obj_retResult_Primarygeolayertype->data; } else { $obj_retResult->type = 0; $obj_retResult->msg = "Failed"; } } else { $obj_retResult->type = 0; $obj_retResult->msg = "Sorry! Primarygeolayertype already exist"; } return $obj_retResult; }