Esempio n. 1
0
        /// <summary>
        /// 请求修改密码
        /// </summary>
        /// <param name="mobilePhone"></param>
        /// <param name="password"></param>
        /// <param name="code"></param>
        /// <param name="errMsg"></param>
        /// <returns></returns>
        public static bool RequestChangePassword(string mobilePhone, string password, string code, out string errMsg)
        {
            errMsg = String.Empty;
            try
            {
                if (string.IsNullOrEmpty(password))
                {
                    errMsg = "密码不能为空!";
                    return(false);
                }
                //1.校验注册码是否合法
                if (!SmsLogBll.CheckSmsVerificationCode(mobilePhone, code, ESmsLogType.BuyerChangePassword, out errMsg))
                {
                    return(false);
                }

                var buyer = BuyerInfoBll.GetModelByMobilePhone(mobilePhone, out errMsg);
                if (buyer == null)
                {
                    errMsg = string.Format("手机号:{0}不存在!", mobilePhone);
                    return(false);
                }
                buyer.Password = password;
                buyer.LDate    = DateTime.Now;
                buyer.LMan     = buyer.BuyerId;
                return(Dal.Update(buyer, Global.ApplicationParms.ConnectionString));
            }
            catch (Exception ex)
            {
                errMsg = "执行异常:" + ex.Message;
                Logger.LogError4Exception(ex, "AppLogger");
            }
            return(false);
        }
Esempio n. 2
0
 /// <summary>
 /// 检查注册验证码是否合法
 /// </summary>
 /// <param name="mobilePhone">注册手机号</param>
 /// <param name="code">手机接收验证码</param>
 /// <param name="errMsg">错误信息</param>
 /// <returns>true:合法</returns>
 public static bool CheckRegisterVerificationCode(string mobilePhone, string code, out string errMsg)
 {
     errMsg = String.Empty;
     try
     {
         //1.校验注册码是否合法
         return(SmsLogBll.CheckSmsVerificationCode(mobilePhone, code, ESmsLogType.SellerRegister, out errMsg));
     }
     catch (Exception ex)
     {
         errMsg = "异常:" + ex.Message;
         Logger.LogError4Exception(ex, "AppLogger");
     }
     return(false);
 }
Esempio n. 3
0
        /// <summary>
        /// 请求注册新用户(买家用户)
        /// </summary>
        /// <param name="mobilePhone">注册手机号</param>
        /// <param name="password">登录密码(不能为空,)</param>
        /// <param name="code">注册验证码</param>
        /// <param name="buyerId">如果用户添加成功,返回用户编号</param>
        /// <param name="errMsg">错误信息</param>
        /// <returns>true:添加新用户成功</returns>
        public static bool RequestRegisterNewUser(string mobilePhone, string password, string code, out int buyerId, out string errMsg)
        {
            errMsg  = String.Empty;
            buyerId = -1;

            try
            {
                //1.校验注册码是否合法
                if (!SmsLogBll.CheckSmsVerificationCode(mobilePhone, code, ESmsLogType.BuyerRegister, out errMsg))
                {
                    return(false);
                }

                //添加新用户
                buyerId = Dal.Insert(mobilePhone, password, Global.ApplicationParms.ConnectionString, out errMsg);
                return(buyerId > 0);
            }
            catch (Exception ex)
            {
                errMsg = "执行异常:" + ex.Message;
                Logger.LogError4Exception(ex, "AppLogger");
            }
            return(false);
        }