function addSocierytype($sessionkey, $appcode, $Socierytypedata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Socierytype = new Socierytype();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "SOCIERYTYPEID":
                    $obj_Socierytype->SocieryTypeId = $child;
                    break;
                case "SOCIERYTYPENAME":
                    $obj_Socierytype->SocieryTypeName = $child;
                    break;
                case "DESCRIPTION":
                    $obj_Socierytype->Description = $child;
                    break;
            }
        }
        $obj_retResult_Socierytype = DAL_manageSocierytype::addSocierytype($obj_Socierytype);
        if ($obj_retResult_Socierytype->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getSocierytypeXml($obj_retResult_Socierytype->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
 public static function addSocierytype2($SocieryTypeId, $SocieryTypeName, $Description)
 {
     $obj_retResult = new returnResult();
     $obj_newSocierytype = new Socierytype();
     $obj_newuser->setSocierytype($SocieryTypeId, $SocieryTypeName, $Description);
     // $isExist = BL_manageSocierytype::isExist($obj_newSocierytype->id);
     if (!$isExist) {
         $obj_retResult_Socierytype = DAL_manageSocierytype::addSocierytype($obj_newSocierytype);
         if ($obj_retResult_Socierytype->type == 1) {
             $obj_retResult->type = 1;
             $obj_retResult->msg = "Success";
             $obj_retResult->data = $obj_retResult_Socierytype->data;
         } else {
             $obj_retResult->type = 0;
             $obj_retResult->msg = "Failed";
         }
     } else {
         $obj_retResult->type = 0;
         $obj_retResult->msg = "Sorry! Socierytype already exist";
     }
     return $obj_retResult;
 }