﻿
// Functions for handling reports in the My Reports basket via AJAX in the report list.

function AddReportToMyReports(id) {
    PageMethods.AddReportToMyReports(id, OnAddReportSucceeded, null);
    //        window.event.returnValue = false; 
    //        return false; 
}

function RemoveReportFromMyReports(id) {
    PageMethods.RemoveReportFromMyReports(id, OnRemoveReportSucceeded, null);
}


// Callback functions invoked on successful 
// completion of the page method.
function OnAddReportSucceeded(result, userContext, methodName) {
    // Repost to give the user some notion of that something happened.
    //document.forms[0].submit();
    alert("Report was added to my reports.");
}

function OnRemoveReportSucceeded(result, userContext, methodName) {
    // Repost to update the report list in My Reports
    //document.forms[0].submit();
}

// Callback function invoked on failure 
// of the page method.
// function OnFailed(error, userContext, methodName) 
// {
//    if(error !== null) 
//    {
//        alert("An error occurred: " + error.get_message();
//    }
// }


if (typeof (Sys) !== "undefined") Sys.Application.notifyScriptLoaded();