﻿System_Class = function() { };
////////////////////////////////////
System_Class.prototype = {

    Select: function(element) {
        var classPath = "Main.BL.SystemBL";
        var methodName = "SystemSelect";
        $.ajax({
            url: "Handler.ashx",
            dataType: "json",
            data: "ClassPath=" + classPath + "&MethodName=" + methodName,
            type: "POST",
            timeout: GlobalVariable.AjaxTimeOut,
            beforeSend: function() {
            },
            success: function(result) {
                if (result.Success == "True") {
                    element.html(result.Visitor);
                }
            },
            error: function(xhr, message, ex) {
                alert(GlobalVariable.MsgErrorLoadData);
            },
            complete: function() {
            }
        });
    },

    //////////////////////////////////////////////////////////////////////////

    UpdateVisitor: function() {
        var classPath = "Main.BL.SystemBL";
        var methodName = "SystemUpdateVisitor";
        $.ajax({
            url: "Handler.ashx",
            dataType: "json",
            data: "ClassPath=" + classPath + "&MethodName=" + methodName ,
            type: "POST",
            timeout: GlobalVariable.AjaxTimeOut,
            beforeSend: function() {
            },
            success: function(result) {
            },
            error: function(xhr, message, ex) {
                alert(xhr.responseText);
            },
            complete: function() {
            }
        });
    }

};

var System = new System_Class();

