コード例 #1
0
    public void SendCode()
    {
        string SPID = HttpUtility.HtmlDecode(Request.QueryString["SPID"].ToString());

        if (String.IsNullOrEmpty(SPID))
        {
            return;
        }
        String ErrorDescription = "";


        //int Result = CommonBizRules.SPInterfaceGrant(SPID, "SendSMSCode", this.Context, out ErrorDescription);
        int Result = PhoneBO.SPInterfaceGrant(SPID, "SendSMSCode", out ErrorDescription);

        if (Result != 0)
        {
            return;
        }
        Random random     = new Random();
        string AuthenCode = random.Next(111111, 999999).ToString();
        string PhoneNum   = HttpUtility.HtmlDecode(Request.QueryString["PhoneNum"].ToString());
        string msg        = "";

        k = PhoneBO.PhoneSel("", PhoneNum, out msg);    // 验证电话是否可以做认证电话(这里的电话包括手机和电话)
        if (k == 0)
        {
            Result = PhoneBO.InsertPhoneSendMassage("", "欢迎开通号码百事通账户,验证码为" + AuthenCode + ",有效期2分钟。", AuthenCode, PhoneNum, DateTime.Now, "", 1, 0, "1", out msg);
            //CommonBizRules.SendMessageV3(PhoneNum, "欢迎开通号码百事通账户,验证码为" + AuthenCode + ",有效期2分钟。", SPID);
            Response.Write(k);
        }
        else
        {
            Response.Write(k);
        }
    }
コード例 #2
0
    public void SendCode()
    {
        string SPID = HttpUtility.HtmlDecode(Request.QueryString["SPID"].ToString());

        if (String.IsNullOrEmpty(SPID))
        {
            return;
        }
        String ErrorDescription = "";


        int Result = CommonBizRules.SPInterfaceGrant(SPID, "SendSMSCode", this.Context, out ErrorDescription);

        if (Result != 0)
        {
            return;
        }
        Random random     = new Random();
        string AuthenCode = random.Next(111111, 999999).ToString();
        string PhoneNum   = HttpUtility.HtmlDecode(Request.QueryString["PhoneNum"].ToString());
        string msg        = "";

        Result = PhoneBO.InsertPhoneSendMassage("", "", AuthenCode, PhoneNum, DateTime.Now, "", 1, 0, "1", out msg);
        //CommonBizRules.SendMessage(PhoneNum, "您的验证码是" + AuthenCode, SPID);
        CommonBizRules.SendMessageV3(PhoneNum, "您的验证码是" + AuthenCode, SPID);
    }
コード例 #3
0
    protected void SetAuthenPhoneBtn_Click(object sender, EventArgs e)
    {
        LoginPassword = Request["LoginPassword"];
        Phone         = Request["Phone"];
        AuthenCode    = Request["AuthenCode"];
        CheckCode     = Request["CheckCode"];

        // 校验LoginPassword

        try
        {
            if (!CommonUtility.ValidateValidateCode(HttpUtility.HtmlDecode(CheckCode), this.Context))
            {
                errorHint.InnerHtml = "<script type='text/javascript'>showError('验证码校验未通过!')</script>";
                return;
            }
            else
            {
                string webpwd = CryptographyUtil.Encrypt(LoginPassword);
                int    i      = FindPwd.SelState(CustID, webpwd, out ErrMsg);
                if (i != 0)
                {
                    errorHint.InnerHtml = "<script type='text/javascript'>  $('#LoginPassword').attr('value','" + LoginPassword + "');$('#Phone').attr('value','" + Phone + "');$('#AuthenCode').attr('value','" + AuthenCode + "');$('#CheckCode').attr('value','" + CheckCode + "');showError('登录密码输入错误,请重新输入!')</script>";
                    return;
                }
                else
                {
                    Result = PhoneBO.SelSendSMSMassage(CustID, Phone, AuthenCode, out ErrMsg);   // 校验手机验证码
                    if (Result == 0)
                    {
                        Result = PhoneBO.PhoneSetV2(SPID, CustID, Phone, "2", "2", out ErrMsg);
                        if (Result == 0)
                        {
                            //跳转
                            errorHint.InnerHtml = "<script type='text/javascript'>showError('认证手机设置成功!')</script>";
                            //Response.Redirect("m.114yg.cn",true);
                            return;
                        }
                        else
                        {
                            errorHint.InnerHtml = "<script type='text/javascript'>showError('" + ErrMsg + "!')</script>";
                            return;
                        }
                    }
                    else
                    {
                        errorHint.InnerHtml = "<script type='text/javascript'>showError('" + ErrMsg + "!')</script>";
                        return;
                    }
                }
            }
        }
        catch (Exception exp)
        {
            errorHint.InnerHtml = "<script type='text/javascript'>showError('" + exp.ToString() + "!')</script>";
            return;
        }
    }
コード例 #4
0
    public int PhoneAuth()
    {
        string ErrMsg   = "";
        string PhoneNum = HttpUtility.HtmlDecode(Request.QueryString["PhoneNum"].ToString());
        string SPID     = HttpUtility.HtmlDecode(Request.QueryString["SPID"].ToString());
        int    Result   = PhoneBO.PhoneSel("", PhoneNum, out ErrMsg);

        return(Result);
    }
コード例 #5
0
    /// <summary>
    /// 作者:赵锐
    /// 日期:2009年10月12日
    /// </summary>
    public void delMobile()
    {
        string id         = HttpUtility.HtmlDecode(Request.QueryString["a"].ToString());
        string phone      = HttpUtility.HtmlDecode(Request.QueryString["b"].ToString());
        string phoneclass = HttpUtility.HtmlDecode(Request.QueryString["c"].ToString());
        int    i          = PhoneBO.DelPhone(phone, id, out msg);

        Response.Write(i);
    }
コード例 #6
0
    public int ExistBesttoneAccount()
    {
        string ErrMsg   = "";
        string PhoneNum = HttpUtility.HtmlDecode(Request.QueryString["PhoneNum"].ToString());
        string SPID     = HttpUtility.HtmlDecode(Request.QueryString["SPID"].ToString());
        int    Result   = PhoneBO.IsBesttoneAccountBind(PhoneNum, out ErrMsg);

        return(Result);
    }
コード例 #7
0
    protected void register_Click(object sender, EventArgs e)
    {
        string mobile    = this.mobile.Text;
        string checkCode = this.checkCode.Text;
        string password  = this.password.Text;
        string password2 = this.password2.Text;

        //判断手机验证码
        if (checkCode != null && !"".Equals(checkCode))
        {
            Result = PhoneBO.SelSendSMSMassage("", mobile, checkCode, out ErrMsg);
            if (Result != 0)
            {
                errorHint.InnerHtml = "手机验证码错误,请重新输入";
                return;
            }
        }

        Result = UserRegistry.quickUserRegistryWeb(SPID, password, mobile, "2", out CustID, out ErrMsg);
        if (Result != 0)
        {
            CommonBizRules.ErrorHappenedRedircet(Result, ErrMsg, "用户注册", this.Context);
            return;
        }

        SPInfoManager spInfo = new SPInfoManager();
        Object        SPData = spInfo.GetSPData(this.Context, "SPData");
        string        key    = spInfo.GetPropertyBySPID(SPID, "SecretKey", SPData);

        string Digest = CryptographyUtil.GenerateAuthenticator(TimeStamp + "$" + CustID + "$" + Result + "$" + ErrMsg, key);
        string temp   = SPID + "$" + CryptographyUtil.Encrypt(TimeStamp + "$" + CustID + "$" + Result + "$" + ErrMsg + "$" + Digest, key);
        string RegistryResponseValue = HttpUtility.UrlEncode(temp);

        log(String.Format("key:{0},Digest:{1},temp:{2},RegistryResponseValue:{3}", key, Digest, temp, RegistryResponseValue));
        //给用户写cookie
        UserToken UT   = new UserToken();
        string    key2 = spInfo.GetPropertyBySPID("35000000", "SecretKey", SPData);

        string RealName = mobile;
        string UserName = mobile;
        string NickName = mobile;

        //                                           CustID, RealName, UserName, NickName, OuterID, CustType, string LoginAuthenName, string LoginAuthenType,string key, out string ErrMsg
        string UserTokenValue = UT.GenerateUserToken(CustID, RealName, UserName, NickName, "", "42", UserName, "1", key2, out ErrMsg);
        string CookieName     = System.Configuration.ConfigurationManager.AppSettings["CookieName"];

        PageUtility.SetCookie(UserTokenValue, CookieName, this.Page);

        //通知积分平台
        CIP2BizRules.InsertCustInfoNotify(CustID, "2", SPID, "", "0", out ErrMsg);
        //记登录日志
        CommonBizRules.WriteDataCustAuthenLog(SPID, CustID, "35", "0", "", "2", Result, ErrMsg);

        Response.Redirect(ReturnUrl + "?RegistryResponse=" + RegistryResponseValue, true);
    }
コード例 #8
0
    protected void register_Click(object sender, EventArgs e)
    {
        Int32  Result = ErrorDefinition.CIP_IError_Result_UnknowError_Code;
        String ErrMsg = ErrorDefinition.CIP_IError_Result_UnknowError_Msg;


        //判断手机验证码
        if (checkCode != null && !"".Equals(checkCode))
        {
            Result = PhoneBO.SelSendSMSMassage("", this.mobile.Text, checkCode, out ErrMsg);
            if (Result != 0)
            {
                hintCode.InnerHtml = "手机验证码错误,请重新输入";  // 这里如何控制样式
                return;
            }
        }


        //String realName,String contactTel,String sex,String certtype,String certnum,
        Result = BesttoneAccountHelper.RegisterBesttoneAccount(this.mobile.Text, realName, this.contactTel.Text, contactMail, sex, this.certtype.Value, certnum, TransactionID, out ErrMsg);
        if (Result == 0)
        {
            log(String.Format("开户结果:{0},{1},{2}", Result, ErrMsg, this.myCustID.Value));
            // todo 建立绑定关系,插入绑定关系表
            int ret = 0;

            ret = UserRegistry.CreateBesttoneAccount(SPID, this.myCustID.Value, this.mobile.Text, out ErrMsg);
            if (ret == 0)
            {
                log(String.Format("绑定结果:ret:{0},ErrMsg:{1},ReturnUrl:{2}", ret, ErrMsg, ReturnUrl));


                Response.Redirect(this.myReturnUrl.Value);
            }
            else
            {
                log(String.Format("绑定结果:{0},{1}", ret, ErrMsg));
                Response.Redirect("ErrorInfo.aspx?ErrorInfo=" + ErrMsg);
            }
        }
        else
        {
            log(String.Format("开户结果:{0},{1}", Result, ErrMsg));
            Response.Redirect("ErrorInfo.aspx?ErrorInfo=" + ErrMsg);
        }
    }
コード例 #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String t_authenCode = "";
        String ErrMsg       = "";
        String Phone        = Request["Phone"];
        int    Result       = PhoneBO.SelSendSMSMessageAuthenCode(Phone, out t_authenCode, out ErrMsg);

        if (Result == 0)
        {
            AuthenCode = t_authenCode;
            Response.Write("您的验证码是:" + AuthenCode);
        }
        else
        {
            Response.Write("没有取得验证码");
        }
    }
コード例 #10
0
    public void SendCode()
    {
        int    ajaxcode = -1;
        string SPID     = HttpUtility.HtmlDecode(Request.QueryString["SPID"].ToString());

        if (String.IsNullOrEmpty(SPID))
        {
            return;
        }
        String ErrorDescription = "";

        int count = Convert.ToInt32(HttpUtility.HtmlDecode(Request.QueryString["count"].ToString())); // 发送次数
        //int Result = CommonBizRules.SPInterfaceGrant(SPID, "SendSMSCode", this.Context, out ErrorDescription);
        int Result = PhoneBO.SPInterfaceGrant(SPID, "SendSMSCode", out ErrorDescription);

        if (Result != 0)
        {
            return;
        }
        Random   random     = new Random();
        string   AuthenCode = random.Next(111111, 999999).ToString();
        string   PhoneNum   = HttpUtility.HtmlDecode(Request.QueryString["PhoneNum"].ToString());
        string   msg        = "";
        DateTime DealTime   = DateTime.Now;

        //Result = PhoneBO.PhoneSel(CustID, Phone, out ErrMsg);    // 验证电话是否可以做认证电话(这里的电话包括手机和电话)


        k = PhoneBO.PhoneSel("", PhoneNum, out msg);    // 验证电话是否可以做认证电话(这里的电话包括手机和电话)
        if (k == 0)
        {
            CommonBizRules.SendMessageV3(PhoneNum, "欢迎注册号码百事通会员,验证码为" + AuthenCode + ",有效期2分钟。", SPID);
            Result = PhoneBO.InsertPhoneSendMassage("", "欢迎注册号码百事通会员,验证码为" + AuthenCode + ",有效期2分钟。", AuthenCode, PhoneNum, DateTime.Now, "", count, 0, "1", out msg);
            logger.Info(PhoneNum + "<->" + AuthenCode);
            Response.Write(k);
        }
        else
        {
            logger.Info(PhoneNum + ":" + msg);
            Response.Write(k);
        }
    }
