Esempio n. 1
0
        protected static readonly DBUser dbUser = new DBUser();//引用数据访问层

        /// <summary>
        /// 账号或者密码错误返回null
        /// </summary>
        public User CheckLogin(string userID, string userPwd)
        {
            if (string.IsNullOrEmpty(userID) || string.IsNullOrEmpty(userPwd))
            {
                return(null);
            }

            User user = dbUser.SelectByID(userID);

            if (null == user)
            {
                return(null);
            }

            if (user.UserPwd.Equals(Tool.StringHelper.EncryptPwd(userPwd)))
            {
                return(user);
            }
            else
            {
                return(null);
            }
        }