public static function addGroup2($GroupId, $GroupName, $GroupPrimaryType, $GroupMissionTypeId, $GroupAddress) { $obj_retResult = new returnResult(); $obj_newGroup = new Group(); $obj_newuser->setGroup($GroupId, $GroupName, $GroupPrimaryType, $GroupMissionTypeId, $GroupAddress); // $isExist = BL_manageGroup::isExist($obj_newGroup->id); if (!$isExist) { $obj_retResult_Group = DAL_manageGroup::addGroup($obj_newGroup); if ($obj_retResult_Group->type == 1) { $obj_retResult->type = 1; $obj_retResult->msg = "Success"; $obj_retResult->data = $obj_retResult_Group->data; } else { $obj_retResult->type = 0; $obj_retResult->msg = "Failed"; } } else { $obj_retResult->type = 0; $obj_retResult->msg = "Sorry! Group already exist"; } return $obj_retResult; }
function addGroup($sessionkey, $appcode, $Groupdata) { $main_result = "<VPROFILERESULT>"; $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>"; $userId = ValidateSession($sessionkey, $appcode); if ($userId > -1) { $main_result = "<AUTHSTATUS>1</AUTHSTATUS>"; $obj_Group = new Group(); foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) { switch ($key) { case "GROUPID": $obj_Group->GroupId = $child; break; case "GROUPNAME": $obj_Group->GroupName = $child; break; case "GROUPPRIMARYTYPE": $obj_Group->GroupPrimaryType = $child; break; case "GROUPMISSIONTYPEID": $obj_Group->GroupMissionTypeId = $child; break; case "GROUPADDRESS": $obj_Group->GroupAddress = $child; break; } } $obj_retResult_Group = DAL_manageGroup::addGroup($obj_Group); if ($obj_retResult_Group->type == 1) { $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>"; $main_result .= getGroupXml($obj_retResult_Group->data); } else { $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>"; } } $main_result .= "</VPROFILERESULT>"; return $main_result; }