D.BLL.B_User.GetAjaxUserAllInfo(UserInfoBack);

function KeyPress() {
    if (event.keyCode == 13) {
        UserLogin();
    }
}

function UserLogin() {
    var username = document.getElementById("txtUserName").value;
    var password = document.getElementById("txtPassWord").value;
    var code = document.getElementById("txtCode").value;
    D.BLL.B_User.AjaxLogin(username, password, "no", code, UserLogCallBack);
}

function UserLogCallBack(res) {
    if (res.value == "True") {
        document.getElementById("AjaxLogin").style.display = "none";
        document.getElementById("AjaxLogin2").style.display = "";

        D.BLL.B_User.GetAjaxUserAllInfo(UserInfoBack);
    }
    else {
        alert(res.value);
    }
}

function UserInfoBack(res) {
    if (res.value != null) {
        if (document.getElementById("SpanNickName") != null) {
            document.getElementById("SpanNickName").innerHTML = res.value.Rows[0]["NickName"];
            document.getElementById("SpanIntegral").innerHTML = res.value.Rows[0]["Integral"];
        }
    }
}

function ClearCookie() {
    document.getElementById("txtUserName").value="";
    document.getElementById("txtPassWord").value = "";
    document.getElementById("txtCode").value = "";
    D.BLL.B_User.AjaxClearCookie();
    document.getElementById("AjaxLogin").style.display = "";
    document.getElementById("AjaxLogin2").style.display = "none";
}