Beispiel #1
0
        /// <summary>
        /// 用户登录校验
        /// </summary>
        /// <param name="cUserCode"></param>
        /// <param name="cPassword"></param>
        /// <param name="user_Return"></param>
        /// <param name="strMsg"></param>
        /// <returns></returns>
        public static bool LoginVerifyJustNumber(string number, out string strMsg)
        {
            strMsg = "";
            try
            {
                P_Con_User user;
                user = userService.selectOneByNum(number);

                if (user != null)
                {
                    CurrentUser = user;
                }
                else
                {
                    strMsg = "用户不存在";
                    return(false);
                }

                return(true);
            }
            catch (Exception ex)
            {
                //logger.Error("bll_P_Con_User.LoginVerify 方法出错!" + ex.ToString());
                return(false);
            }
        }
Beispiel #2
0
        }                                           //员工卡号

        /// <summary>
        /// 用户登录校验
        /// </summary>
        /// <param name="cUserCode"></param>
        /// <param name="cPassword"></param>
        /// <param name="user_Return"></param>
        /// <param name="strMsg"></param>
        /// <returns></returns>
        public static bool LoginVerify(string cUserCode, string cPassword, out string strMsg)
        {
            strMsg = "";
            try
            {
                #region 生成验证密码密文串
                string     strYan = "";
                P_Con_User user;
                user = userService.selectOneByName(cUserCode);

                if (user != null)
                {
                    if (user.User_password.Length >= 8)
                    {
                        strYan = user.User_password.Substring(0, 8);
                    }
                    else
                    {
                        strMsg = "用户密码无效!请重置";
                        return(false);
                    }
                }
                else
                {
                    strMsg = "用户名或密码错误";
                    return(false);
                }
                string strPassword = strYan + ToolKit.StrToMD5(strYan + cPassword);
                if (cPassword == "*no~@~check~@~password*")
                {
                    user.User_password = cPassword;
                }
                else
                {
                    if (user.User_password != strPassword)
                    {
                        strMsg = "密码错误";
                        return(false);
                    }
                }
                #endregion
                user.Org_name = userService.getOrganizationName(user.Org_id);
                CurrentUser   = user;
                return(true);
            }
            catch (Exception ex)
            {
                //logger.Error("bll_P_Con_User.LoginVerify 方法出错!" + ex.ToString());
                return(false);
            }
        }