コード例 #11
0
ファイル: setMobile.aspx.cs プロジェクト: qinains/lihongtu
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string mobile = null;
            string Spid   = null;
            string Msg    = "";

            TokenValidate.IsRedircet = true;
            TokenValidate.Validate();
            string CustID = TokenValidate.CustID;
            if (CustID != "")
            {
                this.custidtxt.Value = CustID;
            }
            Spid = Request["SPID"] == null ? String.Empty : Request["SPID"].ToString();
            //if (Request["SPID"] != null)
            //{
            //    if (Request["SPID"].ToString() != "35000000")
            //    {
            //        Spid = Request["SPID"].ToString();
            //    }
            //    else
            //    {
            //        Spid = "35000000";
            //    }
            //}
            //else
            //{
            //    Spid = "";
            //}
            if (Request["Phone"] != null)
            {
                mobile = Request["Phone"].ToString();
                this.verifyMobile.Value = mobile;
                return;
            }

            mobile = PhoneBO.SelPhoneNumV2(this.custidtxt.Value, Spid, out Msg);
            this.verifyMobile.Value = mobile;
        }
    }
コード例 #12
0
    void TestMethod()
    {
        Int32  Result = -1;
        String ErrMsg = String.Empty;

        try
        {
            //for (Int32 i = 0; i < 50; i++)
            //{
            //根据电话取得相关的客户信息(客户电话表CustPhone)
            BasicInfoV2Record[] custinfoList = PhoneBO.GetQueryByPhone("35000000", "18918790558", out Result, out ErrMsg);
            //}
        }
        catch (Exception ex)
        {
            ErrMsg += ex.Message;
        }
        finally
        {
            log(ErrMsg);
        }
    }
コード例 #13
0
    /// <summary>
    /// 作者:赵锐
    /// 日期:2009年8月15日
    /// </summary>
    public void selMobile()
    {
        string custid = HttpUtility.HtmlDecode(Request.QueryString["custid"].ToString());
        string mnum   = HttpUtility.HtmlDecode(Request.QueryString["mnum"].ToString());
        string spid   = HttpUtility.HtmlDecode(Request.QueryString["spid"].ToString());
        int    count  = Convert.ToInt32(HttpUtility.HtmlDecode(Request.QueryString["count"].ToString()));

        k = PhoneBO.PhoneSel(custid, mnum, out msg);
        if (k == 0)
        {
            Random random     = new Random();
            string AuthenCode = random.Next(111111, 999999).ToString();
            //CommonBizRules.SendMessage(mnum, "您的验证码是:"+AuthenCode, spid);
            CommonBizRules.SendMessageV3(mnum, "您在设置认证手机,验证码是:" + AuthenCode, spid);
            int y = PhoneBO.InsertPhoneSendMassage(custid, "您在设置认证手机,验证码信息内容", AuthenCode, mnum, DateTime.Now, "描述未知", count, 0, "1", out msg);
            Response.Write(y);
        }
        else
        {
            Response.Write(msg);
        }
    }
コード例 #14
0
    /// <summary>
    /// 作者:赵锐
    /// 日期:2009年8月15日
    /// </summary>
    public void setMobile()
    {
        string ErrMsg = "";
        string mnum   = HttpUtility.HtmlDecode(Request.QueryString["mnum"].ToString());
        string auth   = HttpUtility.HtmlDecode(Request.QueryString["auth"].ToString());
        string custid = HttpUtility.HtmlDecode(Request.QueryString["custid"].ToString());
        string spid   = HttpUtility.HtmlDecode(Request.QueryString["spid"].ToString());
        string pwd    = HttpUtility.HtmlDecode(Request.QueryString["pwd"].ToString());
        string webpwd = CryptographyUtil.Encrypt(pwd);
        int    i      = FindPwd.SelState(custid, webpwd, out ErrMsg); // 根据custid和webpwd 校验客户身份是否合法性

        if (!ValidateValidateCode())                                  //校验页面验证码
        {
            Response.Write("验证码错误,请重新输入");
            return;
        }
        else
        {
            if (i != 0)
            {
                Response.Write("登录密码输入错误,请重新输入");
                return;
            }
            else
            {
                k = PhoneBO.SelSendSMSMassage(custid, mnum, auth, out msg);   // 校验手机验证码
                if (k == 0)
                {
                    //int y = PhoneBO.PhoneSet(spid, custid, mnum, "2", "2", out msg);
                    int y = PhoneBO.PhoneSetV2(spid, custid, mnum, "2", "2", out msg);
                    Response.Write(k);
                }
                else
                {
                    Response.Write(msg);
                }
            }
        }
    }
コード例 #15
0
ファイル: mobileInfo.aspx.cs プロジェクト: qinains/lihongtu
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string Spid = null;

            TokenValidate.IsRedircet = true;
            TokenValidate.Validate();
            string CustID = TokenValidate.CustID;

            Spid = Request["SPID"] == null ? String.Empty : Request["SPID"];
            //if (Request.QueryString["SPID"] != null)
            //{
            //    if (Request.QueryString["SPID"].ToString() != "35000000")
            //    {
            //        Spid = Request.QueryString["SPID"].ToString();
            //    }
            //    else
            //    {
            //        Spid = "35000000";
            //    }
            //}
            //else
            //{
            //    Spid = "";
            //}

            DataSet ds = PhoneBO.GetAllPhone(CustID, out Msg);
            if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                this.Repeater1.DataSource = ds;
                this.Repeater1.DataBind();
            }
            else
            {
                Response.Redirect("setMobile.aspx?id=4&SPID=35000000");
            }
        }
    }
コード例 #16
0
    public int PhoneAuth()
    {
        string SPID = HttpUtility.HtmlDecode(Request.QueryString["SPID"].ToString());

        if (String.IsNullOrEmpty(SPID))
        {
            return(-1);
        }
        String ErrorDescription = "";
        int    Result           = CommonBizRules.SPInterfaceGrant(SPID, "SendSMSCode", this.Context, out ErrorDescription);

        if (Result != 0)
        {
            return(-2);
        }

        string ErrMsg   = "";
        string PhoneNum = HttpUtility.HtmlDecode(Request.QueryString["PhoneNum"].ToString());

        //int Result = PhoneBO.PhoneSel("", "", PhoneNum, SPID, out ErrMsg);
        //int Result = 0;
        Result = PhoneBO.PhoneSel("", PhoneNum, out ErrMsg);
        return(Result);
    }
コード例 #17
0
    protected void MobileAuthenButton_Click(object sender, ImageClickEventArgs e)
    {
        AuthenPhone   = Request["AuthenMobile"];
        SmsAuthenCode = Request["AuthenCode"];
        StringBuilder sbLog = new StringBuilder();

        sbLog.AppendFormat("AuthenPhone:{0}\r\n", AuthenPhone);
        sbLog.AppendFormat("AuthenCode:{0}\r\n", SmsAuthenCode);
        CustID    = this.custidtxt.Value;
        ReturnUrl = this.returnurltxt.Value;
        SPID      = this.spidtxt.Value;
        sbLog.AppendFormat("SPID:{0}\r\n", SPID);
        sbLog.AppendFormat("CustID:{0}\r\n", CustID);
        sbLog.AppendFormat("ReturnUrl:{0}\r\n", ReturnUrl);
        ErrMsg = String.Empty;

        try
        {
            DateTime        starttime = DateTime.Now;
            int             k         = PhoneBO.PhoneSel(CustID, AuthenPhone, out ErrMsg);
            DateTime        endtime   = DateTime.Now;
            System.TimeSpan deltatime = endtime.Subtract(starttime);
            sbLog.AppendFormat("判断手机是否可以作为认证手机返回结果k={0},ErrMsg:{1}\r\n", k, ErrMsg);
            sbLog.AppendFormat("判断手机是否可以作为认证手机消耗时间:{0}\r\n", deltatime.Milliseconds);
            if (k == 0)   //代表该手机没有被认证过
            {
                sbLog.AppendFormat("{0}:该手机没有被用过\r\n", AuthenPhone);
                ErrMsg    = String.Empty;
                starttime = DateTime.Now;
                int w = PhoneBO.SelSendSMSMassageOnRegister(CustID, AuthenPhone, SmsAuthenCode, out ErrMsg);   // 校验手机验证码   这里要注意的是 通过短信上行注册认证手机获取手机验证码的时候,没有将custid和短信验证码绑定,因此校验验证码的时候不能关联custid条件,这里的参数CustID是从cookie中获得的
                endtime   = DateTime.Now;
                deltatime = endtime.Subtract(starttime);
                sbLog.AppendFormat("校验手机验证码返回结果w={0},ErrMsg:{1}\r\n", w, ErrMsg);
                sbLog.AppendFormat("校验手机验证码消耗时间:{0}\r\n", deltatime.Milliseconds);
                if (w == 0)
                {
                    sbLog.AppendFormat("校验手机验证码通过:{0}\r\n", SmsAuthenCode);
                    ErrMsg    = String.Empty;
                    starttime = DateTime.Now;
                    int y = PhoneBO.PhoneSetV2(SPID, CustID, AuthenPhone, "2", "2", out ErrMsg);
                    endtime   = DateTime.Now;
                    deltatime = endtime.Subtract(starttime);
                    sbLog.AppendFormat("设置认证手机结果y={0},ErrMsg={1}\r\n", y, ErrMsg);
                    sbLog.AppendFormat("设置认证手机消耗时间:{0}\r\n", deltatime.Milliseconds);
                    Response.Redirect(ReturnUrl, true);
                    //CommonBizRules.SuccessRedirect(ReturnUrl, "您已成功设置认证手机", HttpContext.Current);
                }
                else
                {
                    Result = w;
                    this.AuthenCodeError.InnerText = "校验手机验证码失败:" + ErrMsg;
                    sbLog.AppendFormat("校验手机验证码失败:{0}|{1}\r\n", w, ErrMsg);
                    return;
                }
            }
            else
            {
                Result = k;
                this.AuthenPhoneError.InnerText = "设置认证手机失败:" + ErrMsg;
                sbLog.AppendFormat("设置认证手机失败:{0}|{1}\r\n", k, ErrMsg);
                return;
            }
        }
        catch (Exception ept)
        {
            sbLog.AppendFormat("异常:{0}", ept.Message);
        }
        finally
        {
            log(sbLog.ToString());
        }
    }
