
//\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\//
// Check For Updates functions
//\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\//


/**
 * Ajax into the server for update information
 * Report the update status to user
 * */
function AjaxCheckForUpdates() {

    var data = {
    };

    $.ajax({
        url: VirtualDirectory + "/Home/AjaxCheckForUpdates",
        type: "POST",
        data: JSON.stringify(data),
        dataType: "json",
        contentType: "application/json",
        success: function (response) {

            if (response.Success) {

                // Pop up a message box with the results
                var sMsg = "";
                sMsg += response.Results + "\r\n\r\n";
                sMsg += response.AdditionalMessage + "\r\n";
                PopupInfoMessage("Check For Updates", sMsg);
            }
            else {
                // Not successful
                ToastError("GetDatabaseConnectionStatus", response.ErrorResults);
            }
        },
        error: function (xhr, status, error) {
            var errormsg = "Error " + xhr.status + ", " + xhr.statusText;
            ToastError("AjaxPopupDatabaseConnectionStatus", errormsg);
            console.log('AJAX: ' + errormsg);
        }
    });
}



