Example #1
0
 */
/**
 * This file is used to save the Game/Product data
 */
require_once 'VideoGameStoreEntities.php';
// Include service url definiation
require_once 'urldef.php';
$proxy = new VideoGameStoreEntities(VIDEO_GAME_STORE_SERVICE_URL);
$success = false;
$product = new Product();
$product->ProductID = $_POST['ProductID'];
$product->ProductDescription = $_POST['Description'];
$product->ListPrice = str_replace('$', '', $_POST['ListPrice']);
$product->ReleaseDate = $_POST['ReleaseDate'];
try {
    if ($proxy->UpdateObject($product)) {
        $success = true;
    }
} catch (ADODotNETDataServicesException $e) {
    $error1 = $e->getError();
    $derror1 = $e->getDetailedError();
}
$game = new Game();
$game->ProductID = $_POST['ProductID'];
$game->Rating = $_POST['Rating'];
$game->Genre = $_POST['Genre'];
$game->Developer = $_POST['Developer'];
try {
    if ($proxy->UpdateObject($game)) {
        $success = true;
    }