日期:2014-05-17 浏览次数:21170 次
namespace AJAX_Pro_Login.Entity { [Serializable] public class T_User { public T_User() { } private int m_intUserID = 0; private string m_strUserName = ""; private string m_strLoginCode = ""; private string m_strWhereCondition = ""; private string m_strOrderByExpression = ""; public int UserID { get { return m_intUserID; } set { m_intUserID = value; } } public string UserName { get { return m_strUserName; } set { m_strUserName = value; } } public string LoginCode { get { return m_strLoginCode; } set { m_strLoginCode = value; } } public string WhereCondition { get { return m_strWhereCondition; } set { m_strWhereCondition = value; } } public string OrderByExpression { get { return m_strOrderByExpression; } set { m_strOrderByExpression = value; } } } }
function Button1_onclick() { //取得用户输入的用户名和密码! var mUserName = document.getElementById("txtUserName").value; var mPassWord = document.getElementById("txtPWD").value; if (mUserName == "") { //对用户名输入框进行非空验证 alert("用户名不能为空!"); document.getElementById("txtUserName").focus(); return false; } if (mPassWord == "") { //对密码输入框进行非空验证 alert("密码不能为空!"); document.getElementById("txtPWD").focus(); return false; } var mEntity = new AJAX_Pro_Login.Entity.T_User(); //这个语句报错了,麻烦告诉我方法 mEntity.WhereCondition = " LoginCode = '" + mUserName + "' And PWD = '" + mPassWord + "'"; mEntity.OrderByExpression = ""; //以用户名和密码为参调用后台CS里面的登录验证方法,返回所查询的用户名! AJAX_Pro_Login._Default.SetLoginCheck(mEntity, callback); }
[AjaxPro.AjaxMethod] public bool IsExistUser(string strUserName, string Level) { bool flag = new M_BLL.T_User().IsUser(strUserName, Level);//调用用户是否存在 放在bll层 return flag; } #endregion 检测用户名是否存在 #region 检测密码 public bool IsExistPwd(string strUserName, string strUserPwd, string Level) { string pwd = ""; if (Level == "1") { pwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(strUserPwd, "MD5").ToSt