コード例 #18
0
    public String RegisterInLowstingHttp(String SPID, String UserName, String PassWord, String PassWord2, String Device, String ShareCode, String wt)
    {
        StringBuilder ResponseMsg = new StringBuilder();

        #region 数据校验
        if (CommonUtility.IsEmpty(SPID))
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "995");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "SPID不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "995");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "SPID不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        if (CommonUtility.IsEmpty(UserName))
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "996");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "UserName不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "996");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "UserName不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        if (CommonUtility.IsEmpty(AuthenCode))
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "998");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "AuthenCode不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "998");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "AuthenCode不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }
        String t_CustID = String.Empty;
        String msg      = String.Empty;
        int    k        = PhoneBO.SelSendSMSMassage(t_CustID, UserName, AuthenCode, out msg);
        if (k != 0)
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "998");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "验证码不正确!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "998");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "验证码不正确!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }


        String regMobile = @"^1[345678]\d{9}$";
        //String regEmail = @"^[0-9a-zA-Z_\-\.]*[0-9a-zA-Z_\-]@[0-9a-zA-Z]+\.+[0-9a-zA-Z_\-.]+$";
        //String RegularUserName = @"^[a-zA-Z][a-zA-Z0-9]*([-._]?[a-zA-Z0-9]+)*$";
        if (!ValidateUserName(UserName, regMobile))
        //if (!ValidateUserName(UserName, RegularUserName))
        {
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "991");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "UserName只能是手机号码!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "991");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "UserName只能是手机号码!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        if (CommonUtility.IsEmpty(PassWord))
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "997");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "PassWord不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "997");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "PassWord不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }


        if (CommonUtility.IsEmpty(PassWord2))
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "997");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "PassWord2不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "997");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "PassWord2不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        if (!PassWord.Equals(PassWord2))
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "1001");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "密码不一致!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "1001");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "密码不一致!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        #endregion

        String appId       = UDBConstDefinition.DefaultInstance.UnifyPlatformAppId;
        String appSecret   = UDBConstDefinition.DefaultInstance.UnifyPlatformAppSecret;
        String version     = UDBConstDefinition.DefaultInstance.UnifyPlatformVersion;
        String clientType  = UDBConstDefinition.DefaultInstance.UnifyPlatformClientType;
        String clientIp    = HttpContext.Current.Request.UserHostAddress;
        String clientAgent = HttpContext.Current.Request.UserAgent;
        String sendSms     = UDBConstDefinition.DefaultInstance.UnifyPlatformRegisterAccountSendSms;
        if (String.IsNullOrEmpty(sendSms))
        {
            sendSms = "false";
        }

        //综合平台隐式注册只支持手机,也就是说,用户名模式,放弃注册为天翼账号,仅注册为号百用户
        //既有用户名又有手机的,放弃注册天翼账号
        String Unify_ErrMsg = String.Empty;
        String userId       = String.Empty;
        String o_userName   = String.Empty;
        String accessToken  = String.Empty;
        //msg.AppendFormat("注册天翼账号:\r\n");
        int Unify_Result = CIP2BizRules.RegisterUnifyPlatformAccount(appId, appSecret, version, clientType, clientIp, clientAgent, UserName, PassWord, sendSms, out userId, out o_userName, out accessToken, out Unify_ErrMsg);
        //msg.AppendFormat("注册天翼账号,Result:{0},accessToken:{1},userId:{2},usrName:{3},ErrMsg:{4}\r\n", Unify_Result, accessToken, userId, o_userName, Unify_ErrMsg);


        if (Unify_Result == 0 && !String.IsNullOrEmpty(userId) && !String.IsNullOrEmpty(accessToken))
        {
            //Result = UserRegistry.UserRegisterWebLowStintV3(SPID, UserName, PassWord, Device, ShareCode, out CustID, out ErrMsg);
            UDBMBOSS         _UDBMBoss   = new UDBMBOSS();
            UnifyAccountInfo accountInfo = new UnifyAccountInfo();
            Unify_Result = _UDBMBoss.UnifyPlatformGetUserInfo(appId, appSecret, version, clientType, accessToken, clientIp, clientAgent, out accountInfo, out Unify_ErrMsg);
            String OuterID, Status, CustType, CustLevel, NickName, Email, CertificateCode, CertificateType, Sex, RealName, EnterpriseID, ProvinceID, AreaID, RegistrationSource;

            if (Unify_Result == 0 && !String.IsNullOrEmpty(Convert.ToString(accountInfo.userId)))
            {
                String MobileName = String.Empty;
                String EmailName  = String.Empty;
                if (!String.IsNullOrEmpty(accountInfo.nickName))
                {
                    RealName = accountInfo.nickName;
                }
                else if (!String.IsNullOrEmpty(accountInfo.userName))
                {
                    RealName = accountInfo.userName;
                }
                else if (!String.IsNullOrEmpty(accountInfo.mobileName))
                {
                    RealName = accountInfo.mobileName;
                }
                else if (!String.IsNullOrEmpty(accountInfo.emailName))
                {
                    RealName = accountInfo.emailName;
                }
                else
                {
                    RealName = "";
                }
                if (!String.IsNullOrEmpty(accountInfo.mobileName))
                {
                    MobileName = accountInfo.mobileName;
                }
                if (!String.IsNullOrEmpty(accountInfo.emailName))
                {
                    EmailName = accountInfo.emailName;
                }
                String EncrytpPassWord = CryptographyUtil.Encrypt(PassWord);
                String OperType        = "2"; // 注册 ,

                if (!String.IsNullOrEmpty(MobileName) || !String.IsNullOrEmpty(EmailName))
                {
                    CustID = String.Empty;

                    Result = CIP2BizRules.BindCustInfoUnifyPlatform("02", "021", MobileName, EmailName, RealName, EncrytpPassWord, accountInfo.userId, SPID, OperType, out CustID, out ErrMsg);

                    if (Result == 0 && !String.IsNullOrEmpty(CustID))
                    {
                        Result = CustBasicInfo.getCustInfo(SPID, CustID, out ErrMsg, out OuterID, out Status, out CustType, out CustLevel, out RealName,
                                                           out UserName, out NickName, out CertificateCode, out CertificateType, out Sex, out Email, out EnterpriseID, out ProvinceID,
                                                           out AreaID, out RegistrationSource);
                        CommonBizRules.WriteTraceIpLog(CustID, UserName, SPID, Request.UserHostAddress.ToString(), "client_zc");

                        String youhuiquan_url = "http://www.114yg.cn/facadeHome.do?actions=facadeHome&method=sendCouponToShare&wt=json&from=" + Device + "&registerCustId=" + CustID;
                        String jsonmsg        = HttpMethods.HttpGet(youhuiquan_url);
                        System.Collections.Generic.Dictionary <string, string> resuzt = Newtonsoft.Json.JsonConvert.DeserializeObject <System.Collections.Generic.Dictionary <string, string> >(jsonmsg);
                        //{"returnCode":"00000"}
                        string youhuiquan = "";
                        resuzt.TryGetValue("returnCode", out youhuiquan);
                        ResponseMsg.Length = 0;
                        if ("json".Equals(wt))
                        {
                            ResponseMsg.Append("{");
                            ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "0");
                            ResponseMsg.AppendFormat("\"CustID\":\"{0}\",", CustID);
                            ResponseMsg.AppendFormat("\"returnCode\":\"{0}\",", youhuiquan);
                            ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "注册成功!");
                            ResponseMsg.Append("}");
                        }
                        else
                        {
                            ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                            ResponseMsg.Append("<PayPlatRequestParameter>");
                            ResponseMsg.Append("<PARAMETERS>");
                            ResponseMsg.AppendFormat("<CustID>{0}</CustID>", CustID);
                            ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "0");
                            ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "注册成功!");
                            ResponseMsg.Append("</PARAMETERS>");
                            ResponseMsg.Append("</PayPlatRequestParameter>");
                        }
                        return(ResponseMsg.ToString());
                    }
                }
                else
                {
                    ResponseMsg.Length = 0;
                    if ("json".Equals(wt))
                    {
                        ResponseMsg.Append("{");
                        ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "-11");
                        ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "MobileName或EmailName为空不能注册天翼账号所以号百注册也失败!");
                        ResponseMsg.Append("}");
                    }
                    else
                    {
                        ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                        ResponseMsg.Append("<PayPlatRequestParameter>");
                        ResponseMsg.Append("<PARAMETERS>");
                        ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "-11");
                        ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "MobileName或EmailName为空不能注册天翼账号所以号百注册也失败!!");
                        ResponseMsg.Append("</PARAMETERS>");
                        ResponseMsg.Append("</PayPlatRequestParameter>");
                    }
                    return(ResponseMsg.ToString());
                }
                //http://www.114yg.cn/facadeHome.do?actions=facadeHome&method=sendCouponToShare&wt=json&from=ios&registerCustId=134664179
                //"http://116.228.55.13:8113/facadeHome.do?actions=facadeHome&method=sendCouponToShare&wt=json&from=ios&registerCustId=
            }
            else
            {
                ResponseMsg.Length = 0;
                if ("json".Equals(wt))
                {
                    ResponseMsg.Append("{");
                    ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "-10");
                    ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "号百账号注册失败!");
                    ResponseMsg.Append("}");
                }
                else
                {
                    ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                    ResponseMsg.Append("<PayPlatRequestParameter>");
                    ResponseMsg.Append("<PARAMETERS>");
                    ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "-10");
                    ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "号百账号注册失败!");
                    ResponseMsg.Append("</PARAMETERS>");
                    ResponseMsg.Append("</PayPlatRequestParameter>");
                }
                return(ResponseMsg.ToString());
            }
        }
        else
        {
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "-10");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "天翼账号注册失败!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "-10");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "天翼账号注册失败!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }
        return(ResponseMsg.ToString());
    }
コード例 #19
0
    public String RegisterInLowstingHttp(String SPID, String UserName, String PassWord, String PassWord2, String Device, String wt)
    {
        StringBuilder ResponseMsg = new StringBuilder();

        #region 数据校验
        if (CommonUtility.IsEmpty(SPID))
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "995");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "SPID不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "995");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "SPID不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        if (CommonUtility.IsEmpty(UserName))
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "996");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "UserName不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "996");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "UserName不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        if (CommonUtility.IsEmpty(AuthenCode))
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "998");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "AuthenCode不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "998");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "AuthenCode不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }
        String t_CustID = String.Empty;
        String msg      = String.Empty;
        int    k        = PhoneBO.SelSendSMSMassage(t_CustID, UserName, AuthenCode, out msg);
        if (k != 0)
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "998");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "验证码不正确!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "998");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "验证码不正确!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }
        String regMobile       = @"^1[345678]\d{9}$";
        String regEmail        = @"^[0-9a-zA-Z_\-\.]*[0-9a-zA-Z_\-]@[0-9a-zA-Z]+\.+[0-9a-zA-Z_\-.]+$";
        String RegularUserName = @"^[a-zA-Z][a-zA-Z0-9]*([-._]?[a-zA-Z0-9]+)*$";

        if (!ValidateUserName(UserName, regMobile))
        //if (!ValidateUserName(UserName, RegularUserName))
        {
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "991");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "UserName只能是手机号码!");
                //ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "UserName不合乎规范!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "991");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "UserName只能是手机号码!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        if (CommonUtility.IsEmpty(PassWord))
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "997");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "PassWord不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "997");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "PassWord不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }


        if (CommonUtility.IsEmpty(PassWord2))
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "997");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "PassWord2不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "997");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "PassWord2不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        if (!PassWord.Equals(PassWord2))
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "1001");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "密码不一致!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "1001");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "密码不一致!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }


        //Result = CustBasicInfo.IsExistUser(UserName);

        //if (Result != 0)
        //{
        //    // 返回错误信息
        //    ResponseMsg.Length = 0;
        //    if ("json".Equals(wt))
        //    {
        //        ResponseMsg.Append("{");
        //        ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "1000");
        //        ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "用户名已经存在!");
        //        ResponseMsg.Append("}");
        //    }
        //    else
        //    {
        //        ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
        //        ResponseMsg.Append("<PayPlatRequestParameter>");
        //        ResponseMsg.Append("<PARAMETERS>");
        //        ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "1000");
        //        ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "用户名已经存在!");
        //        ResponseMsg.Append("</PARAMETERS>");
        //        ResponseMsg.Append("</PayPlatRequestParameter>");
        //    }
        //    return ResponseMsg.ToString();
        //}



        //验证码校验

        //if (!CommonUtility.ValidateValidateCode(HttpUtility.HtmlDecode(checkCode), this.Context))
        //{
        //hintError提示错误验证码校验未通过
        //errorHint.InnerHtml = "验证码校验未通过!";
        //return;
        //}


        #endregion



        String appId       = UDBConstDefinition.DefaultInstance.UnifyPlatformAppId;
        String appSecret   = UDBConstDefinition.DefaultInstance.UnifyPlatformAppSecret;
        String version     = UDBConstDefinition.DefaultInstance.UnifyPlatformVersion;
        String clientType  = UDBConstDefinition.DefaultInstance.UnifyPlatformClientType;
        String clientIp    = HttpContext.Current.Request.UserHostAddress;
        String clientAgent = HttpContext.Current.Request.UserAgent;
        String sendSms     = UDBConstDefinition.DefaultInstance.UnifyPlatformRegisterAccountSendSms;
        if (String.IsNullOrEmpty(sendSms))
        {
            sendSms = "false";
        }

        //综合平台隐式注册只支持手机,也就是说,用户名模式,放弃注册为天翼账号,仅注册为号百用户
        //既有用户名又有手机的,放弃注册天翼账号
        String Unify_ErrMsg = String.Empty;
        String userId       = String.Empty;
        String o_userName   = String.Empty;
        String accessToken  = String.Empty;
        //msg.AppendFormat("注册天翼账号:\r\n");
        int Unify_Result = CIP2BizRules.RegisterUnifyPlatformAccount(appId, appSecret, version, clientType, clientIp, clientAgent, UserName, PassWord, sendSms, out userId, out o_userName, out accessToken, out Unify_ErrMsg);
        //msg.AppendFormat("注册天翼账号,Result:{0},accessToken:{1},userId:{2},usrName:{3},ErrMsg:{4}\r\n", Unify_Result, accessToken, userId, o_userName, Unify_ErrMsg);

        if (Unify_Result == 0 && !String.IsNullOrEmpty(userId) && !String.IsNullOrEmpty(accessToken))
        {
            Result = UserRegistry.UserRegisterWebLowStintV2(SPID, UserName, PassWord, Device, out CustID, out ErrMsg);
            if (Result == 0)
            {
                String IPAddress = Request.UserHostAddress.ToString();
                CommonBizRules.WriteTraceIpLog(CustID, UserName, SPID, IPAddress, "client_zc");

                String youhuiquan_url = "http://www.114yg.cn/facadeHome.do?actions=facadeHome&method=sendCouponToRegist&wt=json&from=" + Device + "&custId=" + CustID;
                String jsonmsg        = HttpMethods.HttpGet(youhuiquan_url);
                System.Collections.Generic.Dictionary <string, string> resuzt = Newtonsoft.Json.JsonConvert.DeserializeObject <System.Collections.Generic.Dictionary <string, string> >(jsonmsg);
                //{"returnCode":"00000"}
                string youhuiquan = "";
                resuzt.TryGetValue("returnCode", out youhuiquan);

                //建立绑定关系  (待完成)
                //因暂时不支持lognum

                ResponseMsg.Length = 0;
                if ("json".Equals(wt))
                {
                    ResponseMsg.Append("{");
                    ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "0");
                    ResponseMsg.AppendFormat("\"CustID\":\"{0}\",", CustID);
                    ResponseMsg.AppendFormat("\"returnCode\":\"{0}\",", youhuiquan);
                    ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "注册成功!");
                    ResponseMsg.Append("}");
                }
                else
                {
                    ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                    ResponseMsg.Append("<PayPlatRequestParameter>");
                    ResponseMsg.Append("<PARAMETERS>");
                    ResponseMsg.AppendFormat("<CustID>{0}</CustID>", CustID);
                    ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "0");
                    ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "注册成功!");
                    ResponseMsg.Append("</PARAMETERS>");
                    ResponseMsg.Append("</PayPlatRequestParameter>");
                }
                return(ResponseMsg.ToString());
            }
            else
            {
                // 账号注册失败
                ResponseMsg.Length = 0;
                if ("json".Equals(wt))
                {
                    ResponseMsg.Append("{");
                    ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "-1");
                    ResponseMsg.AppendFormat("\"CustID\":\"{0}\",", "");
                    ResponseMsg.AppendFormat("\"returnCode\":\"{0}\",", "");
                    ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "注册失败!");
                    ResponseMsg.Append("}");
                }
                else
                {
                    ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                    ResponseMsg.Append("<PayPlatRequestParameter>");
                    ResponseMsg.Append("<PARAMETERS>");
                    ResponseMsg.AppendFormat("<CustID>{0}</CustID>", "");
                    ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "-1");
                    ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "注册失败!");
                    ResponseMsg.Append("</PARAMETERS>");
                    ResponseMsg.Append("</PayPlatRequestParameter>");
                }
                return(ResponseMsg.ToString());
            }
        }
        else
        {
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "-11");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "天翼账号注册失败!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "-11");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "天翼账号注册失败!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }
        return(ResponseMsg.ToString());
    }
