Example #1
0
function updateProduct($sessionkey, $appcode, $Productdata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_Product = new Product();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "PRODUCTID":
                    $obj_Product->ProductId = $child;
                    break;
                case "PRODUCTNAME":
                    $obj_Product->ProductName = $child;
                    break;
                case "EXPIREDURATION":
                    $obj_Product->ExpireDuration = $child;
                    break;
                case "DESCRIPTION":
                    $obj_Product->Description = $child;
                    break;
            }
        }
        $obj_retResult_Product = DAL_manageProduct::updateProduct($obj_Product);
        if ($obj_retResult_Product->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getProductXml($obj_retResult_Product->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
Example #2
0
 public static function updateProduct2($ProductId, $ProductName, $ExpireDuration, $Description)
 {
     $obj_retResult = new returnResult();
     $obj_newProduct = new Product();
     $obj_newProduct->ProductId = $ProductId;
     $obj_newProduct->ProductName = $ProductName;
     $obj_newProduct->ExpireDuration = $ExpireDuration;
     $obj_newProduct->Description = $Description;
     $issuccess = DAL_manageProduct::updateProduct($obj_newProduct);
     if ($issuccess) {
         $obj_retResult->type = 1;
         //	$obj_retResult->data = BL_manageProduct::getProductByProductId($obj_newProduct->ProductId);
         $obj_retResult->msg = "Product updation is Success";
     } else {
         $obj_retResult->type = 0;
         $obj_retResult->msg = "Product updation is Failed";
     }
     return $obj_retResult;
 }