function addForesttype($sessionkey, $appcode, $Foresttypedata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Foresttype = new Foresttype(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "FORESTTYPEID": $obj_Foresttype->ForestTypeId = $child; break; case "NAME": $obj_Foresttype->Name = $child; break; case "DESCRIPTION": $obj_Foresttype->Description = $child; break; } } $obj_retResult_Foresttype = DAL_manageForesttype::addForesttype($obj_Foresttype); if ($obj_retResult_Foresttype->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getForesttypeXml($obj_retResult_Foresttype->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }
public static function addForesttype2($ForestTypeId, $Name, $Description) { $obj_retResult = new returnResult(); $obj_newForesttype = new Foresttype(); $obj_newuser->setForesttype($ForestTypeId, $Name, $Description); // $isExist = BL_manageForesttype::isExist($obj_newForesttype->id); if (!$isExist) { $obj_retResult_Foresttype = DAL_manageForesttype::addForesttype($obj_newForesttype); if ($obj_retResult_Foresttype->type == 1) { $obj_retResult->type = 1; $obj_retResult->msg = "Success"; $obj_retResult->data = $obj_retResult_Foresttype->data; } else { $obj_retResult->type = 0; $obj_retResult->msg = "Failed"; } } else { $obj_retResult->type = 0; $obj_retResult->msg = "Sorry! Foresttype already exist"; } return $obj_retResult; }