コード例 #20
0
    protected void register_Click(object sender, EventArgs e)
    {
        Response.AddHeader("P3P", "CP=CAO PSA OUR");

        SPID      = Request["SPID"] == null ? ConstHelper.DefaultInstance.BesttoneSPID : HttpUtility.HtmlDecode(Request["SPID"]);
        ReturnUrl = Request["ReturnUrl"] == null ? ConstHelper.DefaultInstance.BesttoneLoginPage : HttpUtility.HtmlDecode(Request["ReturnUrl"]);

        log(String.Format("【Web注册】:SPID:{0},ReturnUrl:{1}", SPID, ReturnUrl));
        string password  = Request.Form["password"].ToString().Trim();
        string telephone = Request.Form["mobile"].ToString().Trim();
        string phonecode = Request.Form["checkCode"].ToString().Trim();

        log(String.Format("mobile:{0},password:{1},phonecode:{2}", telephone, password, phonecode));
        string ErrMsg = "";
        int    Result;


        if (CommonUtility.IsEmpty(password))
        {
            hintPassword.InnerHtml = "密码不能为空格"; // 这里如何控制样式
            return;
        }

        if (ViewState["phonestate"] == null)
        {
            ViewState["phonestate"] = Request.Form["phonestate"].ToString();
            string a = (string)ViewState["phonestate"];
        }

        if (((string)ViewState["phonestate"]).Equals("0"))
        {
            //判断手机验证码
            Result = PhoneBO.SelSendSMSMassage("", telephone, phonecode, out ErrMsg);
            if (Result != 0)
            {
                hintCode.InnerHtml = "手机验证码错误,请重新输入";  // 这里如何控制样式
                return;
            }
        }

        TimeStamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        Result    = UserRegistry.quickUserRegistryWeb(SPID, password, telephone, (string)ViewState["phonestate"], out CustID, out ErrMsg);
        if (Result != 0)
        {
            CommonBizRules.ErrorHappenedRedircet(Result, ErrMsg, "用户注册", this.Context);
            return;
        }

        SPInfoManager spInfo = new SPInfoManager();
        Object        SPData = spInfo.GetSPData(this.Context, "SPData");
        string        key    = spInfo.GetPropertyBySPID(SPID, "SecretKey", SPData);
        string        Digest = CryptographyUtil.GenerateAuthenticator(TimeStamp + "$" + CustID + "$" + Result + "$" + ErrMsg, key);
        string        temp   = SPID + "$" + CryptographyUtil.Encrypt(TimeStamp + "$" + CustID + "$" + Result + "$" + ErrMsg + "$" + Digest, key);
        string        RegistryResponseValue = HttpUtility.UrlEncode(temp);

        log(String.Format("key:{0},Digest:{1},temp:{2},RegistryResponseValue:{3}", key, Digest, temp, RegistryResponseValue));
        //给用户写cookie
        UserToken UT   = new UserToken();
        string    key2 = spInfo.GetPropertyBySPID("35000000", "SecretKey", SPData);

        string RealName = telephone;
        string UserName = telephone;
        string NickName = telephone;

        //                                           CustID, RealName, UserName, NickName, OuterID, CustType, string LoginAuthenName, string LoginAuthenType,string key, out string ErrMsg
        string UserTokenValue = UT.GenerateUserToken(CustID, RealName, UserName, NickName, "", "42", UserName, "1", key2, out ErrMsg);
        string CookieName     = System.Configuration.ConfigurationManager.AppSettings["CookieName"];

        PageUtility.SetCookie(UserTokenValue, CookieName, this.Page);

        //通知积分平台
        CIP2BizRules.InsertCustInfoNotify(CustID, "2", SPID, "", "0", out ErrMsg);
        //记登录日志
        CommonBizRules.WriteDataCustAuthenLog(SPID, CustID, "35", "0", "", "2", Result, ErrMsg);

        log(String.Format("【返回之前】:SPID:{0},ReturnUrl:{1}", SPID, ReturnUrl));


        string hid_openAccount = Request.Form["hid_openAccount"].ToString().Trim();

        log(String.Format("开户选项:{0}", hid_openAccount));



        if (ReturnUrl.IndexOf("?") > 0)
        {
            if ("1".Equals(hid_openAccount))
            {
                // 这里要 跳回 调用方,并告知 CreateBesttoneAccount.aspx,让其重定向到该地址
                //Response.Write(" <A   id= 'kh '   href= 'CreateBesttoneAccount.aspx?mobile=" + telephone + "&ReturnUrl=" + ReturnUrl + "'   target= '_top '> </A> <script language='javascript' type='text/javascript'> document.getElementById('kh').click(); </script> ");
                //return;
                //Response.Redirect("CreateBesttoneAccount.aspx?mobile=" + telephone + "&ReturnUrl=" + ReturnUrl);
                Response.Redirect(ReturnUrl + "&RegistryResponse=" + RegistryResponseValue + "&registBesttoneAccount=true", true);
            }
            else
            {
                Response.Redirect(ReturnUrl + "&RegistryResponse=" + RegistryResponseValue, true);
            }


            //Response.Redirect(ReturnUrl  + "&RegistryResponse=" + RegistryResponseValue, true);
            //CommonBizRules.SuccessRedirect(ReturnUrl + "&RegistryResponse=" + RegistryResponseValue, "成功注册", this.Context);
        }
        else
        {
            if ("1".Equals(hid_openAccount))
            {
                // 这里要 跳回 调用方,并告知 CreateBesttoneAccount.aspx,让其重定向到该地址
                //Response.Write(" <A   id= 'kh '   href= 'CreateBesttoneAccount.aspx?mobile=" + telephone + "&ReturnUrl=" + ReturnUrl + "'   target= '_top '> </A> <script language='javascript' type='text/javascript'> document.getElementById('kh').click(); </script> ");
                //return;
                //Response.Redirect("CreateBesttoneAccount.aspx?mobile=" + telephone + "&ReturnUrl=" + ReturnUrl);
                Response.Redirect(ReturnUrl + "?RegistryResponse=" + RegistryResponseValue + "&registBesttoneAccount=true", true);
            }
            else
            {
                Response.Redirect(ReturnUrl + "?RegistryResponse=" + RegistryResponseValue, true);
            }

            //CommonBizRules.SuccessRedirect(ReturnUrl + "?RegistryResponse=" + RegistryResponseValue, "成功注册", this.Context);
        }
    }
コード例 #21
0
    public String GetAuthenCode(String SPID, String CustID, String wt)
    {
        StringBuilder ResponseMsg = new StringBuilder();

        #region
        if (CommonUtility.IsEmpty(SPID))
        {
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "995");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "SPID不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "995");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "SPID不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        if (CommonUtility.IsEmpty(CustID))
        {
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "995");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "CustID不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "995");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "CustID不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }



        String             Phone   = String.Empty;
        BesttoneAccount    account = null;
        BesttoneAccountDAO dao     = new BesttoneAccountDAO();
        account = dao.QueryByCustID(CustID);
        if (account != null)
        {
            Phone = account.BestPayAccount;
        }
        else
        {
            //未开户
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "997");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "该CustID尚未开户!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "997");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "该CustID尚未开户!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        #endregion


        try
        {
            //String CustID = PhoneBO.IsAuthenPhone(Phone, SPID, out ErrMsg);

            Result = CommonBizRules.SPInterfaceGrant(SPID, "GetAuthenCode", this.Context, out ErrMsg);
            if (Result != 0)
            {
                ResponseMsg.Length = 0;
                if ("json".Equals(wt))
                {
                    ResponseMsg.Append("{");
                    ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "991");
                    ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "调用下行短信接口权限未开通!");
                    ResponseMsg.Append("}");
                }
                else
                {
                    ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                    ResponseMsg.Append("<PayPlatRequestParameter>");
                    ResponseMsg.Append("<PARAMETERS>");
                    ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "991");
                    ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "调用下行短信接口权限未开通!");
                    ResponseMsg.Append("</PARAMETERS>");
                    ResponseMsg.Append("</PayPlatRequestParameter>");
                }
                return(ResponseMsg.ToString());
            }

            Random random     = new Random();
            String AuthenCode = random.Next(111111, 999999).ToString();

            DateTime DealTime = DateTime.Now;
            int      k        = PhoneBO.PhoneSelV2("", Phone, out ErrMsg); // 检查发送验证码次数
            if (k == 0)
            {
                CommonBizRules.SendMessageV3(Phone, "您正在通过翼购客户端找回支付密码,验证码为:" + AuthenCode + ",有效期2分钟。", SPID);
                Result = PhoneBO.InsertPhoneSendMassage(CustID, "您正在通过翼购客户端找回支付密码,验证码为:" + AuthenCode + ",有效期2分钟。", AuthenCode, Phone, DateTime.Now, "客户端找回支付密码", 1, 0, "1", out ErrMsg);
            }
            else
            {
                ResponseMsg.Length = 0;
                if ("json".Equals(wt))
                {
                    ResponseMsg.Append("{");
                    ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "992");
                    ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "该手机号码已经被注册过了!");
                    ResponseMsg.Append("}");
                }
                else
                {
                    ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                    ResponseMsg.Append("<PayPlatRequestParameter>");
                    ResponseMsg.Append("<PARAMETERS>");
                    ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "992");
                    ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "该手机号码已经被注册过了!");
                    ResponseMsg.Append("</PARAMETERS>");
                    ResponseMsg.Append("</PayPlatRequestParameter>");
                }
                return(ResponseMsg.ToString());
            }


            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "0");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "您的验证码是:" + AuthenCode);
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "0");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "您的验证码是:" + AuthenCode);
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }
        catch (Exception exp)
        {
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "-25367");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "异常:" + exp.ToString());
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "-25367");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "异常:" + exp.ToString());
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        return(ResponseMsg.ToString());
    }
