﻿var userHelper = function() {
    this.userName;
    this.userPwd;
}
userHelper.prototype.UserLoginCallBack = function(data) {
    alert(data);
    
    if (MaskDialog != undefined && data.indexOf("成功") > -1)
        MaskDialog.hide();
}
userHelper.prototype.Login = function(userName, userPwd, validateCode, callBack) {
    var user = {};
    user["username"] = userName;
    user["userpwd"] = userPwd;
    user["validateCode"] = validateCode;
    if (callBack != undefined)
        this.UserLoginCallBack = callBack;
    $.post("/LoginAjax.aspx", user, this.UserLoginCallBack);
    this.Clear();

}
userHelper.prototype.ChangeCheckCode = function(imgControl) {
    var dt = new Date();
    imgControl.src = "/Web/WebHard.aspx?t=" + dt;
    return false;
}
//清除control内的数据
userHelper.prototype.Clear = function(control) {
    $(":text").each(function() {
        $(this).val("");
    });
    $(":password").each(function() {
        $(this).val("");
    });

}
 

