示例#1
0
function addBusiness($sessionkey, $appcode, $Businessdata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Business = new Business();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "BUSINESSID":
                    $obj_Business->BusinessId = $child;
                    break;
                case "NAME":
                    $obj_Business->Name = $child;
                    break;
                case "DESCRIPTION":
                    $obj_Business->Description = $child;
                    break;
                case "ADDRESS":
                    $obj_Business->Address = $child;
                    break;
                case "TELEPHONE":
                    $obj_Business->telephone = $child;
                    break;
                case "FAX":
                    $obj_Business->fax = $child;
                    break;
                case "WEBSITE":
                    $obj_Business->website = $child;
                    break;
                case "EMAIL":
                    $obj_Business->email = $child;
                    break;
                case "BUSINESSTYPEID":
                    $obj_Business->BusinessTypeId = $child;
                    break;
                case "BUSINESSSUBTYPEID":
                    $obj_Business->BusinessSubTypeId = $child;
                    break;
            }
        }
        $obj_retResult_Business = DAL_manageBusiness::addBusiness($obj_Business);
        if ($obj_retResult_Business->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getBusinessXml($obj_retResult_Business->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
示例#2
0
 public static function addBusiness2($BusinessId, $Name, $Description, $Address, $telephone, $fax, $website, $email, $BusinessTypeId, $BusinessSubTypeId)
 {
     $obj_retResult = new returnResult();
     $obj_newBusiness = new Business();
     $obj_newuser->setBusiness($BusinessId, $Name, $Description, $Address, $telephone, $fax, $website, $email, $BusinessTypeId, $BusinessSubTypeId);
     // $isExist = BL_manageBusiness::isExist($obj_newBusiness->id);
     if (!$isExist) {
         $obj_retResult_Business = DAL_manageBusiness::addBusiness($obj_newBusiness);
         if ($obj_retResult_Business->type == 1) {
             $obj_retResult->type = 1;
             $obj_retResult->msg = "Success";
             $obj_retResult->data = $obj_retResult_Business->data;
         } else {
             $obj_retResult->type = 0;
             $obj_retResult->msg = "Failed";
         }
     } else {
         $obj_retResult->type = 0;
         $obj_retResult->msg = "Sorry! Business already exist";
     }
     return $obj_retResult;
 }