コード例 #22
0
    public void notifyRecivedShortMessages(ShortMessage[] in0)
    {
        DateTime starttime = DateTime.Now;
        DateTime endtime   = DateTime.Now;

        System.TimeSpan delta = endtime.Subtract(starttime);
        //in0[0].deliverTime
        //in0[0].srcPhoneNumber
        //in0[0].msgContent      RZ(设置认证手机) CZ(重置密码)
        //in0[0].destPhoneNumber

        String NeedSendDownSMS = System.Configuration.ConfigurationManager.AppSettings["NeedSendDownSMS"];

        StringBuilder strLog = new StringBuilder();

        strLog.Append("====" + starttime + "=======");
        strLog.AppendFormat("主叫手机号码:{0};被叫号码:{1};上行短信内容:{2}\r\n", in0[0].srcPhoneNumber, in0[0].destPhoneNumber, in0[0].msgContent);

        Int32  Result = 0;
        String ErrMsg = "";
        String SPID   = "";

        //11811411   10690007311811    11811412   10690007311812
        try
        {
            if ("11811411".Equals(in0[0].destPhoneNumber) || "10690007311811".Equals(in0[0].destPhoneNumber))
            {
                SPID = "35433333";
            }
            else
            {
                SPID = "35433334";
            }
            String msg    = "验证码:";
            String CustID = "";
            String type   = String.Empty;
            type = in0[0].msgContent.ToLower();   // 类型 cz 重置密码   ,rz 认证手机   ,kt 开通账户

            if ("cz".Equals(type))
            {
                msg    = "您正在通过手机重置密码,验证码为:";
                CustID = PhoneBO.IsAuthenPhone(in0[0].srcPhoneNumber, SPID, out ErrMsg);
                if (!String.IsNullOrEmpty(CustID))
                {
                    Random random     = new Random();
                    String AuthenCode = random.Next(111111, 999999).ToString();
                    starttime = DateTime.Now;

                    SqlConnection conn = new SqlConnection(DBUtility.BestToneCenterConStr);
                    SqlCommand    cmd  = new SqlCommand("select mesage from SmsTemplate where id=2", conn);
                    using (conn)
                    {
                        conn.Open();
                        SqlDataReader reader = cmd.ExecuteReader();
                        while (reader.Read())
                        {
                            msg = (string)reader["mesage"];
                        }
                    }
                    StringBuilder msgtemplate = new StringBuilder();
                    if (String.IsNullOrEmpty(msg))
                    {
                        msg = "您正在通过手机重置密码,验证码为:{0},有效期2分钟。";
                    }
                    msgtemplate.AppendFormat(msg, AuthenCode);
                    if (String.IsNullOrEmpty(NeedSendDownSMS))
                    {
                        CommonBizRules.SendMessageV3(in0[0].srcPhoneNumber, msgtemplate.ToString(), SPID);
                    }
                    Result  = PhoneBO.InsertPhoneSendMassage(CustID, msgtemplate.ToString(), AuthenCode, in0[0].srcPhoneNumber, DateTime.Now, in0[0].msgContent, 1, 0, "1", out ErrMsg);
                    endtime = DateTime.Now;
                    delta   = endtime.Subtract(starttime);
                    strLog.AppendFormat("下发短信消耗时间:{0}\r\n", delta.Milliseconds);
                }
                else
                {
                    SqlConnection conn = new SqlConnection(DBUtility.BestToneCenterConStr);
                    SqlCommand    cmd  = new SqlCommand("select mesage from SmsTemplate where id=3", conn);
                    using (conn)
                    {
                        conn.Open();
                        SqlDataReader reader = cmd.ExecuteReader();
                        while (reader.Read())
                        {
                            msg = (string)reader["mesage"];
                        }
                    }
                    StringBuilder msgtemplate = new StringBuilder();
                    if (String.IsNullOrEmpty(msg))
                    {
                        msg = "亲,您正在通过手机获取验证码来重置密码,但是{0}不是号百客户的认证手机,不能通过该号码找回密码。";
                    }
                    msgtemplate.AppendFormat(msg, in0[0].srcPhoneNumber);
                    if (String.IsNullOrEmpty(NeedSendDownSMS))
                    {
                        CommonBizRules.SendMessageV3(in0[0].srcPhoneNumber, msgtemplate.ToString(), SPID);
                    }
                    //CommonBizRules.SendMessageV3(in0[0].srcPhoneNumber, "亲,您正在通过手机获取验证码来重置密码,但是" + in0[0].srcPhoneNumber + "不是号百客户的认证手机,不能通过该号码找回密码。", SPID);
                }
            }

            if ("rz".Equals(type))
            {
                strLog.AppendFormat("CustID:{0}\r\n", CustID);
                Random random     = new Random();
                String AuthenCode = random.Next(111111, 999999).ToString();
                //int k = PhoneBO.PhoneSelV2("", in0[0].srcPhoneNumber, out ErrMsg);    // 验证电话是否可以做认证电话(这里的电话包括手机和电话)
                //int k = 0;
                starttime = DateTime.Now;
                int k = PhoneBO.PhoneSel(CustID, in0[0].srcPhoneNumber, out ErrMsg);   // 验证电话是否可以做认证电话(这里的电话包括手机和电话) 以及发送次数控制
                endtime = DateTime.Now;
                delta   = endtime.Subtract(starttime);
                strLog.AppendFormat("验证手机是否是认证手机以及发送短信次数控制:{0};{1}\r\n", k, ErrMsg);
                strLog.AppendFormat("消耗查询电话时间:{0}\r\n", delta.Milliseconds);
                if (k == 0)
                {
                    msg = "欢迎注册号码百事通会员,验证码为:";

                    strLog.AppendFormat("验证码类型:{0}\r\n", msg);
                    starttime = DateTime.Now;

                    SqlConnection conn = new SqlConnection(DBUtility.BestToneCenterConStr);
                    SqlCommand    cmd  = new SqlCommand("select mesage from SmsTemplate where id=4", conn);
                    using (conn)
                    {
                        conn.Open();
                        SqlDataReader reader = cmd.ExecuteReader();
                        while (reader.Read())
                        {
                            msg = (string)reader["mesage"];
                        }
                    }
                    StringBuilder msgtemplate = new StringBuilder();
                    if (String.IsNullOrEmpty(msg))
                    {
                        msg = "亲,欢迎注册号码百事通会员,验证码为:{0},有效期2分钟。";
                    }
                    msgtemplate.AppendFormat(msg, AuthenCode);
                    if (String.IsNullOrEmpty(NeedSendDownSMS))
                    {
                        CommonBizRules.SendMessageV3(in0[0].srcPhoneNumber, msgtemplate.ToString(), SPID);
                    }
                    //CommonBizRules.SendMessageV3(in0[0].srcPhoneNumber, msg + AuthenCode + ",有效期2分钟。", SPID);
                    Result  = PhoneBO.InsertPhoneSendMassage(CustID, msg + AuthenCode + ",有效期2分钟。", AuthenCode, in0[0].srcPhoneNumber, DateTime.Now, in0[0].msgContent, 1, 0, "1", out ErrMsg);
                    endtime = DateTime.Now;
                    delta   = endtime.Subtract(starttime);
                    strLog.AppendFormat("下发短信消耗时间:{0}\r\n", delta.Milliseconds);
                }
                else
                {
                    SqlConnection conn = new SqlConnection(DBUtility.BestToneCenterConStr);
                    SqlCommand    cmd  = new SqlCommand("select mesage from SmsTemplate where id=5", conn);
                    using (conn)
                    {
                        conn.Open();
                        SqlDataReader reader = cmd.ExecuteReader();
                        while (reader.Read())
                        {
                            msg = (string)reader["mesage"];
                        }
                    }
                    StringBuilder msgtemplate = new StringBuilder();
                    if (String.IsNullOrEmpty(msg))
                    {
                        msg = "亲,您的手机号码:{0}已经是号码百事通客户了,无须再次为该号码设置认证手机。";
                    }
                    msgtemplate.AppendFormat(msg, in0[0].srcPhoneNumber);
                    if (String.IsNullOrEmpty(NeedSendDownSMS))
                    {
                        CommonBizRules.SendMessageV3(in0[0].srcPhoneNumber, msgtemplate.ToString(), SPID);
                    }

                    //   CommonBizRules.SendMessageV3(in0[0].srcPhoneNumber, "亲,您的手机号码" + in0[0].srcPhoneNumber + "已经是号码百事通客户了,无须再次为该号码设置认证手机。", SPID);
                }
            }


            if ("kt".Equals(type))
            {
                strLog.AppendFormat("开通账户CustID:{0}\r\n", CustID);
                Random random     = new Random();
                String AuthenCode = random.Next(111111, 999999).ToString();

                starttime = DateTime.Now;
                Result    = PhoneBO.IsBesttoneAccountBind(in0[0].srcPhoneNumber, out ErrMsg); // 验证电话是否可以做账户
                endtime   = DateTime.Now;
                delta     = endtime.Subtract(starttime);
                strLog.AppendFormat("验证手机是否是可以做账户号码:{0};{1}\r\n", Result, ErrMsg);
                strLog.AppendFormat("消耗IsBesttoneAccountBind时间:{0}\r\n", delta.Milliseconds);
                if (Result == 0)
                {
                    msg = "欢迎注册开通号码百事通账户,验证码为:";

                    strLog.AppendFormat("验证码类型:{0}\r\n", msg);
                    starttime = DateTime.Now;

                    SqlConnection conn = new SqlConnection(DBUtility.BestToneCenterConStr);
                    SqlCommand    cmd  = new SqlCommand("select mesage from SmsTemplate where id=6", conn);
                    using (conn)
                    {
                        conn.Open();
                        SqlDataReader reader = cmd.ExecuteReader();
                        while (reader.Read())
                        {
                            msg = (string)reader["mesage"];
                        }
                    }
                    StringBuilder msgtemplate = new StringBuilder();
                    if (String.IsNullOrEmpty(msg))
                    {
                        msg = "亲,欢迎注册开通号码百事通账户,验证码为:{0},有效期2分钟。";
                    }
                    msgtemplate.AppendFormat(msg, AuthenCode);
                    if (String.IsNullOrEmpty(NeedSendDownSMS))
                    {
                        CommonBizRules.SendMessageV3(in0[0].srcPhoneNumber, msgtemplate.ToString(), SPID);
                    }
                    //CommonBizRules.SendMessageV3(in0[0].srcPhoneNumber, msg + AuthenCode + ",有效期2分钟。", SPID);
                    Result  = PhoneBO.InsertPhoneSendMassage(CustID, msg + AuthenCode + ",有效期2分钟。", AuthenCode, in0[0].srcPhoneNumber, DateTime.Now, in0[0].msgContent, 1, 0, "1", out ErrMsg);
                    endtime = DateTime.Now;
                    delta   = endtime.Subtract(starttime);
                    strLog.AppendFormat("下发短信消耗时间:{0}\r\n", delta.Milliseconds);
                }
                else
                {
                    SqlConnection conn = new SqlConnection(DBUtility.BestToneCenterConStr);
                    SqlCommand    cmd  = new SqlCommand("select mesage from SmsTemplate where id=7", conn);
                    using (conn)
                    {
                        conn.Open();
                        SqlDataReader reader = cmd.ExecuteReader();
                        while (reader.Read())
                        {
                            msg = (string)reader["mesage"];
                        }
                    }
                    StringBuilder msgtemplate = new StringBuilder();
                    if (String.IsNullOrEmpty(msg))
                    {
                        msg = "亲,您的手机号码:{0}已经开通过号码百事通账户了,无须再次为该号码开通账户。";
                    }
                    msgtemplate.AppendFormat(msg, in0[0].srcPhoneNumber);
                    if (String.IsNullOrEmpty(NeedSendDownSMS))
                    {
                        CommonBizRules.SendMessageV3(in0[0].srcPhoneNumber, msgtemplate.ToString(), SPID);
                    }
                    //CommonBizRules.SendMessageV3(in0[0].srcPhoneNumber, "亲,您的手机号码" + in0[0].srcPhoneNumber + "已经开通过号码百事通账户了,无须再次为该号码开通账户。", SPID);
                }
            }
        }
        catch (Exception e)
        {
            strLog.AppendFormat("发生异常:{0}", e.Message);
        }
        finally
        {
            BTUCenterInterfaceLog.CenterForBizTourLog("PushPortClientService", strLog);
        }
        //CommonBizRules.SendMessageV3("18930036387", "哈哈哈哈", "35433333");
    }
コード例 #23
0
    protected void register_Click(object sender, EventArgs e)
    {
        StringBuilder strLog = new StringBuilder();

        try
        {
            ParseSPTokenRequest();
            //CreateSPTokenRequest();

            Int32  Result = ErrorDefinition.CIP_IError_Result_UnknowError_Code;
            String ErrMsg = ErrorDefinition.CIP_IError_Result_UnknowError_Msg;
            realName = Request["realName"];
            //contactMail = Request["contactMail"];
            sex       = Request["sex"];
            certnum   = Request["certnum"];
            checkCode = Request["checkCode"];
            CustID    = this.myCustID.Value;
            strLog.AppendFormat("开户页面手机验证码:{0}", checkCode);

            //判断手机验证码
            if (checkCode != null && !"".Equals(checkCode))
            {
                Result = PhoneBO.SelSendSMSMassage("", this.mobile.Text, checkCode, out ErrMsg);
                if (Result != 0)
                {
                    hintCode.InnerHtml = "手机验证码错误,请重新输入";  // 这里如何控制样式

                    return;
                }
            }

            string BindedBestpayAccount          = "";
            string CreateTime                    = "";
            int    IsBesttoneAccountBindV5Result = CIP2BizRules.IsBesttoneAccountBindV5(this.myCustID.Value, out BindedBestpayAccount, out CreateTime, out ErrMsg);
            if (IsBesttoneAccountBindV5Result == 0)
            {
                Response.Redirect("ErrorInfo.aspx?ErrorInfo=该账户绑定关系未解除,请联系管理人员!");
            }

            TransactionID = BesttoneAccountHelper.CreateTransactionID();
            AccountItem ai           = new AccountItem();
            string      ResponseCode = "";
            int         QueryBesttoneAccountResult = BesttoneAccountHelper.BesttoneAccountInfoQuery(this.mobile.Text, out ai, out ResponseCode, out ErrMsg);
            strLog.AppendFormat("查询账户信息返回:{0},{1},{2}", QueryBesttoneAccountResult, ErrMsg, this.mobile.Text);
            if (QueryBesttoneAccountResult == 0)
            {
                if ("200010".Equals(ResponseCode))  // 200010 -> 客户不存在
                {
                    //todo 发起开户请求日志
                    UserRegistry.BeforeCreateBesttoneAccount(SPID, TransactionID, this.myCustID.Value, this.mobile.Text, out ErrMsg);
                    strLog.AppendFormat("BeforeCreateBesttoneAccount:ErrMsg:{0}", ErrMsg);
                    //String realName,String contactTel,String sex,String certtype,String certnum,
                    Result = BesttoneAccountHelper.RegisterBesttoneAccount(this.mobile.Text, realName, this.mobile.Text, "", sex, "1", certnum, TransactionID, out ErrMsg);
                    if (Result == 0)
                    {
                        strLog.AppendFormat("开户结果:{0},{1},{2}", Result, ErrMsg, this.myCustID.Value);
                        // todo 建立绑定关系,插入绑定关系表
                        int ret = 0;

                        ret = UserRegistry.CreateBesttoneAccount(SPID, this.myCustID.Value, this.mobile.Text, out ErrMsg);
                        strLog.AppendFormat("CreateBesttoneAccount:ErrMsg:{0}", ErrMsg);
                        if (ret == 0)
                        {
                            //todo 开户完成 建立绑定关系 日志
                            UserRegistry.AfterCreateBesttoneAccount(SPID, TransactionID, this.myCustID.Value, this.mobile.Text, out ErrMsg);
                            strLog.AppendFormat("AfterCreateBesttoneAccount:ErrMsg:{0}", ErrMsg);
                            strLog.AppendFormat("绑定结果:ret:{0},ErrMsg:{1},ReturnUrl:{2}", ret, ErrMsg, ReturnUrl);

                            int retWriteBack = UserRegistry.WriteBackBestToneAccountToCustInfo(SPID, this.myCustID.Value, realName, certnum, out ErrMsg);
                            strLog.AppendFormat("回写客户信息结果:retWriteBack:{0},ErrMsg:{1}", retWriteBack, ErrMsg);

                            strLog.AppendFormat("SPTokenRequest={0}", SPTokenRequest);
                            strLog.AppendFormat("Redirect to Url:{0}", "OpenAccountResult.aspx?SPTokenRequest=" + HttpUtility.UrlEncode(SPTokenRequest) + "&CreateBesttoneAccountResult=0");
                            Response.Redirect("OpenAccountResult.aspx?SPTokenRequest=" + HttpUtility.UrlEncode(SPTokenRequest) + "&CreateBesttoneAccountResult=0");
                        }
                        else
                        {
                            strLog.AppendFormat("绑定结果:{0},{1}", ret, ErrMsg);
                            Response.Redirect("ErrorInfo.aspx?ErrorInfo=" + ErrMsg);
                        }
                    }
                    else
                    {
                        strLog.AppendFormat("开户结果:{0},{1}", Result, ErrMsg);
                        Response.Redirect("ErrorInfo.aspx?ErrorInfo=" + ErrMsg);
                    }
                }
                else  // 账户已存在
                {
                    // todo 建立绑定关系,插入绑定关系表
                    UserRegistry.OnlyBindingBesttoneAccount(SPID, TransactionID, this.myCustID.Value, this.mobile.Text, out ErrMsg);
                    strLog.AppendFormat("OnlyBindingBesttoneAccount:ErrMsg:{0}", ErrMsg);
                    int ret = 0;

                    ret = UserRegistry.CreateBesttoneAccount(SPID, this.myCustID.Value, this.mobile.Text, out ErrMsg);
                    if (ret == 0)
                    {
                        int retWriteBack = UserRegistry.WriteBackBestToneAccountToCustInfo(SPID, this.myCustID.Value, realName, certnum, out ErrMsg);
                        strLog.AppendFormat("回写客户信息结果:retWriteBack:{0},ErrMsg:{1}", retWriteBack, ErrMsg);
                        strLog.AppendFormat("绑定结果:ret:{0},ErrMsg:{1},ReturnUrl:{2}", ret, ErrMsg, ReturnUrl);
                        strLog.AppendFormat(String.Format("SPTokenRequest={0}", SPTokenRequest));
                        Response.Redirect("OpenAccountResult.aspx?SPTokenRequest=" + HttpUtility.UrlEncode(SPTokenRequest) + "&CreateBesttoneAccountResult=0");
                        //Response.Redirect(this.myReturnUrl.Value);
                    }
                    else
                    {
                        strLog.AppendFormat("绑定结果:{0},{1}", ret, ErrMsg);
                        Response.Redirect("ErrorInfo.aspx?ErrorInfo=" + ErrMsg);
                    }
                }
            }
            else
            {
                strLog.AppendFormat("查询账户信息返回:{0},{1},{2}", QueryBesttoneAccountResult, ErrMsg, this.mobile.Text);
                Response.Redirect("ErrorInfo.aspx?ErrorInfo=" + ErrMsg);
            }
        }
        catch (System.Exception ex)
        {
            log(ex.ToString());
        }
        finally
        {
            log(strLog.ToString());
        }
    }
コード例 #24
0
    public String FindBackPassWordByMobile(String SPID, String Phone, String AuthenCode, String PassWord)
    {
        StringBuilder ResponseMsg = new StringBuilder();

        #region
        if (CommonUtility.IsEmpty(SPID))
        {
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "995");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "SPID不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "995");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "SPID不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }


        //if (CommonUtility.IsEmpty(CustID))
        //{

        //    ResponseMsg.Length = 0;
        //    if ("json".Equals(wt))
        //    {
        //        ResponseMsg.Append("{");
        //        ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "996");
        //        ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "CustID不能为空!");
        //        ResponseMsg.Append("}");
        //    }
        //    else
        //    {
        //        ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
        //        ResponseMsg.Append("<PayPlatRequestParameter>");
        //        ResponseMsg.Append("<PARAMETERS>");
        //        ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "996");
        //        ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "CustID不能为空!");
        //        ResponseMsg.Append("</PARAMETERS>");
        //        ResponseMsg.Append("</PayPlatRequestParameter>");
        //    }
        //    return ResponseMsg.ToString();
        //}

        if (CommonUtility.IsEmpty(Phone))
        {
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "996");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "Phone不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "996");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "Phone不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }


        if (CommonUtility.IsEmpty(AuthenCode))
        {
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "996");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "AuthenCode不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "996");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "AuthenCode不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        if (String.IsNullOrEmpty(PassWord))
        {
            PassWord = "******";
        }

        #endregion
        try
        {
            String t_custid = PhoneBO.IsAuthenPhone(Phone, SPID, out ErrMsg);
            if (String.IsNullOrEmpty(t_custid))
            {
                ResponseMsg.Length = 0;
                if ("json".Equals(wt))
                {
                    ResponseMsg.Append("{");
                    ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "998");
                    ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "验证手机有误!手机未注册");
                    ResponseMsg.Append("}");
                }
                else
                {
                    ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                    ResponseMsg.Append("<PayPlatRequestParameter>");
                    ResponseMsg.Append("<PARAMETERS>");
                    ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "998");
                    ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "验证手机有误!手机未注册");
                    ResponseMsg.Append("</PARAMETERS>");
                    ResponseMsg.Append("</PayPlatRequestParameter>");
                }
                return(ResponseMsg.ToString());
            }

            //if (!CustID.Equals(t_custid))
            //{

            //    ResponseMsg.Length = 0;
            //    if ("json".Equals(wt))
            //    {
            //        ResponseMsg.Append("{");
            //        ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "993");
            //        ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "客户CustID和验证手机有误");
            //        ResponseMsg.Append("}");
            //    }
            //    else
            //    {
            //        ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            //        ResponseMsg.Append("<PayPlatRequestParameter>");
            //        ResponseMsg.Append("<PARAMETERS>");
            //        ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "993");
            //        ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "客户CustID和验证手机有误");
            //        ResponseMsg.Append("</PARAMETERS>");
            //        ResponseMsg.Append("</PayPlatRequestParameter>");
            //    }
            //    return ResponseMsg.ToString();
            //}

            //验证码校验
            Result = PhoneBO.SelSendSMSMassage(t_custid, Phone, AuthenCode, out ErrMsg);
            if (Result != 0)
            {
                //Result.ErrMsg = "验证码验证失败:" + Result.ErrMsg;
                //return Result;

                ResponseMsg.Length = 0;
                if ("json".Equals(wt))
                {
                    ResponseMsg.Append("{");
                    ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "992");
                    ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "验证码验证失败");
                    ResponseMsg.Append("}");
                }
                else
                {
                    ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                    ResponseMsg.Append("<PayPlatRequestParameter>");
                    ResponseMsg.Append("<PARAMETERS>");
                    ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "992");
                    ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "验证码验证失败");
                    ResponseMsg.Append("</PARAMETERS>");
                    ResponseMsg.Append("</PayPlatRequestParameter>");
                }
                return(ResponseMsg.ToString());
            }

            //修改密码
            Result             = PassWordBO.SetPassword(SPID, t_custid, PassWord, "2", "", out ErrMsg);
            ResponseMsg.Length = 0;
            if (Result == 0)
            {
                if ("json".Equals(wt))
                {
                    ResponseMsg.Append("{");
                    ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "0");
                    ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "密码重置成功!");
                    ResponseMsg.Append("}");
                }
                else
                {
                    ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                    ResponseMsg.Append("<PayPlatRequestParameter>");
                    ResponseMsg.Append("<PARAMETERS>");
                    ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "0");
                    ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "密码重置成功!");
                    ResponseMsg.Append("</PARAMETERS>");
                    ResponseMsg.Append("</PayPlatRequestParameter>");
                }
                return(ResponseMsg.ToString());
            }
            else
            {
                ResponseMsg.Length = 0;
                if ("json".Equals(wt))
                {
                    ResponseMsg.Append("{");
                    ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "-2508");
                    ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "密码重置失败");
                    ResponseMsg.Append("}");
                }
                else
                {
                    ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                    ResponseMsg.Append("<PayPlatRequestParameter>");
                    ResponseMsg.Append("<PARAMETERS>");
                    ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "-2508");
                    ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "密码重置失败");
                    ResponseMsg.Append("</PARAMETERS>");
                    ResponseMsg.Append("</PayPlatRequestParameter>");
                }
                return(ResponseMsg.ToString());
            }
        }
        catch (Exception exp)
        {
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "-2508");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "密码重置失败" + exp.ToString());
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "-2508");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "密码重置失败" + exp.ToString());
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        return(ResponseMsg.ToString());
    }
コード例 #25
0
    protected void register_Click(object sender, EventArgs e)
    {
        StringBuilder strLog = new StringBuilder();

        try
        {
            logger.Info("RegisterAllInOne-注册来源:" + HttpContext.Current.Request.RawUrl);
            Response.AddHeader("P3P", "CP=CAO PSA OUR");
            strLog.AppendFormat("----------------------注册事件开始:------------------\r\n");
            strLog.AppendFormat("SPID:{0}\r\n", SPID);
            strLog.AppendFormat("ReturnUrl:{0}\r\n", ReturnUrl);
            PassWord = Request.Form["password"].ToString().Trim();
            strLog.AppendFormat("PassWord:{0}\r\n", PassWord);
            Mobile = Request.Form["mobile"].ToString().Trim();
            strLog.AppendFormat("mobile:{0}\r\n", Mobile);
            CheckPhoneCode = Request.Form["checkCode"].ToString().Trim();
            strLog.AppendFormat("checkCode:{0}\r\n", CheckPhoneCode);
            Email    = Request.Form["email"].ToString().Trim();
            UserName = Request.Form["userName"].ToString().Trim();

            strLog.AppendFormat("ViewState[phonestate]:{0}\r\n", ViewState["phonestate"]);
            strLog.AppendFormat("Request.Form[phonestate]:{0}\r\n", Request.Form["phonestate"]);
            if (ViewState["phonestate"] == null)
            {
                ViewState["phonestate"] = Request.Form["phonestate"].ToString();
                string a = (string)ViewState["phonestate"];
            }

            if (((string)ViewState["phonestate"]).Equals("0"))
            {
                strLog.AppendFormat("phonestate==0\r\n");
                //判断手机验证码
                string needCheckCode = "0";  //ConfigurationManager.AppSettings["needCheckCode"];
                strLog.AppendFormat("判断手机验证码\r\n");
                //strLog.AppendFormat("needCheckCode:{0}\r\n}", needCheckCode);
                if ("0".Equals(needCheckCode))
                {
                    //strLog.AppendFormat("needCheckCode==0");
                    Result = PhoneBO.SelSendSMSMassage("", Mobile, CheckPhoneCode, out ErrMsg);
                    if (Result != 0)
                    {
                        strLog.AppendFormat("手机验证码验证错误\r\n");
                        hintCode.InnerHtml = "手机验证码错误,请重新输入";  // 这里如何控制样式
                        return;
                    }
                    strLog.AppendFormat("手机验证码验证无误\r\n");
                }
                //strLog.AppendFormat("does not needCheckCode:{0}\r\n}", needCheckCode);
            }
            //strLog.AppendFormat("phonestate!=0 \r\n");
            strLog.AppendFormat("-----------------quickUserRegistryWeb  begin------------------\r\n");
            Result = UserRegistry.quickUserRegistryWebV3(SPID, PassWord, Mobile, (string)ViewState["phonestate"], UserName, Email, out CustID, out ErrMsg);
            if (Result != 0)
            {
                strLog.AppendFormat("注册失败!\r\n");
                CommonBizRules.ErrorHappenedRedircet(Result, ErrMsg, "用户注册", this.Context);
                return;
            }

            strLog.AppendFormat("注册成功!\r\n");
            //短信通知
            // string VoicePwdSPID = System.Configuration.ConfigurationManager.AppSettings["VoicePwd_SPID"];
            // int SIP1 = VoicePwdSPID.IndexOf(SPID);
            String SMS_Message = String.Empty;
            // if (SIP1 >= 0)
            //  {
            SMS_Message = "恭喜您成为号码百事通会员!请妥善保管您的密码;如需帮助请联系:4008-118114。";
            //通知短信网关
            //CommonBizRules.SendMessageV3(Mobile, SMS_Message, SPID);   //2013-11-19 注释掉
            //   }

            strLog.AppendFormat("检查邮箱是否需要发送\r\n");
            if (!String.IsNullOrEmpty(Email))
            {
                SendEmail(CustID, Email);
            }

            strLog.AppendFormat("写Cookie\r\n");
            String        TimeStamp             = DateTime.Now.ToString("yyyy-MM-dd HH:ta:ss");
            SPInfoManager spInfo                = new SPInfoManager();
            Object        SPData                = spInfo.GetSPData(this.Context, "SPData");
            String        key                   = spInfo.GetPropertyBySPID("35000000", "SecretKey", SPData);
            String        Digest                = CryptographyUtil.GenerateAuthenticator(TimeStamp + "$" + CustID + "$" + Result + "$" + ErrMsg, key);
            String        temp                  = SPID + "$" + CryptographyUtil.Encrypt(TimeStamp + "$" + CustID + "$" + Result + "$" + ErrMsg + "$" + Digest, key);
            String        RegistryResponseValue = HttpUtility.UrlEncode(temp);

            //给用户写cookie
            UserToken UT             = new UserToken();
            String    RealName       = Mobile;
            String    NickName       = Mobile;
            string    UserTokenValue = UT.GenerateUserToken(CustID, RealName, UserName, NickName, "", "42", UserName, "1", key, out ErrMsg);
            string    CookieName     = System.Configuration.ConfigurationManager.AppSettings["CookieName"];
            PageUtility.SetCookie(UserTokenValue, CookieName, this.Page);
            //通知积分平台
            //strLog.AppendFormat("通知积分平台,CustID:{0}\r\n", CustID);

            CIP2BizRules.InsertCustInfoNotify(CustID, "2", SPID, "", "0", out ErrMsg);
            strLog.AppendFormat("写入数据库日志\r\n");
            //记登录日志
            CommonBizRules.WriteDataCustAuthenLog(SPID, CustID, "35", "0", "", "2", Result, ErrMsg);
            strLog.AppendFormat("-----------------quickUserRegistryWeb  end------------------\r\n");

            strLog.AppendFormat("是否开户\r\n");
            strLog.AppendFormat("--------------------openBestToneAccount begin------------------------\r\n");
            String hid_openAccount = Request.Form["hid_openAccount"].ToString().Trim();
            //strLog.AppendFormat("hid_openAccount:{0}\r\n", hid_openAccount);
            if ("1".Equals(hid_openAccount))
            {
                strLog.AppendFormat("hid_openAccount==1 需要开户\r\n");
                // 开户要做的事情  需要前面注册获得的custID
                string BindedBestpayAccount = "";
                string CreateTime           = "";
                strLog.AppendFormat("先查看该CustID:{0}头上是否有账户\r\n", CustID);
                int IsBesttoneAccountBindV5Result = CIP2BizRules.IsBesttoneAccountBindV5(CustID, out BindedBestpayAccount, out CreateTime, out ErrMsg);
                //strLog.AppendFormat("查看结果:IsBesttoneAccountBindV5Result:{0},BindedBestpayAccount:{1},CreateTime:{2},ErrMsg:{3}\r\n", IsBesttoneAccountBindV5Result, BindedBestpayAccount, CreateTime, ErrMsg);
                if (IsBesttoneAccountBindV5Result == 0)
                {
                    //strLog.AppendFormat("IsBesttoneAccountBindV5Result==0,该CustID:{0}头上有账户BindedBestpayAccount:{1}\r\n", CustID, BindedBestpayAccount);
                    Response.Redirect("ErrorInfo.aspx?ErrorInfo=该账户绑定关系未解除,请联系管理人员!");
                }
                strLog.AppendFormat("该CustID:{0}头上无绑定账户\r\n", CustID);
                String      TransactionID = BesttoneAccountHelper.CreateTransactionID();
                AccountItem ai            = new AccountItem();
                string      ResponseCode  = "";
                BestToneAccount = Request.Form["mobile"].ToString().Trim();
                //strLog.AppendFormat("开户账号:{0}\r\n", BestToneAccount);
                realName = Request.Form["realName"].ToString().Trim();
                //strLog.AppendFormat("realName:{0}\r\n", realName);
                certnum = Request.Form["certnum"].ToString().Trim();
                //strLog.AppendFormat("certnum:{0}\r\n", certnum);
                strLog.AppendFormat("去翼支付查看该账号是否已经存在\r\n");
                int QueryBesttoneAccountResult = BesttoneAccountHelper.BesttoneAccountInfoQuery(BestToneAccount, out ai, out ResponseCode, out ErrMsg);
                //strLog.AppendFormat("查看结果 QueryBesttoneAccountResult:{0},ResponseCode:{1},ErrMsg:{2}\r\n", QueryBesttoneAccountResult, ResponseCode, ErrMsg);
                if (QueryBesttoneAccountResult == 0)
                {
                    if ("200010".Equals(ResponseCode))   // 未开户
                    {
                        strLog.AppendFormat("200010-未开户\r\n");
                        strLog.AppendFormat("准备开户\r\n");
                        //strLog.AppendFormat("开户前日志参数:SPID:{0},TransactionID:{1},CustID:{2},BestToneAccount:{3}\r\n", SPID, TransactionID, BestToneAccount);
                        UserRegistry.BeforeCreateBesttoneAccount(SPID, TransactionID, CustID, BestToneAccount, out ErrMsg);
                        //strLog.AppendFormat("日志结果 ErrMsg:{0} \r\n", ErrMsg);
                        strLog.AppendFormat("开户...\r\n");

                        Result = BesttoneAccountHelper.RegisterBesttoneAccount(BestToneAccount, realName, BestToneAccount, "", sex, "1", certnum, TransactionID, out ErrMsg);
                        //strLog.AppendFormat("开户结果:Result:{0},ErrMsg:{1},TransactionID:{2}\r\n", Result, ErrMsg, TransactionID);
                        if (Result == 0)
                        {
                            //strLog.AppendFormat("开户成功\r\n,准备去将账户{0}绑定到{1}上\r\n", BestToneAccount, CustID);
                            int BindResult = UserRegistry.CreateBesttoneAccount(SPID, CustID, BestToneAccount, out ErrMsg);
                            //strLog.AppendFormat("绑定结果:BindResult:{0},ErrMsg:{1}上\r\n", BindResult, ErrMsg);
                            if (BindResult == 0)
                            {
                                strLog.AppendFormat("开户后日志\r\n");
                                UserRegistry.AfterCreateBesttoneAccount(SPID, TransactionID, CustID, BestToneAccount, out ErrMsg);
                                int retWriteBack = UserRegistry.WriteBackBestToneAccountToCustInfo(SPID, CustID, realName, certnum, out ErrMsg);
                                //strLog.AppendFormat("开户后日志结果:ErrMsg:{0}\r\n", ErrMsg);
                                Response.Redirect("NewOpenAccountResult.aspx?SPTokenRequest=" + HttpUtility.UrlEncode(SPTokenRequest) + "&CreateBesttoneAccountResult=0&RegistryResponse=" + HttpUtility.UrlEncode(RegistryResponseValue), true);
                            }
                            else
                            {
                                Response.Redirect("ErrorInfo.aspx?ErrorInfo=" + ErrMsg);
                            }
                        }
                        else
                        {
                            Response.Redirect("ErrorInfo.aspx?ErrorInfo=" + ErrMsg);
                        }
                    }
                    else
                    {
                        // 账户已存在
                        strLog.AppendFormat("账户已经存在\r\n");
                        strLog.AppendFormat("仅仅做绑定\r\n");
                        UserRegistry.OnlyBindingBesttoneAccount(SPID, TransactionID, CustID, BestToneAccount, out ErrMsg);

                        int BindResult = UserRegistry.CreateBesttoneAccount(SPID, CustID, BestToneAccount, out ErrMsg);
                        //strLog.AppendFormat("绑定结果:ErrMsg:{0}\r\n", ErrMsg);
                        if (BindResult == 0)
                        {
                            UserRegistry.AfterCreateBesttoneAccount(SPID, TransactionID, CustID, BestToneAccount, out ErrMsg);
                            int retWriteBack = UserRegistry.WriteBackBestToneAccountToCustInfo(SPID, CustID, realName, certnum, out ErrMsg);
                            Response.Redirect("NewOpenAccountResult.aspx?SPTokenRequest=" + HttpUtility.UrlEncode(SPTokenRequest) + "&CreateBesttoneAccountResult=0&RegistryResponse=" + HttpUtility.UrlEncode(RegistryResponseValue), true);
                        }
                        else
                        {
                            Response.Redirect("ErrorInfo.aspx?ErrorInfo=" + ErrMsg);
                        }
                    }
                }
                else
                {
                    Response.Redirect("ErrorInfo.aspx?ErrorInfo=" + ErrMsg);
                }
            }
            //不需要开户
            //这里应该先到一个结果页面,并将ReturnUrl传给结果页面,结果页面倒计时3秒后自动跳转到ReturnUrl,根据注册和开户跳转到不同的结果页面
            if (ReturnUrl.IndexOf("?") > 0)
            {
                Response.Redirect(ReturnUrl + "&RegistryResponse=" + RegistryResponseValue, false);
            }
            else
            {
                Response.Redirect(ReturnUrl + "?RegistryResponse=" + RegistryResponseValue, false);
            }
        }
        catch (Exception ex)
        {
            strLog.AppendFormat(ex.ToString());
            Response.Redirect("ErrorInfo.aspx?ErrorInfo=" + ex.ToString());
        }
        finally
        {
            log(strLog.ToString());
        }
    }
コード例 #26
0
    public String ResetPayPassWord(String SPID, String CustID, String wt)
    {
        StringBuilder ResponseMsg = new StringBuilder();

        Int32  Result = ErrorDefinition.CIP_IError_Result_UnknowError_Code;
        String ErrMsg = ErrorDefinition.CIP_IError_Result_UnknowError_Msg;

        #region

        if (CommonUtility.IsEmpty(SPID))
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "995");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "SPID不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "995");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "SPID不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }


        if (CommonUtility.IsEmpty(CustID))
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "996");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "CustID不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "996");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "CustID不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        String             Phone   = String.Empty;
        BesttoneAccount    account = null;
        BesttoneAccountDAO dao     = new BesttoneAccountDAO();
        account = dao.QueryByCustID(CustID);
        if (account != null)
        {
            Phone = account.BestPayAccount;
        }
        else
        {
            //未开户
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "997");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "该CustID尚未开户!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "997");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "该CustID尚未开户!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }



        ////////验证码校验
        //////Result = PhoneBO.SelSendSMSMassage(CustID, Phone, AuthenCode, out ErrMsg);
        //////if (Result != 0)
        //////{
        //////    // 验证码未校验通过  return
        //////    ResponseMsg.Length = 0;
        //////    if ("json".Equals(wt))
        //////    {
        //////        ResponseMsg.Append("{");
        //////        ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "1000");
        //////        ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "验证码未校验通过!");
        //////        ResponseMsg.Append("}");
        //////    }
        //////    else
        //////    {
        //////        ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
        //////        ResponseMsg.Append("<PayPlatRequestParameter>");
        //////        ResponseMsg.Append("<PARAMETERS>");
        //////        ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "1000");
        //////        ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "验证码未校验通过!");
        //////        ResponseMsg.Append("</PARAMETERS>");
        //////        ResponseMsg.Append("</PayPlatRequestParameter>");
        //////    }
        //////    return ResponseMsg.ToString();
        //////}

        String t_custid = PhoneBO.IsAuthenPhone(Phone, SPID, out ErrMsg);
        // t_custid 可以为空,但不能是别人的custid,可以为空是说明此客户无认证电话
        if (!String.IsNullOrEmpty(t_custid))
        {
            if (CustID != t_custid)
            {
                //是别人的手机号,不能用来开户  return
                ResponseMsg.Length = 0;
                if ("json".Equals(wt))
                {
                    ResponseMsg.Append("{");
                    ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "1000");
                    ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", Phone + "(" + CustID + ")是别人的手机号(" + t_custid + "),不能用来开户!");
                    ResponseMsg.Append("}");
                }
                else
                {
                    ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                    ResponseMsg.Append("<PayPlatRequestParameter>");
                    ResponseMsg.Append("<PARAMETERS>");
                    ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "1000");
                    ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "是别人的手机号,不能用来开户!");
                    ResponseMsg.Append("</PARAMETERS>");
                    ResponseMsg.Append("</PayPlatRequestParameter>");
                }
                return(ResponseMsg.ToString());
            }
        }

        #endregion


        try
        {
            Linkage.BestTone.Interface.Rule.CustInfo custInfo = new Linkage.BestTone.Interface.Rule.CustInfo();
            int QueryCustInfoResult = QueryCustInfo(account.BestPayAccount, out custInfo, out ErrMsg);
            if (QueryCustInfoResult == 0)
            {
                Result = ResetBesttoneAccountPayPassword(account.BestPayAccount, custInfo.IdType, custInfo.IdNo, custInfo.CustomerName, out ErrMsg);
                if (Result == 0)
                {
                    ResponseMsg.Length = 0;
                    if ("json".Equals(wt))
                    {
                        ResponseMsg.Append("{");
                        ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "0");
                        ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "密码重置成功!");
                        ResponseMsg.Append("}");
                    }
                    else
                    {
                        ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                        ResponseMsg.Append("<PayPlatRequestParameter>");
                        ResponseMsg.Append("<PARAMETERS>");
                        ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "0");
                        ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "密码重置成功!");
                        ResponseMsg.Append("</PARAMETERS>");
                        ResponseMsg.Append("</PayPlatRequestParameter>");
                    }
                    return(ResponseMsg.ToString());
                }
                else
                {
                    //ReturnCode = Convert.ToString(ErrorDefinition.BT_IError_Result_BizInterfaceLimit_Code);
                    //Descriptioin = "重置密码失败!";  失败  return
                    ResponseMsg.Length = 0;
                    if ("json".Equals(wt))
                    {
                        ResponseMsg.Append("{");
                        ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "910");
                        ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "密码重置失败!");
                        ResponseMsg.Append("}");
                    }
                    else
                    {
                        ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                        ResponseMsg.Append("<PayPlatRequestParameter>");
                        ResponseMsg.Append("<PARAMETERS>");
                        ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "910");
                        ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "密码重置失败!");
                        ResponseMsg.Append("</PARAMETERS>");
                        ResponseMsg.Append("</PayPlatRequestParameter>");
                    }
                    return(ResponseMsg.ToString());
                }
            }
            else
            {
                ResponseMsg.Length = 0;
                if ("json".Equals(wt))
                {
                    ResponseMsg.Append("{");
                    ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "920");
                    ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "无此账户!");
                    ResponseMsg.Append("}");
                }
                else
                {
                    ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                    ResponseMsg.Append("<PayPlatRequestParameter>");
                    ResponseMsg.Append("<PARAMETERS>");
                    ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "920");
                    ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "无此账户!");
                    ResponseMsg.Append("</PARAMETERS>");
                    ResponseMsg.Append("</PayPlatRequestParameter>");
                }
                return(ResponseMsg.ToString());
            }
        }
        catch (Exception ecp)
        {
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "930");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", ecp.ToString());
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "930");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", ecp.ToString());
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }
        return(ResponseMsg.ToString());
    }
コード例 #27
0
ファイル: Register.aspx.cs プロジェクト: qinains/lihongtu
    protected void btn_OK_Click(object sender, EventArgs e)
    {
        if (CertificateType.Value != "")
        {
            certno.Style.Value  = "display:block";
            certnoL.Style.Value = "display:block";
        }
        else
        {
            certno.Style.Value  = "display:none";
            certnoL.Style.Value = "display:none";
        }
        this.areaInfoList.Value = resulttxt.Value.ToString();
        SPID      = Request["SPID"] == null ? ConstHelper.DefaultInstance.BesttoneSPID : HttpUtility.HtmlDecode(Request["SPID"]);
        ReturnUrl = Request["ReturnUrl"] == null ? ConstHelper.DefaultInstance.BesttoneLoginPage : HttpUtility.HtmlDecode(Request["ReturnUrl"]);

        string username = Request.Form["username"].ToString().Trim();
        string fullname = Request.Form["fullname"].ToString().Trim();
        string password = Request.Form["password"].ToString().Trim();

        if (CommonUtility.IsEmpty(password))
        {
            err_password.InnerHtml = "密码不能为空格";
            return;
        }
        string telephone = Request.Form["telephone"].ToString().Trim();
        string phonecode = Request.Form["phone_code"].ToString().Trim();

        if (ViewState["phonestate"] == null)
        {
            ViewState["phonestate"] = Request.Form["phonestate"].ToString();
            string a = (string)ViewState["phonestate"];
        }

        string email            = Request.Form["email"].ToString().Trim();
        string NickName         = Request.Form["NickName"].ToString();
        string CertificateType1 = Request.Form["CertificateType"].ToString();
        string certnoS          = Request.Form["certno"].ToString().Trim();
        string sex         = Request.Form["sex"].ToString();
        string birthday    = Request.Form["birthday"].ToString().Trim();
        string EduLevel    = Request.Form["EduLevel"].ToString().Trim();
        string IncomeLevel = Request.Form["IncomeLevel"].ToString();
        string Province    = stext.Value.ToString();
        string Area        = resulttxt.Value.ToString();
        string ErrMsg      = "";
        int    Result;

        //判断用户名是否存在
        if (CustBasicInfo.IsExistUser(username) != 0)
        {
            err_username.InnerHtml = "该用户名已经存在";

            return;
        }


        if (((string)ViewState["phonestate"]).Equals("0"))
        {
            //判断手机验证码
            Result = PhoneBO.SelSendSMSMassage("", telephone, phonecode, out ErrMsg);
            if (Result != 0)
            {
                err_phone_code.InnerHtml = "手机验证码错误,请重新输入";

                return;
            }

            //判断页面验证码
            if (!CommonUtility.ValidateValidateCode(HttpUtility.HtmlDecode(Request.Form["page_code"].ToString().Trim().ToUpper()), this.Context))
            {
                err_page_code.InnerHtml = "页面验证码错误,请重新输入";

                return;
            }
        }

        //当为认证邮箱时,判断是否已经被绑定
        if (Chk_Mail.Checked && !CommonUtility.IsEmpty(email))
        {
            Result = SetMail.EmailSel("", email, SPID, out ErrMsg);
            if (Result != 0)
            {
                err_email.InnerHtml = "该邮箱已经被其他用户绑定";

                return;
            }
            emailstate = "0";
        }

        TimeStamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        Result    = UserRegistry.getUserRegistryWeb(SPID, username, fullname, password, telephone, (string)ViewState["phonestate"], email, emailstate,
                                                    NickName, CertificateType1, certnoS, sex, birthday, EduLevel, IncomeLevel, Province, Area, out CustID, out ErrMsg);
        if (Result != 0)
        {
            //跳转至错误页面
            if (Result == -30002)
            {
                Err_certno.InnerHtml = ErrMsg;
            }
            else
            {
                CommonBizRules.ErrorHappenedRedircet(Result, ErrMsg, "用户注册", this.Context);
            }

            return;
        }

        SPInfoManager spInfo = new SPInfoManager();
        Object        SPData = spInfo.GetSPData(this.Context, "SPData");
        string        key    = spInfo.GetPropertyBySPID(SPID, "SecretKey", SPData);
        string        Digest = CryptographyUtil.GenerateAuthenticator(TimeStamp + "$" + CustID + "$" + Result + "$" + ErrMsg, key);
        string        temp   = SPID + "$" + CryptographyUtil.Encrypt(TimeStamp + "$" + CustID + "$" + Result + "$" + ErrMsg + "$" + Digest, key);
        string        RegistryResponseValue = HttpUtility.UrlEncode(temp);

        //给用户写cookie
        UserToken UT             = new UserToken();
        string    key2           = spInfo.GetPropertyBySPID("35000000", "SecretKey", SPData);
        string    UserTokenValue = UT.GenerateUserToken(CustID, fullname, username, NickName, "", "42", username, "1", key2, out ErrMsg);
        string    CookieName     = System.Configuration.ConfigurationManager.AppSettings["CookieName"];

        PageUtility.SetCookie(UserTokenValue, CookieName, this.Page);

        //给客户认证邮箱发EMAIL
        string m   = CommonBizRules.EncryptEmailURl(CustID, email, this.Context);
        string url = "点击完成认证:<a href='" + m + "'>" + m + "</a>";

        if (Chk_Mail.Checked && !CommonUtility.IsEmpty(email))
        {
            DateTime datetime = DateTime.Now;
            SetMail.InsertEmailSendMassage(CustID, "1", url, "", 1, email, datetime, "", "中国电信号码百事通:激活邮箱", 0, out ErrMsg);
        }

        //通知积分平台
        CIP2BizRules.InsertCustInfoNotify(CustID, "2", SPID, "", "0", out ErrMsg);
        //记登录日志
        CommonBizRules.WriteDataCustAuthenLog(SPID, CustID, "35", "0", "", "2", Result, ErrMsg);

        //跳转至成功页面
        if (ReturnUrl.IndexOf("?") > 0)
        {
            CommonBizRules.SuccessRedirect(ReturnUrl + "&RegistryResponse=" + RegistryResponseValue, "成功注册", this.Context);
        }
        else
        {
            CommonBizRules.SuccessRedirect(ReturnUrl + "?RegistryResponse=" + RegistryResponseValue, "成功注册", this.Context);
        }
    }
コード例 #28
0
    public String SetAuthenPhone(String SPID, String CustID, String Phone, String AuthenCode)
    {
        StringBuilder ResponseMsg = new StringBuilder();

        #region

        if (CommonUtility.IsEmpty(SPID))
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "995");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "SPID不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "995");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "SPID不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        if (CommonUtility.IsEmpty(CustID))
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "996");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "CustID不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "996");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "CustID不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        if (CommonUtility.IsEmpty(Phone))
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "997");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "Phone不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "997");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "Phone不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        if (CommonUtility.IsEmpty(AuthenCode))
        {
            // 返回错误信息
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "998");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "AuthenCode不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "998");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "AuthenCode不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }
        #endregion

        try
        {
            String msg    = String.Empty;
            int    Result = PhoneBO.SelSendSMSMassage(CustID, Phone, AuthenCode, out msg); // 校验手机验证码
            if (Result == 0)
            {
                Result = PhoneBO.PhoneSetV2(SPID, CustID, Phone, "2", "2", out msg);
            }
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", Result);
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", msg);
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", Result);
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", msg);
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }
        catch (Exception ecp)
        {
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "-1000");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", ecp.ToString());
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "-1000");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", ecp.ToString());
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }
    }
コード例 #29
0
    protected void RestPasswordByPhoneBtn_Click(object sender, ImageClickEventArgs e)
    {
        SPID = Request["SPID"] == null ? String.Empty : Request["SPID"].ToString();

        if ("35433334".Equals(SPID))
        {
            ReturnUrl = "http://www.114yg.cn/userCenterAction.do?actions=intoUserLogin";
        }
        else
        {
            ReturnUrl = "http://sso.118114.cn/SSO/loginV2.action";
        }
        this.hdReturnUrl.Value = ReturnUrl;
        AuthenPhone            = Request["AuthenPhone"];
        SmsAuthenCode          = Request["AuthenCode"];
        if (!String.IsNullOrEmpty(AuthenPhone))
        {
            this.hdAuthenPhone.Value = AuthenPhone;
        }
        if (!String.IsNullOrEmpty(SmsAuthenCode))
        {
            this.hdAuthenCode.Value = SmsAuthenCode;
        }


        AuthenPhone   = this.hdAuthenPhone.Value;
        SmsAuthenCode = this.hdAuthenCode.Value;
        ReturnUrl     = this.hdReturnUrl.Value;
        String        CustID = "";
        StringBuilder sbLog  = new StringBuilder();

        sbLog.AppendFormat("AuthenPhone:{0}\r\n", AuthenPhone);
        sbLog.AppendFormat("SmsAuthenCode:{0}\r\n", SmsAuthenCode);
        try
        {
            CustID = PhoneBO.IsAuthenPhone(AuthenPhone, SPID, out ErrMsg);
            sbLog.AppendFormat("CustID:{0}\r\n", CustID);
            sbLog.AppendFormat("ErrMsg:{0}\r\n", ErrMsg);
            if (!String.IsNullOrEmpty(CustID))
            {
                Result = PhoneBO.SelSendSMSMassage(CustID, AuthenPhone, SmsAuthenCode, out ErrMsg);
                sbLog.AppendFormat("SelSendSMSMassage:Result:{0}-{1}\r\n", Result, ErrMsg);
                if (Result == 0)
                {
                    Response.Redirect("ResetPwdByPhone.aspx?UrlParam=" + CustID + "$2$" + ReturnUrl, false);
                }
                else
                {
                    CommonBizRules.SuccessRedirect("../ErrorInfo.aspx", "找回密码失败:" + ErrMsg, HttpContext.Current);
                }
            }
            else
            {
                CommonBizRules.SuccessRedirect("../ErrorInfo.aspx", "该手机号码不是认证手机,找回密码失败:" + ErrMsg, HttpContext.Current);
            }
        }
        catch (Exception ex)
        {
            sbLog.AppendFormat("异常:{0}\r\n", ex.Message);
        }
        finally
        {
            log(sbLog.ToString());
        }
    }
コード例 #30
0
    /// <summary>
    /// 作者:李宏图
    /// 日期:2014年01月08日
    /// </summary>
    public String selMobile(String SPID, String CustID, String Phone)
    {
        StringBuilder ResponseMsg = new StringBuilder();

        if (CommonUtility.IsEmpty(SPID))
        {
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "995");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "SPID不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "995");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "SPID不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        if (CommonUtility.IsEmpty(Phone))
        {
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "996");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "Phone不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "996");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "Phone不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }

        if (CommonUtility.IsEmpty(CustID))
        {
            ResponseMsg.Length = 0;
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "997");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "CustID不能为空!");
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "997");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "CustID不能为空!");
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }


        try
        {
            CustID = HttpUtility.HtmlDecode(Request.QueryString["CustID"]);
            Phone  = HttpUtility.HtmlDecode(Request.QueryString["Phone"]);                     // 手机号码
            SPID   = HttpUtility.HtmlDecode(Request.QueryString["SPID"]);
            int count = Convert.ToInt32(HttpUtility.HtmlDecode(Request.QueryString["count"])); // 发送次数



            ErrMsg = String.Empty;
            Result = PhoneBO.PhoneSel(CustID, Phone, out ErrMsg);    // 验证电话是否可以做认证电话(这里的电话包括手机和电话)
            // 0 代表可以做认证电话 否则 不可以
            if (Result == 0)
            {
                Random random     = new Random();
                string AuthenCode = random.Next(111111, 999999).ToString();
                CommonBizRules.SendMessageV3(Phone, "您在通过客户端绑定认证手机,验证码是:" + AuthenCode, SPID);
                int y = PhoneBO.InsertPhoneSendMassage(CustID, "您在通过客户端绑定认证手机,验证码是:", AuthenCode, Phone, DateTime.Now, "描述未知", count, 0, "1", out ErrMsg);
                ResponseMsg.Length = 0;
                if ("json".Equals(wt))
                {
                    ResponseMsg.Append("{");
                    ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "0");
                    ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "您的验证码是:" + AuthenCode);
                    ResponseMsg.Append("}");
                }
                else
                {
                    ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                    ResponseMsg.Append("<PayPlatRequestParameter>");
                    ResponseMsg.Append("<PARAMETERS>");
                    ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "0");
                    ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "您的验证码是:" + AuthenCode);
                    ResponseMsg.Append("</PARAMETERS>");
                    ResponseMsg.Append("</PayPlatRequestParameter>");
                }
                return(ResponseMsg.ToString());
            }
            else
            {
                ResponseMsg.Length = 0;
                if ("json".Equals(wt))
                {
                    ResponseMsg.Append("{");
                    ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", Result);
                    ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", ErrMsg);
                    ResponseMsg.Append("}");
                }
                else
                {
                    ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                    ResponseMsg.Append("<PayPlatRequestParameter>");
                    ResponseMsg.Append("<PARAMETERS>");
                    ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", Result);
                    ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", ErrMsg);
                    ResponseMsg.Append("</PARAMETERS>");
                    ResponseMsg.Append("</PayPlatRequestParameter>");
                }
                return(ResponseMsg.ToString());
            }
        }
        catch (Exception exp)
        {
            if ("json".Equals(wt))
            {
                ResponseMsg.Append("{");
                ResponseMsg.AppendFormat("\"errcode\":\"{0}\",", "-25367");
                ResponseMsg.AppendFormat("\"errmsg\":\"{0}\"", "异常:" + exp.ToString());
                ResponseMsg.Append("}");
            }
            else
            {
                ResponseMsg.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                ResponseMsg.Append("<PayPlatRequestParameter>");
                ResponseMsg.Append("<PARAMETERS>");
                ResponseMsg.AppendFormat("<ErrCode>{0}</ErrCode>", "-25367");
                ResponseMsg.AppendFormat("<ErrMsg>{0}</ErrMsg>", "异常:" + exp.ToString());
                ResponseMsg.Append("</PARAMETERS>");
                ResponseMsg.Append("</PayPlatRequestParameter>");
            }
            return(ResponseMsg.ToString());
        }
        return(ResponseMsg.ToString());
    }