Esempio n. 1
0
        /// <summary>
        /// 根据省代码获取省的国标码
        /// </summary>
        public static string GetReginCodeByProvinceID(string ProvinceID, HttpContext context)
        {
            string Result = "";
            ProvinceInfoManager proInfo = new ProvinceInfoManager();
            Object ProvinceData         = proInfo.GetProvinceData(context);

            Result = proInfo.GetPropertyByProvinceID(ProvinceID, "RegionProvince", ProvinceData);
            return(Result);
        }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Top1.Welcome = "号码百事通用户注册";

        if (!Page.IsPostBack)
        {
            //地区联动--start
            ProvinceInfoManager proInfo = new ProvinceInfoManager();
            object ProData = proInfo.GetProvinceData(this.Context);
            DataSet ds = (DataSet)ProData;
            this.proInfoList.DataSource = ds;
            this.proInfoList.DataTextField = "ProvinceName";
            this.proInfoList.DataValueField = "ProvinceID";
            this.proInfoList.DataBind();

            ListItem li = new ListItem("请选择", "-999");
            proInfoList.Items.Add(li);
            proInfoList.SelectedIndex = proInfoList.Items.Count - 1;

            this.areaInfoList.Items.Add(li);
            areaInfoList.SelectedIndex = areaInfoList.Items.Count - 1;

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

        }

        if (proInfoList.SelectedIndex != proInfoList.Items.Count - 1)
        {
            PhoneAreaInfoManager areaInfo = new PhoneAreaInfoManager();
            object areaData = areaInfo.GetPhoneAreaData(this.Context, proInfoList.Value);
            PhoneAreaData pad = (PhoneAreaData)areaData;
            this.areaInfoList.DataSource = pad;
            this.areaInfoList.DataTextField = "AreaName";
            this.areaInfoList.DataValueField = "AreaID";
            this.areaInfoList.DataBind();
        }
        else
        {
            areaInfoList.Value = "请选择";
        }
    }
    public UserInfoQueryResult UserInfoQuery(string ProvinceID, string SPID, string UserAccount, string CustID, string PhoneNum, string TimeStamp)
    {
        UserInfoQueryResult Result = new UserInfoQueryResult();
        Result.ProvinceID = "35";
        Result.Result = ErrorDefinition.BT_IError_Result_UnknowError_Code;
        Result.ErrorDescription = "初始";
        Result.TimeStamp = CommonUtility.TimeStamp;
        Result.UserDetailInfo = null;
        Result.SubScriptionRecords = null;
        Result.ExtendField = "";

        try
        {

            if (CommonUtility.IsEmpty(ProvinceID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",不能为空";
                return Result;
            }

            if (ProvinceID.Length != ConstDefinition.Length_ProvinceID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",长度有误";
                return Result;
            }

            ProvinceInfoManager proObject = new ProvinceInfoManager();
            object proDataObject = proObject.GetProvinceData(this.Context);
            if (proObject.GetPropertyByProvinceID(ProvinceID, "ProvinceCode", proDataObject) == "")
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",无此省代码";
                return Result;
            }

            if (CommonUtility.IsEmpty(SPID))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",不能为空";
                return Result;
            }

            if (SPID.Length != ConstDefinition.Length_SPID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + "长度有误";
                return Result;
            }

            //IP是否允许访问
            Result.Result = CommonBizRules.CheckIPLimit(SPID, HttpContext.Current.Request.UserHostAddress, this.Context, out Result.ErrorDescription);
            if (Result.Result != 0)
            {
                return Result;
            }

            //接口访问权限判断
            Result.Result = CommonBizRules.CheckInterfaceLimit(SPID, "UserInfoQuery", this.Context, out Result.ErrorDescription);
            if (Result.Result != 0)
            {
                return Result;
            }

            if (!CommonUtility.IsEmpty(UserAccount))
            {
                if (UserAccount.Length < ConstDefinition.Length_Min_UserAccount)
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidUserAccount_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidUserAccount_Msg + ",长度有误";
                    return Result;
                }

                if (UserAccount.Length > ConstDefinition.Length_Max_UserAccount)
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidUserAccount_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidUserAccount_Msg + ",长度有误";
                    return Result;
                }
            }

            if (CommonUtility.IsEmpty(UserAccount) & CommonUtility.IsEmpty(CustID) & CommonUtility.IsEmpty(PhoneNum))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidParameter_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidParameter_Msg + ",关键信息不能全为空";
                return Result;
            }

            if (!CommonUtility.IsEmpty(PhoneNum))
            {
                string phone = "";
                if (!CommonBizRules.PhoneNumValid(this.Context, PhoneNum, out phone))
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidPhoneNum_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidPhoneNum_Msg;
                    return Result;
                }
                PhoneNum = phone;
            }

            Result.Result = UserInfoClass.UserInfoQuery(ProvinceID, SPID, UserAccount, CustID, PhoneNum, "", out Result.ErrorDescription, out Result.UserDetailInfo, out Result.SubScriptionRecords);
        }
        catch (Exception e)
        {
            Result.Result = ErrorDefinition.IError_Result_System_UnknowError_Code;
            Result.ErrorDescription = ErrorDefinition.IError_Result_System_UnknowError_Msg + e.Message;
        }
        finally
        {
            try
            {
                #region WriteLog

                StringBuilder msg = new StringBuilder();
                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n\r\n");
                msg.Append("用户信息查询接口 " + DateTime.Now.ToString("u") + "\r\n");
                msg.Append("ProvinceID - " + ProvinceID);
                msg.Append(";SPID - " + SPID);
                msg.Append(";UserAccount - " + UserAccount);
                msg.Append(";CustID - " + CustID);
                msg.Append(";PhoneNum - " + PhoneNum);
                msg.Append(";TimeStamp - " + TimeStamp + "\r\n");

                msg.Append("处理结果 - " + Result.Result);
                msg.Append("; 错误描述 - " + Result.ErrorDescription);
                msg.Append("; TimeStamp - " + Result.TimeStamp);
                msg.Append("; ExtendField - " + Result.ExtendField + "\r\n");
                //记录UserDetailInfo
                UserInfoClass.WriteLogForUserInfo(Result.UserDetailInfo, ref msg);

                if (Result.SubScriptionRecords != null)
                    if (Result.SubScriptionRecords.Length > 0)
                    {
                        msg.Append("SubScriptionRecords: \r\n");
                        for (int i = 0; i < Result.SubScriptionRecords.Length; i++)
                        {
                            msg.Append("CustID - " + Result.SubScriptionRecords[i].CustID);
                            msg.Append(";UserAccount - " + Result.SubScriptionRecords[i].UserAccount);
                            msg.Append(";SubscribeStyle - " + Result.SubScriptionRecords[i].SubscribeStyle);
                            msg.Append(";ServiceID - " + Result.SubScriptionRecords[i].ServiceID);
                            msg.Append(";ServiceName - " + Result.SubScriptionRecords[i].ServiceName);
                            msg.Append(";StartTime - " + Result.SubScriptionRecords[i].StartTime);
                            msg.Append(";EndTime - " + Result.SubScriptionRecords[i].EndTime);
                            msg.Append(";TransactionID - " + Result.SubScriptionRecords[i].TransactionID);

                            msg.Append("\r\n");
                        }
                    }
                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");

                BTUCenterInterfaceLog.CenterForBizTourLog("UserInfoQuery", msg);

                #endregion

                CommonBizRules.WriteDataLog(SPID, CustID, UserAccount, Result.Result,
                    Result.ErrorDescription, PhoneNum, "02");
            }
            catch { }

        }

        return Result;
    }
    public BasicInfoQueryResult BasicInfoQuery(string ProvinceID, string SPID, string TimeStamp, string UserAccount,
        string PhoneNum, string CertificateCode, string CertificateType, string RealName, string ExtendField)
    {
        BasicInfoQueryResult Result = new BasicInfoQueryResult();
        Result.Result = ErrorDefinition.BT_IError_Result_UnknowError_Code;
        Result.ProvinceID = "35";
        Result.ErrorDescription = "";
        Result.ExtendField = "";
        Result.UserBasicInfoRecords = null;

        try
        {
            if (CommonUtility.IsEmpty(ProvinceID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",不能为空";
                return Result;
            }

            if (ProvinceID.Length != ConstDefinition.Length_ProvinceID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",长度有误";
                return Result;
            }

            ProvinceInfoManager proObject = new ProvinceInfoManager();
            object proDataObject = proObject.GetProvinceData(this.Context);
            if (proObject.GetPropertyByProvinceID(ProvinceID, "ProvinceCode", proDataObject) == "")
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + "无该省代码";
                return Result;
            }

            if (CommonUtility.IsEmpty(SPID))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",不能为空";
                return Result;
            }

            if (SPID.Length != ConstDefinition.Length_SPID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",长度有误";
                return Result;
            }

            if (!CommonUtility.IsEmpty(UserAccount))
            {
                if (UserAccount.Length < ConstDefinition.Length_Min_UserAccount)
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidUserAccount_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidUserAccount_Msg + ",长度有误";
                    return Result;
                }

                if (UserAccount.Length > ConstDefinition.Length_Max_UserAccount)
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidUserAccount_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidUserAccount_Msg + ",长度有误";
                    return Result;
                }

            }

            if (!CommonUtility.IsEmpty(PhoneNum))
            {
                string phone = "";
                if (!CommonBizRules.PhoneNumValid(this.Context, PhoneNum, out phone))
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidPhoneNum_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidPhoneNum_Msg;
                    return Result;
                }
                PhoneNum = phone;
            }

            if (!CommonUtility.IsEmpty(CertificateType))
            {
                if (ConstDefinition.Span_CertificateType.IndexOf(CertificateType) < 0)
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidCertificateType_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidCertificateType_Msg + ",无此类型";
                    return Result;
                }

                if (CommonUtility.IsEmpty(CertificateCode))
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidCertificateCode_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidCertificateCode_Msg + ",不能为空";
                    return Result;
                }
            }

            if (CommonUtility.IsEmpty(UserAccount) & CommonUtility.IsEmpty(PhoneNum) & CommonUtility.IsEmpty(CertificateCode) & CommonUtility.IsEmpty(CertificateType) & CommonUtility.IsEmpty(RealName))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidParameter_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidParameter_Msg + ",关键信息不能全部为空";
                return Result;
            }

            Result.Result = BTBizRules.BasicInfoQuery(ProvinceID, SPID, UserAccount,
                 PhoneNum, CertificateCode, CertificateType, RealName, out Result.UserBasicInfoRecords, out Result.ErrorDescription);
        }
        catch (Exception e)
        {
            Result.Result = ErrorDefinition.IError_Result_System_UnknowError_Code;
            Result.ErrorDescription = ErrorDefinition.IError_Result_System_UnknowError_Msg + e.Message;
        }
        finally
        {
            try
            {
                #region WriteLog
                StringBuilder msg = new StringBuilder();
                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n\r\n");
                msg.Append("唯一性查询接口" + DateTime.Now.ToString("u") + "\r\n");
                msg.Append("ProvinceID - " + ProvinceID);
                msg.Append(";SPID - " + SPID);
                msg.Append(";UserAccount - " + UserAccount);
                msg.Append(";PhoneNum - " + PhoneNum);
                msg.Append(";CertificateCode - " + CertificateCode);
                msg.Append(";CertificateType - " + CertificateType);
                msg.Append(";ExtendField - " + ExtendField);
                msg.Append(";TimeStamp - " + TimeStamp + "\r\n");

                msg.Append("处理结果 - " + Result.Result);
                msg.Append("; 错误描述 - " + Result.ErrorDescription);
                msg.Append("; ProvinceID - " + Result.ProvinceID);
                msg.Append("; ExtendField - " + Result.ExtendField + "\r\n");
                if (Result.UserBasicInfoRecords != null)
                {
                    if (Result.UserBasicInfoRecords.Length > 0)
                    {
                        msg.Append("UserBasicInfoRecords: \r\n");
                        for (int i = 0; i < Result.UserBasicInfoRecords.Length; i++)
                        {
                            msg.Append("CertificateCode- " + Result.UserBasicInfoRecords[i].CertificateCode);
                            msg.Append(";CertificateType- " + Result.UserBasicInfoRecords[i].CertificateType);
                            msg.Append(";RealName- " + Result.UserBasicInfoRecords[i].RealName);
                            msg.Append(";UserAccount- " + Result.UserBasicInfoRecords[i].UserAccount);
                            if (Result.UserBasicInfoRecords[i].BoundPhoneRecords != null)
                            {
                                if (Result.UserBasicInfoRecords[i].BoundPhoneRecords.Length > 0)
                                {
                                    msg.Append("BoundPhoneRecords: ");
                                    for (int j = 0; j < Result.UserBasicInfoRecords[i].BoundPhoneRecords.Length; j++)
                                    {
                                        msg.Append(";Phone- " + Result.UserBasicInfoRecords[i].BoundPhoneRecords[j].Phone);
                                    }
                                }
                            }
                        }
                    }
                }
                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");

                BTUCenterInterfaceLog.CenterForBizTourLog("BasicInfoQuery", msg);
                #endregion

                CommonBizRules.WriteDataLog(SPID, "", UserAccount, Result.Result,
                    Result.ErrorDescription, PhoneNum, "BasicInfoQuery");
            }
            catch { }
        }

        return Result;
    }
    public UserInfoModifyResult UserInfoModify(string ProvinceID, string SPID, string TimeStamp, UserInfo UserDetailInfo)
    {
        //ProvinceID  请求的省份代码
        //SPID        请求发起方在认证鉴权系统登记的spid
        //TimeStamp   yyyy-MM-dd HH:m:ss 其中HH 取值为00-23,时区为东八区
        //UserDetailInfo 用户基本资料
        //注:不允许修改CustID,UserAccount,CertificateCode;若修改密码,则调用"用户密码重置接口"
        //;若修改绑定主叫号码,则调用"电话号码绑定接口"

        UserInfoModifyResult Result = new UserInfoModifyResult();

        Result.ProvinceID = "35";
        Result.Result = ErrorDefinition.BT_IError_Result_UnknowError_Code;
        Result.CustID = UserDetailInfo.CustID;
        Result.UserAccount = UserDetailInfo.UserAccount;
        Result.ErrorDescription = "初始";
        Result.ExtendField = "";

        #region 判断是否是特殊的SPID

        string OldSPID = System.Configuration.ConfigurationManager.AppSettings["OldType_SPID"];

        int SIP = OldSPID.IndexOf(SPID);

        if (SIP >= 0)
        {
            switch (UserDetailInfo.UserType)
            {
                case "01":
                    UserDetailInfo.UserType = "14";
                    break;
                case "02":
                    UserDetailInfo.UserType = "20";
                    break;
                case "03":
                    UserDetailInfo.UserType = "12";
                    break;
                case "09":
                    UserDetailInfo.UserType = "90";
                    break;
                case "11":
                    UserDetailInfo.UserType = "30";
                    break;
                case "00":
                    UserDetailInfo.UserType = "42";
                    break;
                default:
                    UserDetailInfo.UserType = "90";
                    break;
            }

        }

        #endregion

        UserInfoClass userObj = new UserInfoClass(UserDetailInfo);
        try
        {
            #region 数据校验
            if (CommonUtility.IsEmpty(ProvinceID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",不能为空";
                return Result;
            }

            if (ProvinceID.Length != ConstDefinition.Length_ProvinceID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",长度有误";
                return Result;
            }

            ProvinceInfoManager proObject = new ProvinceInfoManager();
            object proDataObject = proObject.GetProvinceData(this.Context);
            if (proObject.GetPropertyByProvinceID(ProvinceID, "ProvinceCode", proDataObject) == "")
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",无该省代码";
                return Result;
            }

            if (CommonUtility.IsEmpty(SPID))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",不能为空";
                return Result;
            }

            if (SPID.Length != ConstDefinition.Length_SPID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + "长度有误";
                return Result;
            }

            if (CommonUtility.IsEmpty(UserDetailInfo.CustID))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidCustID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidCustID_Msg + "不能为空";
                return Result;
            }

            if (CommonUtility.IsEmpty(UserDetailInfo.UserAccount))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidUserAccount_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidUserAccount_Msg + ",不能为空";
                return Result;
            }

            if (UserDetailInfo.UserAccount.Length < ConstDefinition.Length_Min_UserAccount)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidUserAccount_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidUserAccount_Msg + ",长度有误";
                return Result;
            }

            if (UserDetailInfo.UserAccount.Length > ConstDefinition.Length_Max_UserAccount)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidUserAccount_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidUserAccount_Msg + ",长度有误";
                return Result;
            }

            Result.Result = userObj.UserInfoCommonCheck(out Result.ErrorDescription, this.Context);
            if (Result.Result != 0)
                return Result;

            #endregion

            Result.Result = CommonBizRules.CheckIPLimit(SPID, HttpContext.Current.Request.UserHostAddress, this.Context, out Result.ErrorDescription);
            if (Result.Result != 0)
            {
                return Result;
            }

            //接口访问权限判断
            Result.Result = CommonBizRules.CheckInterfaceLimit(SPID, "UserInfoModify", this.Context, out Result.ErrorDescription);
            if (Result.Result != 0)
            {
                return Result;
            }
            Result.Result = userObj.ModifyUserInfo(SPID, out Result.ErrorDescription);
            //如果修改成功通知积分系统
            string ErrorMsg = "";
            if (Result.Result == 0)
                CIP2BizRules.InsertCustInfoNotify(UserDetailInfo.CustID, "2", SPID, "", "0", out ErrorMsg);
        }
        catch (Exception e)
        {
            Result.Result = ErrorDefinition.IError_Result_System_UnknowError_Code;
            Result.ErrorDescription = ErrorDefinition.IError_Result_System_UnknowError_Msg + e.Message;
        }
        finally
        {
            try
            {
                #region WriteLog
                StringBuilder msg = new StringBuilder();
                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n\r\n");
                msg.Append("用户信息修改接口 " + DateTime.Now.ToString("u") + "\r\n");
                msg.Append("ProvinceID - " + ProvinceID);
                msg.Append(";SPID - " + SPID);
                msg.Append(";TimeStamp - " + TimeStamp + "\r\n");

                //记录UserDetailInfo
                UserInfoClass.WriteLogForUserInfo(UserDetailInfo, ref msg);

                msg.Append("处理结果 - " + Result.Result);
                msg.Append("; 错误描述 - " + Result.ErrorDescription + "\r\n");
                msg.Append("ProvinceID - " + Result.ProvinceID);
                msg.Append("; UserAccount - " + Result.UserAccount);
                msg.Append("; CustID - " + Result.CustID);
                msg.Append("; ExtendField - " + Result.ExtendField + "\r\n");
                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");

                BTUCenterInterfaceLog.CenterForBizTourLog("ModifyUserInfo", msg);
                #endregion

                CommonBizRules.WriteDataLog(SPID, UserDetailInfo.CustID, UserDetailInfo.UserAccount, Result.Result,
                    Result.ErrorDescription, "", "UserInfoModify");
            }
            catch { }
        }

        return Result;
    }
    public UserAuthResult UserAuth(string ProvinceID, string SPID, string TimeStamp, string CustID, string UserAccount, string PhoneNum, string Password)
    {
        UserAuthResult Result = new UserAuthResult();
        Result.ErrorDescription = "初始";
        Result.ProvinceID = "35";
        Result.UserDetailInfo = null;
        Result.SubscriptionRecords = null;
        Result.ExtendField = "";

        Result.Result = CommonBizRules.CheckIPLimit(SPID, HttpContext.Current.Request.UserHostAddress, this.Context, out Result.ErrorDescription);
        if (Result.Result != 0)
        {
            return Result;
        }

        //接口访问权限判断
        Result.Result = CommonBizRules.CheckInterfaceLimit(SPID, "UserAuth", this.Context, out Result.ErrorDescription);
        if (Result.Result != 0)
        {
            return Result;
        }

        try
        {
            if (CommonUtility.IsEmpty(ProvinceID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",不能为空";
                return Result;
            }

            if (ProvinceID.Length != ConstDefinition.Length_ProvinceID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",长度有误";
                return Result;
            }

            ProvinceInfoManager proObject = new ProvinceInfoManager();
            object proDataObject = proObject.GetProvinceData(this.Context);
            if (proObject.GetPropertyByProvinceID(ProvinceID, "ProvinceCode", proDataObject) == "")
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + "无该省代码";
                return Result;
            }

            if (CommonUtility.IsEmpty(SPID))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",不能为空";
                return Result;
            }

            if (SPID.Length != ConstDefinition.Length_SPID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",长度有误";
                return Result;
            }

            if (!CommonUtility.IsEmpty(CustID))
            {
                if (CustID.Length != ConstDefinition.Length_CustID)
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidCustID_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidCustID_Msg + ",长度有误";
                    return Result;
                }
            }

            if (!CommonUtility.IsEmpty(UserAccount))
            {
                if (UserAccount.Length < ConstDefinition.Length_Min_UserAccount)
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidUserAccount_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidUserAccount_Msg + ",长度有误";
                    return Result;
                }

                if (UserAccount.Length > ConstDefinition.Length_Max_UserAccount)
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidUserAccount_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidUserAccount_Msg + ",长度有误";
                    return Result;
                }
            }

            if (!CommonUtility.IsEmpty(PhoneNum))
            {
                string phone = "";
                if (!CommonBizRules.PhoneNumValid(this.Context, PhoneNum, out phone))
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidPhoneNum_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidPhoneNum_Msg;
                    return Result;
                }
                PhoneNum = phone;
            }

            if (CommonUtility.IsEmpty(Password))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidPassword_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidPassword_Msg + ",不能为空";
                return Result;
            }

            string EncryptedPassword = CryptographyUtil.Encrypt(Password);
            string t_password = Password;
            Password = "";

            Result.Result = UserInfoClass.UserInfoQueryV2(ProvinceID, SPID, UserAccount, CustID, PhoneNum, Password, out Result.ErrorDescription, out Result.UserDetailInfo, out Result.SubscriptionRecords);

            StringBuilder msg = new StringBuilder();
            msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n\r\n");
            msg.Append("客户信息平台密码鉴权认证接口 " + DateTime.Now.ToString("u") + "\r\n");
            msg.Append(";SPID - " + SPID);
            msg.Append(";EncryptedPassword - " + EncryptedPassword);
            msg.Append("\r\n");
            msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");

            BTUCenterInterfaceLog.CenterForBizTourLog("UserAuth", msg);

            if (Result.UserDetailInfo != null)
            {
                Result.Result = UserInfoClass.ValidUserPassword(Result.UserDetailInfo.CustID, EncryptedPassword);
                if (Result.Result == 0)
                {
                    Result.ErrorDescription = "认证通过";
                }
                else
                {
                    Result.UserDetailInfo = new UserInfo();
                    Result.ErrorDescription = "认证未通过";
                }
            }
            else
            {
                Result.ErrorDescription = "无此用户";
            }
        }
        catch (Exception e)
        {
            Result.Result = ErrorDefinition.IError_Result_System_UnknowError_Code;
            Result.ErrorDescription = ErrorDefinition.IError_Result_System_UnknowError_Msg + e.Message;
        }
        finally
        {
            try
            {
                #region WriteLog
                StringBuilder msg = new StringBuilder();
                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n\r\n");
                msg.Append("密码认证鉴权接口 " + DateTime.Now.ToString("u") + "\r\n");
                msg.Append("ProvinceID - " + ProvinceID);
                msg.Append(";SPID - " + SPID);
                msg.Append(";UserAccount - " + UserAccount);
                msg.Append(";CustID - " + CustID);
                msg.Append(";Password - " + Password);
                msg.Append(";TimeStamp - " + TimeStamp + "\r\n");

                msg.Append("处理结果 - " + Result.Result);
                msg.Append("; 错误描述 - " + Result.ErrorDescription);
                msg.Append("; ProvinceID - " + Result.ProvinceID);
                msg.Append("; ExtendField - " + Result.ExtendField + "\r\n");
                //记录UserDetailInfo
                UserInfoClass.WriteLogForUserInfo(Result.UserDetailInfo, ref msg);

                if (Result.SubscriptionRecords != null)
                    if (Result.SubscriptionRecords.Length > 0)
                    {
                        msg.Append("SubScriptionRecords: \r\n");
                        for (int i = 0; i < Result.SubscriptionRecords.Length; i++)
                        {
                            msg.Append("CustID - " + Result.SubscriptionRecords[i].CustID);
                            msg.Append("UserAccount - " + Result.SubscriptionRecords[i].UserAccount);
                            msg.Append("SubscribeStyle - " + Result.SubscriptionRecords[i].SubscribeStyle);
                            msg.Append("ServiceID - " + Result.SubscriptionRecords[i].ServiceID);
                            msg.Append("ServiceName - " + Result.SubscriptionRecords[i].ServiceName);
                            msg.Append("StartTime - " + Result.SubscriptionRecords[i].StartTime);
                            msg.Append("EndTime - " + Result.SubscriptionRecords[i].EndTime);
                            msg.Append("TransactionID - " + Result.SubscriptionRecords[i].TransactionID);

                            msg.Append("\r\n");
                        }
                    }
                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");

                BTUCenterInterfaceLog.CenterForBizTourLog("UserAuth", msg);
                #endregion

                CommonBizRules.WriteDataLog(SPID, CustID, UserAccount, Result.Result,
                    Result.ErrorDescription, PhoneNum, "UserAuth");
            }
            catch { }
        }

        return Result;
    }
    public UniquenessQueryResult UniquenessQuery(string ProvinceID, string SPID, string TimeStamp, string UserAccount,
        string PhoneNum, string CertificateCode, string CertificateType, string ExtendField)
    {
        UniquenessQueryResult Result = new UniquenessQueryResult();
        Result.Result = ErrorDefinition.BT_IError_Result_UnknowError_Code;
        Result.SPID = SPID;
        Result.ProvinceID = "35";
        Result.ErrorDescription = "";
        Result.ExtendField = "";

        try
        {
            if (CommonUtility.IsEmpty(ProvinceID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",不能为空";
                return Result;
            }

            if (ProvinceID.Length != ConstDefinition.Length_ProvinceID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",长度有误";
                return Result;
            }

            ProvinceInfoManager proObject = new ProvinceInfoManager();
            object proDataObject = proObject.GetProvinceData(this.Context);
            if (proObject.GetPropertyByProvinceID(ProvinceID, "ProvinceCode", proDataObject) == "")
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",无此provinceid";
                return Result;
            }

            if (CommonUtility.IsEmpty(SPID))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",不能为空";
                return Result;
            }

            if (SPID.Length != ConstDefinition.Length_SPID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",spid 长度有误";
                return Result;
            }

            if (!CommonUtility.IsEmpty(UserAccount))
            {
                if (UserAccount.Length < ConstDefinition.Length_Min_UserAccount)
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidUserAccount_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidUserAccount_Msg + ",长度有误";
                    return Result;
                }

                if (UserAccount.Length > ConstDefinition.Length_Max_UserAccount)
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidUserAccount_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidUserAccount_Msg + ",长度有误";
                    return Result;
                }

            }

            if (!CommonUtility.IsEmpty(PhoneNum))
            {
                string phone = "";
                if (!CommonBizRules.PhoneNumValid(this.Context, PhoneNum, out phone))
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidPhoneNum_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidPhoneNum_Msg;
                    return Result;
                }
                PhoneNum = phone;
            }

            if (!CommonUtility.IsEmpty(CertificateType))
            {
                if (ConstDefinition.Span_CertificateType.IndexOf(CertificateType) < 0)
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidCertificateType_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidCertificateType_Msg + ",无此CertificateType";
                    return Result;
                }

                if (CommonUtility.IsEmpty(CertificateCode))
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidCertificateCode_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidCertificateCode_Msg + ",不能为空";
                    return Result;
                }
            }

            if (CommonUtility.IsEmpty(UserAccount) & CommonUtility.IsEmpty(PhoneNum) & CommonUtility.IsEmpty(CertificateCode) & CommonUtility.IsEmpty(CertificateType))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidParameter_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidParameter_Msg + ",关键信息不能全部为空";
                return Result;
            }

            Result.Result = BTBizRules.UniquenessQuery(ProvinceID, SPID, UserAccount,
                 PhoneNum, CertificateCode, CertificateType, out Result.ErrorDescription);
        }
        catch (Exception e)
        {
            Result.Result = ErrorDefinition.IError_Result_System_UnknowError_Code;
            Result.ErrorDescription = ErrorDefinition.IError_Result_System_UnknowError_Msg + e.Message;
        }
        finally
        {
            #region WriteLog
            StringBuilder msg = new StringBuilder();
            msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n\r\n");
            msg.Append("唯一性查询接口" + DateTime.Now.ToString("u") + "\r\n");
            msg.Append("ProvinceID - " + ProvinceID);
            msg.Append(";SPID - " + SPID);
            msg.Append(";UserAccount - " + UserAccount);
            msg.Append(";PhoneNum - " + PhoneNum);
            msg.Append(";CertificateCode - " + CertificateCode);
            msg.Append(";CertificateType - " + CertificateType);
            msg.Append(";ExtendField - " + ExtendField);
            msg.Append(";TimeStamp - " + TimeStamp + "\r\n");

            msg.Append("处理结果 - " + Result.Result);
            msg.Append("; 错误描述 - " + Result.ErrorDescription);
            msg.Append("; ProvinceID - " + Result.ProvinceID);
            msg.Append("; SPID - " + Result.SPID);
            msg.Append("; ExtendField - " + Result.ExtendField + "\r\n");

            msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");

            BTUCenterInterfaceLog.CenterForBizTourLog("UniquenessQuery", msg);
            #endregion
        }

        return Result;
    }
    public ReverseUserRegistryResult ReverseUserRegistry(string ProvinceID, string SPID, string TimeStamp,
        string CertificateCode, string CertificateType, string RealName, string ContactPhone, string AreaCode)
    {
        ReverseUserRegistryResult Result = new ReverseUserRegistryResult();
        Result.Result = ErrorDefinition.BT_IError_Result_UnknowError_Code;
        Result.ProvinceID = "35";
        Result.CustID = "";
        Result.UserAccount = "";
        Result.ErrorDescription = "";
        Result.ExtendField = "";

        try
        {
            if (CommonUtility.IsEmpty(ProvinceID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",不能为空";
                return Result;
            }

            if (ProvinceID.Length != ConstDefinition.Length_ProvinceID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",长度有误";
                return Result;
            }

            ProvinceInfoManager proObject = new ProvinceInfoManager();
            object proDataObject = proObject.GetProvinceData(this.Context);
            if (proObject.GetPropertyByProvinceID(ProvinceID, "ProvinceCode", proDataObject) == "")
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + "无该省代码";
                return Result;
            }

            if (CommonUtility.IsEmpty(SPID))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",不能为空";
                return Result;
            }

            if (SPID.Length != ConstDefinition.Length_SPID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",长度有误";
                return Result;
            }

            if (CommonUtility.IsEmpty(RealName))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidRealName_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidRealName_Msg + ",长度有误";
                return Result;
            }

            if (!CommonUtility.IsEmpty(ContactPhone))
            {
                string phone = "";
                if (!CommonBizRules.PhoneNumValid(this.Context, ContactPhone, out phone))
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidPhoneNum_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidPhoneNum_Msg;
                    return Result;
                }
                ContactPhone = phone;
            }

            if (!CommonUtility.IsEmpty(CertificateType))
            {
                if (ConstDefinition.Span_CertificateType.IndexOf(CertificateType) < 0)
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidCertificateType_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidCertificateType_Msg + ",无此类型";
                    return Result;
                }

                if (CommonUtility.IsEmpty(CertificateCode))
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidCertificateCode_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidCertificateCode_Msg + ",不能为空";
                    return Result;
                }
            }

            //校验AreaCode
            if (!CommonUtility.IsEmpty(AreaCode))
            {
                if (AreaCode.Length == 2)
                    AreaCode = "0" + AreaCode;

                if (AreaCode.Length != ConstDefinition.Length_AreaCode)
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidAreaCode_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidAreaCode_Msg + ",区号长度有误";
                    return Result;
                }
            }
            Result.Result = BTBizRules.ReverseUserRegistry(ProvinceID, SPID, TimeStamp, CertificateCode,
                CertificateType, RealName, ContactPhone, AreaCode, out Result.ErrorDescription, out Result.CustID, out Result.UserAccount);

            if (Result.Result == 0)
            {
                //通知积分系统
                // CommonBizRules.CustInfoNotify(Result.CustID, Result.UserAccount, "", "0","1","","42",ProvinceID,SPID);
            }
        }
        catch (Exception e)
        {
            Result.Result = ErrorDefinition.IError_Result_System_UnknowError_Code;
            Result.ErrorDescription = ErrorDefinition.IError_Result_System_UnknowError_Msg + e.Message;
        }
        finally
        {
            try
            {
                #region WriteLog
                StringBuilder msg = new StringBuilder();
                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n\r\n");
                msg.Append("反向注册接口" + DateTime.Now.ToString("u") + "\r\n");
                msg.Append("ProvinceID - " + ProvinceID);
                msg.Append(";SPID - " + SPID);
                msg.Append(";CertificateCode - " + CertificateCode);
                msg.Append(";CertificateType - " + CertificateType);
                msg.Append(";RealName - " + RealName);
                msg.Append(";RealName - " + ContactPhone);
                msg.Append(";AreaCode - " + AreaCode);
                msg.Append(";TimeStamp - " + TimeStamp + "\r\n");

                msg.Append("处理结果 - " + Result.Result + " " + DateTime.Now.ToString("u") + "\r\n");
                msg.Append("; 错误描述 - " + Result.ErrorDescription);
                msg.Append("; ProvinceID - " + Result.ProvinceID);
                msg.Append("; CustID - " + Result.CustID);
                msg.Append("; UserAccount - " + Result.UserAccount);
                msg.Append("; ExtendField - " + Result.ExtendField + "\r\n");
                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");

                BTUCenterInterfaceLog.CenterForBizTourLog("ReverseUserRegistry", msg);
                #endregion

                CommonBizRules.WriteDataLog(SPID, "", "", Result.Result,
                    Result.ErrorDescription, "", "ReverseUserRegistry");
            }
            catch { }
        }

        return Result;
    }
Esempio n. 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        err_username.InnerHtml = "";
        err_phone_code.InnerHtml = "";
        err_page_code.InnerHtml = "";
        err_email.InnerHtml = "";
        err_password.InnerHtml = "";
        Top1.Welcome = "号码百事通用户注册";
        backCount.Value = Convert.ToString((Convert.ToInt32(backCount.Value) - 1));

        if (!Page.IsPostBack)
        {

            //地区联动--start
            ProvinceInfoManager proInfo = new ProvinceInfoManager();
            object ProData = proInfo.GetProvinceData(this.Context);
            DataSet ds = (DataSet)ProData;
            this.proInfoList.DataSource = ds;
            this.proInfoList.DataTextField = "ProvinceName";
            this.proInfoList.DataValueField = "ProvinceID";
            this.proInfoList.DataBind();

            //PhoneAreaInfoManager areaInfo = new PhoneAreaInfoManager();
            //object areaData = areaInfo.GetPhoneAreaData(this.Context);
            //PhoneAreaData pad = (PhoneAreaData)areaData;
            //this.areaInfoList.DataSource = pad;
            //this.areaInfoList.DataTextField = "AreaName";
            //this.areaInfoList.DataValueField = "AreaID";
            //this.areaInfoList.DataBind();
            ListItem li = new ListItem("请选择", "-999");
            proInfoList.Items.Add(li);
            proInfoList.SelectedIndex = proInfoList.Items.Count - 1;

            //this.areaInfoList.Items.Add("北京");
            this.areaInfoList.Items.Add(li);
            areaInfoList.SelectedIndex = areaInfoList.Items.Count - 1;

            //地区联动--end

            if (!CommonBizRules.IsUrlParams(HttpContext.Current.Request.Url.OriginalString))
            {
                //  CommonBizRules.ErrorHappenedRedircet(-1, "URL参数不存在", "用户注册", this.Context);
            }
            //SPID = HttpUtility.HtmlDecode(Request.QueryString["SPID"].ToString());
            //ReturnUrl = HttpUtility.HtmlDecode(Request.QueryString["ReturnUrl"].ToString());
            SPID = Request["SPID"] == null ? ConstHelper.DefaultInstance.BesttoneSPID : HttpUtility.HtmlDecode(Request["SPID"]);
            ReturnUrl = Request["ReturnUrl"] == null ? ConstHelper.DefaultInstance.BesttoneLoginPage : HttpUtility.HtmlDecode(Request["ReturnUrl"]);
            HiddenField_SPID.Value = SPID;
            HiddenField_URL.Value = ReturnUrl;

            btn_OK.Attributes.Add("onclick", "return CheckInput();");
            CertificateType.Attributes.Add("onchange", "f_show()");
            //CertificateType.Attributes["onchange"] = "javascript:showText()";
            //RegisterStartupScript("Startup", "<script language='javascript'>function window.onload(){showText();}</" + "script>");

        }

        if (proInfoList.SelectedIndex != proInfoList.Items.Count - 1)
        {

            PhoneAreaInfoManager areaInfo = new PhoneAreaInfoManager();
            object areaData = areaInfo.GetPhoneAreaData(this.Context, proInfoList.Value);
            PhoneAreaData pad = (PhoneAreaData)areaData;
            this.areaInfoList.DataSource = pad;
            this.areaInfoList.DataTextField = "AreaName";
            this.areaInfoList.DataValueField = "AreaID";
            this.areaInfoList.DataBind();

        }
        else
        {
            areaInfoList.Value = "请选择";
        }
    }
Esempio n. 10
0
    public PhoneBindQueryResult PhoneBindQuery(string ProvinceID, string SPID, string PhoneNum)
    {
        PhoneBindQueryResult Result = new PhoneBindQueryResult();
        Result.Result = ErrorDefinition.IError_Result_System_UnknowError_Code;
        Result.ErrorDescription = ErrorDefinition.IError_Result_System_UnknowError_Msg;
        Result.CustID = "";
        Result.UserAccount = "";
        Result.RealName = "";
        Result.ProvinceID = "35";

        try
        {
            if (CommonUtility.IsEmpty(ProvinceID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + "";
                return Result;
            }

            if (ProvinceID.Length != ConstDefinition.Length_ProvinceID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + "";
                return Result;
            }

            ProvinceInfoManager proObject = new ProvinceInfoManager();
            object proDataObject = proObject.GetProvinceData(this.Context);
            if (proObject.GetPropertyByProvinceID(ProvinceID, "ProvinceCode", proDataObject) == "")
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",无此provinceid";
                return Result;
            }

            if (CommonUtility.IsEmpty(SPID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",不能为空";
                return Result;
            }

            if (SPID.Length != ConstDefinition.Length_SPID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",长度有误";
                return Result;
            }

            if (CommonUtility.IsEmpty(PhoneNum))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidCustID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidCustID_Msg + ",不能为空";
                return Result;
            }

            Result.Result = BTBizRules.BindPhoneQuery(SPID, PhoneNum, out Result.CustID, out Result.UserAccount, out Result.RealName, out Result.ErrorDescription);
        }
        catch (Exception ex)
        {
            Result.Result = ErrorDefinition.BT_IError_Result_System_UnknowError_Code;
            Result.ErrorDescription = ex.Message;
        }
        finally
        {
            try
            {
                #region WriteLog
                StringBuilder msg = new StringBuilder();
                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n\r\n");
                msg.Append("认证方式查询接口 " + DateTime.Now.ToString("u") + "\r\n");
                msg.Append("ProvinceID - " + ProvinceID);
                msg.Append(";SPID - " + SPID);
                msg.Append(";PhoneNum - " + PhoneNum);
                msg.Append("\r\n");

                msg.Append("处理结果 - " + Result.Result);
                msg.Append("; 错误描述 - " + Result.ErrorDescription);
                msg.Append("; CustID - " + Result.CustID);
                msg.Append("; UserAccount - " + Result.UserAccount);
                msg.Append("; RealName - " + Result.RealName);
                msg.Append("; ProvinceID - " + Result.ProvinceID);
                msg.Append("; UserAccount - " + Result.UserAccount);
                msg.Append("\r\n");
                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");

                BTUCenterInterfaceLog.CenterForBizTourLog("PhoneBindQuery", msg);
                #endregion

                CommonBizRules.WriteDataLog(SPID, "", "", Result.Result,
                    Result.ErrorDescription, PhoneNum, "PhoneBindQuery");
            }
            catch { }

        }

        return Result;
    }
Esempio n. 11
0
    public PhoneBindResult PhoneBind(string ProvinceID, string SPID, string TimeStamp, string CustID, string UserAccount, string PhoneNum)
    {
        PhoneBindResult Result = new PhoneBindResult();

        Result.Result = ErrorDefinition.BT_IError_Result_UnknowError_Code;
        Result.ProvinceID = "35";
        Result.CustID = CustID;
        Result.UserAccount = UserAccount;
        Result.ErrorDescription = "";
        Result.BoundPhoneRecords = null;
        Result.ExtendField = "";

        try
        {
            #region 数据校验
            //检查ProvinceID是否为空
            if (CommonUtility.IsEmpty(ProvinceID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + "";
                return Result;
            }

            //检查ProvinceID长度是否有误
            if (ProvinceID.Length != ConstDefinition.Length_ProvinceID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + "";
                return Result;
            }

            //检查指定属性是否为空
            ProvinceInfoManager proObject = new ProvinceInfoManager();
            object proDataObject = proObject.GetProvinceData(this.Context);
            if (proObject.GetPropertyByProvinceID(ProvinceID, "ProvinceCode", proDataObject) == "")
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",无此provinceid";
                return Result;
            }

            //检查SPID是否为空
            if (CommonUtility.IsEmpty(SPID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",不能为空";
                return Result;
            }

            //检查SPID长度是否有误
            if (SPID.Length != ConstDefinition.Length_SPID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",长度有误";
                return Result;
            }

            //IP是否允许访问
            Result.Result = CommonBizRules.CheckIPLimit(SPID, HttpContext.Current.Request.UserHostAddress, this.Context, out Result.ErrorDescription);
            if (Result.Result != 0)
            {
                return Result;
            }

            //接口访问权限判断
            Result.Result = CommonBizRules.CheckInterfaceLimit(SPID, "PhoneBind", this.Context, out Result.ErrorDescription);
            if (Result.Result != 0)
            {
                return Result;
            }

            //检查CustID是否为空
            if (CommonUtility.IsEmpty(CustID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidCustID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidCustID_Msg + ",不能为空";
                return Result;
            }

            //检查UserAccount是否为空
            if (CommonUtility.IsEmpty(UserAccount))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidUserAccount_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidUserAccount_Msg + ",不能为空";
                return Result;
            }

            //检查UserAccount长度是否有误
            if (UserAccount.Length < ConstDefinition.Length_Min_UserAccount)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidUserAccount_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidUserAccount_Msg + ",长度有误";
                return Result;
            }

            //UserAccount
            if (UserAccount.Length > ConstDefinition.Length_Max_UserAccount)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidUserAccount_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidUserAccount_Msg + ",长度有误";
                return Result;
            }
            string phone = "";
            //验证电话号码有效性
            if (!CommonBizRules.PhoneNumValid(this.Context, PhoneNum, out phone))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidPhoneNum_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidPhoneNum_Msg;
                return Result;
            }
            PhoneNum = phone;
            #endregion

            Result.Result = BTBizRules.BindPhone(SPID, CustID, PhoneNum, out Result.ErrorDescription);

            string ErrMsg = "";
            int QueryResult = -1;
            Result.BoundPhoneRecords = BTBizRules.GetBoundPhone(CustID, UserAccount, out QueryResult, out ErrMsg);
            Result.ErrorDescription += ErrMsg;

            if (QueryResult != 0 & Result.Result == 0)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_UnknowError_Code;
            }
        }
        catch (Exception e)
        {
            Result.Result = ErrorDefinition.IError_Result_System_UnknowError_Code;
            Result.ErrorDescription = ErrorDefinition.IError_Result_System_UnknowError_Msg + e.Message;
        }
        finally
        {
            try
            {
                #region WriteLog
                StringBuilder msg = new StringBuilder();
                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n\r\n");
                msg.Append("电话号码绑定接口" + DateTime.Now.ToString("u") + "\r\n");
                msg.Append("ProvinceID - " + ProvinceID);
                msg.Append(";SPID - " + SPID);
                msg.Append(";PhoneNum - " + PhoneNum);
                msg.Append(";CustID - " + CustID);
                msg.Append(";TimeStamp - " + TimeStamp + "\r\n");

                msg.Append("处理结果 - " + Result.Result);
                msg.Append("; 错误描述 - " + Result.ErrorDescription);
                msg.Append("; ProvinceID - " + Result.ProvinceID);
                msg.Append("; CustID - " + Result.CustID);
                msg.Append("; ExtendField - " + Result.ExtendField + "\r\n");
                if (Result.BoundPhoneRecords != null)
                {
                    if (Result.BoundPhoneRecords.Length > 0)
                    {
                        msg.Append("BoundPhoneRecords: \r\n");
                        for (int i = 0; i < Result.BoundPhoneRecords.Length; i++)
                        {
                            msg.Append("Phone- " + Result.BoundPhoneRecords[i].Phone);
                        }
                    }
                }
                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");

                BTUCenterInterfaceLog.CenterForBizTourLog("PhoneBind", msg);
                #endregion

                CommonBizRules.WriteDataLog(SPID, CustID, UserAccount, Result.Result,
                    Result.ErrorDescription, PhoneNum, "PhoneBind");
            }
            catch { }
        }

        return Result;
    }
Esempio n. 12
0
    public PasswordResetResult PasswordReset(string ProvinceID, string SPID, string TimeStamp, string CustID, string UserAccount, string NewPassword, string OPType)
    {
        PasswordResetResult Result = new PasswordResetResult();
        Result.Result = ErrorDefinition.BT_IError_Result_UnknowError_Code;
        Result.CustID = CustID;
        Result.UserAccount = UserAccount;
        Result.ErrorDescription = "";
        Result.ProvinceID = "35";
        Result.ExtendField = "";
        Result.Result = CommonBizRules.CheckIPLimit(SPID, HttpContext.Current.Request.UserHostAddress, this.Context, out Result.ErrorDescription);
        if (Result.Result != 0)
        {
            return Result;
        }

        //接口访问权限判断
        Result.Result = CommonBizRules.CheckInterfaceLimit(SPID, "PasswordReset", this.Context, out Result.ErrorDescription);
        if (Result.Result != 0)
        {
            return Result;
        }
        try
        {
            if (CommonUtility.IsEmpty(ProvinceID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",不能为空";
                return Result;
            }

            if (ProvinceID.Length != ConstDefinition.Length_ProvinceID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",长度有误";
                return Result;
            }

            ProvinceInfoManager proObject = new ProvinceInfoManager();
            object proDataObject = proObject.GetProvinceData(this.Context);
            if (proObject.GetPropertyByProvinceID(ProvinceID, "ProvinceCode", proDataObject) == "")
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",无效的省标识";
                return Result;
            }

            if (CommonUtility.IsEmpty(SPID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",不能为空";
                return Result;
            }

            if (SPID.Length != ConstDefinition.Length_SPID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",长度有误";
                return Result;
            }

            if (CommonUtility.IsEmpty(CustID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidCustID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidCustID_Msg + ",不能为空";
                return Result;
            }
            if (OPType != "0" & OPType != "1")
            {

                Result.Result = ErrorDefinition.IError_Result_InvalidRequestData_Code;
                Result.ErrorDescription = ErrorDefinition.IError_Result_InvalidRequestData_Msg + ",操作类型不对";
                return Result;
            }

            if (CommonUtility.IsEmpty(UserAccount))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidUserAccount_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidUserAccount_Msg + ",不能为空";
                return Result;
            }

            if (UserAccount.Length < ConstDefinition.Length_Min_UserAccount)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidUserAccount_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidUserAccount_Msg + ",长度有误";
                return Result;
            }
            if (UserAccount.Length > ConstDefinition.Length_Max_UserAccount)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidUserAccount_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidUserAccount_Msg + ",长度有误";
                return Result;
            }
            if (OPType == "0") //如果是修改密码则密码不能为空
            {
                if (CommonUtility.IsEmpty(NewPassword))
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidPassword_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidPassword_Msg + ",不能为空";
                    return Result;
                }

                if (NewPassword.Length < ConstDefinition.Length_Min_Password)
                {
                    Result.Result = ErrorDefinition.BT_IError_Result_InValidPassword_Code;
                    Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidPassword_Msg + ",密码必须大于6位";
                    return Result;
                }
            }

            //如果是密码重置则随即分配密码
            if (OPType == "1")
            {
                Random rd = new Random();

                NewPassword = rd.Next(111111, 999999).ToString();
            }

            string ContactTel = "";
            string Email = "";
            string RealName = "";
            Result.Result = BTBizRules.PasswordReset(SPID, CustID, UserAccount, NewPassword, out Result.ErrorDescription, out ContactTel, out Email, out RealName);

            StringBuilder msg = new StringBuilder();
            msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n\r\n");

            //如果是密码重置则发短信或发邮件通知用户
            if (OPType == "1")
            {
                msg.Append("客户信息平台密码重置短信接口测试准备调用 " + DateTime.Now.ToString("u") + "\r\n");
                msg.Append(ContactTel + "尊敬的" + RealName + "您好,您的密码已成功修改,您的卡号:" + UserAccount + "密码:" + NewPassword + ".请您牢记您的密码");
                msg.Append("\r\n");
                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");
                BTUCenterInterfaceLog.CenterForBizTourLog("PasswordReset", msg);

                CommonBizRules.SendMessage(ContactTel, "尊敬的" + RealName + "您好,您的密码已成功修改,您的卡号:" + UserAccount + "密码:" + NewPassword + ".请您牢记您的密码", "35000000");
            }
        }
        catch (Exception e)
        {
            Result.Result = ErrorDefinition.IError_Result_System_UnknowError_Code;
            Result.ErrorDescription = ErrorDefinition.IError_Result_System_UnknowError_Msg + e.Message;
        }
        finally
        {
            try
            {
                #region WriteLog
                StringBuilder msg = new StringBuilder();
                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n\r\n");
                msg.Append("密码重置接口 " + DateTime.Now.ToString("u") + "\r\n");
                msg.Append("ProvinceID - " + ProvinceID);
                msg.Append(";SPID - " + SPID);
                msg.Append(";UserAccount - " + UserAccount);
                msg.Append(";CustID - " + CustID);
                msg.Append(";NewPassword - " + NewPassword);
                msg.Append(";OPType - " + OPType);
                msg.Append(";TimeStamp - " + TimeStamp + "\r\n");

                msg.Append("处理结果 - " + Result.Result);
                msg.Append("; 错误描述 - " + Result.ErrorDescription);
                msg.Append("; ProvinceID - " + Result.ProvinceID);
                msg.Append("; CustID - " + Result.CustID);
                msg.Append("; UserAccount - " + Result.UserAccount);
                msg.Append("; ExtendField - " + Result.ExtendField + "\r\n");

                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");

                BTUCenterInterfaceLog.CenterForBizTourLog("PasswordReset", msg);
                #endregion

                CommonBizRules.WriteDataLog(SPID, CustID, UserAccount, Result.Result,
                    Result.ErrorDescription, "", "PasswordReset");
            }
            catch { }
        }
        return Result;
    }
Esempio n. 13
0
    protected void EditBind()
    {
        Int32 Result = ErrorDefinition.BT_IError_Result_UnknowError_Code;
        String ErrMsg = ErrorDefinition.BT_IError_Result_UnknowError_Msg;
        String provinceid=String.Empty, areaid=String.Empty;
        try
        {
            //基本信息
            string OuterID, Status, CustType, CustLevel, RealName, UserName, NickName, CertificateCode, CertificateType, Sex, Email, EnterpriseID, ProvinceID, AreaID, Registration;
            //扩展信息
            string Birthday, EduLevel, Favorite, IncomeLevel;
            Result = CustBasicInfo.getCustInfo(this.hdSPID.Value, this.hdCustID.Value, 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  Registration);
            if (Result != 0)
            {

            }

            this.txtUserName.Text = UserName;
            this.txtRealName.Text = RealName;
            this.txtNickName.Text = NickName;
            this.DDLSex.SelectedValue = Sex;
            provinceid = ProvinceID;
            areaid = AreaID;
            this.DDLCertificateType.SelectedValue = CertificateType;
            if (!String.IsNullOrEmpty(CertificateType))
                this.txtCertificateCode.Text = CertificateCode;

            //获取扩展信息
            Result = CustExtendInfo.getCustExtendInfo(this.hdSPID.Value, this.hdCustID.Value, out ErrMsg, out Birthday, out  EduLevel, out  Favorite, out  IncomeLevel);
            if (!String.IsNullOrEmpty(Birthday))
            {
                this.txtBirthday.Text = DateTime.Parse(Birthday).ToString("yyyy-MM-dd");
            }
            this.DDLEdueLevel.SelectedValue = EduLevel;
            this.DDLIncomeLevel.SelectedValue = IncomeLevel;

        }
        catch (Exception ex)
        {

        }

        #region 绑定省市

        ProvinceInfoManager provinceMgr = new ProvinceInfoManager();
        object ProData = provinceMgr.GetProvinceData(this.Context);
        DataSet ds = (DataSet)ProData;
        ListItem li = null;

        this.DDLProvinceList.Items.Clear();
        foreach (DataRow row in ds.Tables[0].Rows)
        {
            if (row["ProvinceID"].ToString() == "35" || row["ProvinceName"].ToString() == "全国中心")
                continue;
            li = new ListItem(row["ProvinceName"].ToString(), row["ProvinceID"].ToString());
            this.DDLProvinceList.Items.Add(li);
        }

        this.DDLProvinceList.SelectedValue = provinceid;

        this.DDLAreaList.DataSource = GetCityName(provinceid);
        this.DDLAreaList.DataTextField = "AreaName";
        this.DDLAreaList.DataValueField = "AreaID";
        this.DDLAreaList.DataBind();

        this.DDLAreaList.SelectedValue = areaid;
        #endregion
    }
Esempio n. 14
0
 /// <summary>
 /// ����ʡ�����ȡʡ�Ĺ�����
 /// </summary>
 public static string GetReginCodeByProvinceID(string ProvinceID, HttpContext context)
 {
     string Result = "";
     ProvinceInfoManager proInfo = new ProvinceInfoManager();
     Object ProvinceData = proInfo.GetProvinceData(context);
     Result = proInfo.GetPropertyByProvinceID(ProvinceID, "RegionProvince", ProvinceData);
     return Result;
 }
Esempio n. 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Top1.Welcome = "号码百事通设置用户信息";
        this.Master.setTopWelcome("号码百事通用户信息");
        if (!Page.IsPostBack)
        {
            string url = Request.Url.AbsoluteUri;
            if (Request.QueryString["SPID"] != null)
            {
                Spid = Request.QueryString["SPID"].ToString();
                this.spidtxt.Value = Spid;
            }

            TokenValidate.IsRedircet = true;            //正式要恢复
            TokenValidate.Validate();                       //正式要恢复
            string CustID = TokenValidate.CustID;   //正式要恢复

            if (CustID != "")
            {
                this.custidtxt.Value = CustID;
            }

            #region 定义需要的参数

            //输出错误信息
            string Msg = "";
            //客户姓名
            string RealName = "";
            //昵称
            string NickName = "";
            //证件类型
            string CertificateType = "";
            //证件号码
            string CertificateCode = "";
            //性别
            string Sex = "";
            //客户所属省
            string ProvinceID = "";
            //客户归属地市
            string AreaID = "";
            //生日
            string Birthday = "";
            //文化程度
            string EduLevel = "";
            //收入水平
            string IncomeLevel = "";

            //外部客户ID
            string OuterID = "";
            //状态
            string Status = "";
            //客户类型
            string CustType = "";
            //客户级别
            string CustLevel = "";
            //邮箱
            string Email = "";
            //用户名
            string UserName = "";
            //爱好(废除)
            string Favorite = "";
            //?
            string Registration = "";

            string EnterpriseID = "";
            #endregion

            //调用用户基本信息查询函数将以上的参数带入函数内
            int k = CustBasicInfo.getCustInfo(Spid, CustID, out Msg, 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 Registration);

            //判断 如果函数返回0则对页面的HTML文本框赋值
            if (k == 0)
            {
                //string r = null;
                this.realnametxt.Value = RealName;
                this.nicknametxt.Value = NickName;

                this.certificatetxt.Value = CertificateType;
                this.certnotxt.Value = CertificateCode;

                this.sextxt.Value = Sex;
                this.stext.Value = ProvinceID;
                this.resulttxt.Value = AreaID;
                //this.emailtxt.Value = Email;
                //this.usernameTxt.Value = UserName;

                //初始话页面时给省份下拉框绑定所有省份
                ProvinceInfoManager proInfo = new ProvinceInfoManager();
                object ProData = proInfo.GetProvinceData(this.Context);
                DataSet ds = (DataSet)ProData;
                ListItem li = null;
                this.proInfoList.Items.Clear();
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    if (row["ProvinceID"].ToString() == "35" || row["ProvinceName"].ToString() == "全国中心")
                        continue;
                    li = new ListItem(row["ProvinceName"].ToString(), row["ProvinceID"].ToString());
                    this.proInfoList.Items.Add(li);
                }
                //this.proInfoList.DataSource = ds;
                //this.proInfoList.DataTextField = "ProvinceName";
                //this.proInfoList.DataValueField = "ProvinceID";
                //this.proInfoList.DataBind();

                //初始话页面时给城市下拉绑定所有城市
                this.areaInfoList.DataSource = GetCityName(this.stext.Value);
                this.areaInfoList.DataTextField = "AreaName";
                this.areaInfoList.DataValueField = "AreaID";
                this.areaInfoList.DataBind();

                this.areaid.DataSource = GetCityName(this.stext.Value);
                this.areaid.DataTextField = "AreaID";
                this.areaid.DataValueField = "AreaID";
                this.areaid.DataBind();

                this.certificateSel.Value = this.certificatetxt.Value;

                this.sexSel.Value = this.sextxt.Value;
                this.proInfoList.Value = this.stext.Value;
                this.areaInfoList.Value = this.resulttxt.Value;
                this.areaid.Value = this.resulttxt.Value;

                if(certificateSel.Value=="")
                {
                    certnotxt.Style.Value = "display:block";
                    certnoL.Style.Value = "display:block";
                }

            }
            //调用客户扩展信息查询函数将以上参数带入函数内
            int y = CustExtendInfo.getCustExtendInfo(Spid, CustID, out Msg, out Birthday, out EduLevel, out Favorite, out IncomeLevel);
            //判断 如果函数返回0则对页面HTML文本框赋值
            if (y == 0)
            {
                if (!CommonUtility.IsEmpty(Birthday))
                {
                    DateTime da = Convert.ToDateTime(Birthday);
                    this.birthdaytxt.Value = da.ToShortDateString();
                }

                this.Edutxt.Value = EduLevel;
                this.Incometxt.Value = IncomeLevel;
                this.EduSel.Value = this.Edutxt.Value;
                this.IncomeSel.Value = this.Incometxt.Value;
            }
        }
    }
Esempio n. 16
0
    public string NewCardCustomerInfoExport(string strProvinceID, string strSPID, string strTimeStamp, string XmlInfor, string dealType)
    {
        string Result = ErrorDefinition.BT_IError_Result_UnknowError_Code.ToString();
        string ErrMsg = "";

        try
        {
            #region 数据校验
            if (CommonUtility.IsEmpty(strProvinceID))
            {

                Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code.ToString();
                ErrMsg = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",不能为空";
                Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                return Result;
            }

            if (strProvinceID.Length != ConstDefinition.Length_ProvinceID)
            {
                Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code.ToString();
                ErrMsg = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",长度有误";
                Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                return Result;
            }

            ProvinceInfoManager proObject = new ProvinceInfoManager();
            object proDataObject = proObject.GetProvinceData(this.Context);
            if (proObject.GetPropertyByProvinceID(strProvinceID, "ProvinceCode", proDataObject) == "")
            {
                Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code.ToString();
                ErrMsg = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg + ",无该省代码";
                Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                return Result;
            }

            if (CommonUtility.IsEmpty(strSPID))
            {
                Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code.ToString();
                ErrMsg = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",不能为空";
                Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                return Result;
            }

            if (strSPID.Length != ConstDefinition.Length_SPID)
            {
                Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code.ToString();
                ErrMsg = ErrorDefinition.BT_IError_Result_InValidSPID_Msg + ",长度有误";
                Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                return Result;
            }

            if (dealType != "0" & dealType != "1")
            {
                Result = ErrorDefinition.BT_IError_Result_InValidParameter_Code.ToString();
                ErrMsg = ErrorDefinition.BT_IError_Result_InValidParameter_Msg + ",DealType无此定义";
                Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                return Result;
            }

            if (CommonUtility.IsEmpty(XmlInfor))
            {
                Result = ErrorDefinition.BT_IError_Result_InValidParameter_Code.ToString();
                ErrMsg = ErrorDefinition.BT_IError_Result_InValidParameter_Msg + ",XmlInfor为空";
                Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                return Result;
            }
            string custID = "";
            string userType = "";
            string userAccount = "";
            string uProvinceID = "";

            string status = "";
            string realName = "";
            string cardClass = "";
            string credit = "";
            string registration = "";
            string certificateCode = "";
            string certificateType = "";
            string birthday = "";
            string sex = "";
            string custLevel = "";
            string custContactTel = "";
            string enterpriseID = "";
            string extendField = "";

            custID = CommonUtility.GetValueFromXML(XmlInfor, "custID");
            userType = CommonUtility.GetValueFromXML(XmlInfor, "userType");
            userAccount = CommonUtility.GetValueFromXML(XmlInfor, "userAccount");
            uProvinceID = CommonUtility.GetValueFromXML(XmlInfor, "uProvinceID");

            status = CommonUtility.GetValueFromXML(XmlInfor, "status");
            realName = CommonUtility.GetValueFromXML(XmlInfor, "realName");
            // cardClass = CommonUtility.GetValueFromXML(XmlInfor, "cardClass");
            credit = CommonUtility.GetValueFromXML(XmlInfor, "credit");
            registration = CommonUtility.GetValueFromXML(XmlInfor, "registration");
            certificateCode = CommonUtility.GetValueFromXML(XmlInfor, "certificateCode");
            certificateType = CommonUtility.GetValueFromXML(XmlInfor, "certificateType");
            birthday = CommonUtility.GetValueFromXML(XmlInfor, "birthday");
            sex = CommonUtility.GetValueFromXML(XmlInfor, "sex");
            custLevel = CommonUtility.GetValueFromXML(XmlInfor, "cardClass");
            custContactTel = CommonUtility.GetValueFromXML(XmlInfor, "custContactTel");
            enterpriseID = CommonUtility.GetValueFromXML(XmlInfor, "enterpriseID");
            extendField = CommonUtility.GetValueFromXML(XmlInfor, "extendField");

            if (CommonUtility.IsEmpty(userType))
            {
                Result = ErrorDefinition.BT_IError_Result_InValidUserType_Code.ToString();
                ErrMsg = ErrorDefinition.BT_IError_Result_InValidUserType_Msg + ",不能为空";
                Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                return Result;
            }

            if (ConstDefinition.Span_UserType.IndexOf(userType) < 0)
            {
                Result = ErrorDefinition.BT_IError_Result_InValidUserType_Code.ToString();
                ErrMsg = ErrorDefinition.BT_IError_Result_InValidUserType_Msg + ",无该用户类型";
                Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                return Result;
            }

            if (CommonUtility.IsEmpty(userAccount))
            {
                Result = ErrorDefinition.BT_IError_Result_InValidUserType_Code.ToString();
                ErrMsg = ErrorDefinition.BT_IError_Result_InValidUserType_Msg + ",不能为空";
                Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                return Result;
            }

            if (userAccount.Length != 12)
            {
                Result = ErrorDefinition.BT_IError_Result_InValidUserType_Code.ToString();
                ErrMsg = ErrorDefinition.BT_IError_Result_InValidUserType_Msg + ",长度有误";
                Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                return Result;
            }

            if (CommonUtility.IsEmpty(status))
            {
                Result = ErrorDefinition.BT_IError_Result_InValidStatus_Code.ToString();
                ErrMsg = ErrorDefinition.BT_IError_Result_InValidStatus_Msg + ",状态不能为空";
                Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                return Result;
            }

            if (ConstDefinition.Span_UserStatus.IndexOf(status) < 0)
            {
                Result = ErrorDefinition.BT_IError_Result_InValidStatus_Code.ToString();
                ErrMsg = ErrorDefinition.BT_IError_Result_InValidStatus_Msg + ",无此状态类型";
                Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                return Result;
            }

            if (CommonUtility.IsEmpty(custLevel))
            {
                Result = ErrorDefinition.BT_IError_Result_InValidCustLevel_Code.ToString();
                ErrMsg = ErrorDefinition.BT_IError_Result_InValidCustLevel_Msg + ",客户级别不能为空";
                Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                return Result;
            }

            if (ConstDefinition.Span_CustLevel.IndexOf(custLevel) < 0)
            {
                Result = ErrorDefinition.BT_IError_Result_InValidCustLevel_Code.ToString();
                ErrMsg = ErrorDefinition.BT_IError_Result_InValidCustLevel_Msg + ",无此客户级别";
                Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                return Result;
            }

            if (CommonUtility.IsEmpty(sex))
            {
                Result = ErrorDefinition.BT_IError_Result_InValidSex_Code.ToString();
                ErrMsg = ErrorDefinition.BT_IError_Result_InValidSex_Msg + ",不能为空";
                Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                return Result;
            }

            if (ConstDefinition.Span_Sex.IndexOf(sex) < 0)
            {
                Result = ErrorDefinition.BT_IError_Result_InValidSex_Code.ToString();
                ErrMsg = ErrorDefinition.BT_IError_Result_InValidSex_Msg + ",无此性别定义";
                Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                return Result;
            }

            if (!CommonUtility.IsEmpty(certificateType))
            {
                if (ConstDefinition.Span_CertificateType.IndexOf(certificateType) < 0)
                {

                    Result = ErrorDefinition.BT_IError_Result_InValidCertificateType_Code.ToString();
                    ErrMsg = ErrorDefinition.BT_IError_Result_InValidCertificateType_Msg + ",无此证件类型";
                    Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                    return Result;
                }

                if (certificateCode.Length > 20)
                {
                    Result = ErrorDefinition.BT_IError_Result_InValidCertificateCode_Code.ToString();
                    ErrMsg = ErrorDefinition.BT_IError_Result_InValidCertificateCode_Msg + ",证件长度长度有误";
                    Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
                    return Result;

                }
            }

            string CustID = "";
            Result = BTBizRules.NewCardCustomerInfoExport(strSPID, dealType, userType, userAccount, uProvinceID,
             status, realName, cardClass, credit, registration, certificateCode, certificateType, birthday, sex, custLevel, custContactTel, enterpriseID,
             extendField, out CustID, out  ErrMsg).ToString();

            if (Result == "0")
            {
                //通知积分系统
                //CommonBizRules.CustInfoNotify(CustID, userAccount, "", dealType, "", "", userType,uProvinceID,strSPID);
            }
            Result = BTBizRules.GenerateResultXml(Result, ErrMsg);

        }
        catch (Exception ex)
        {
            Result = ErrorDefinition.BT_IError_Result_System_UnknowError_Code.ToString();
            ErrMsg = ErrorDefinition.BT_IError_Result_System_UnknowError_Msg + ex.Message;
            Result = BTBizRules.GenerateResultXml(Result, ErrMsg);
        }
        finally
        {
            #region WriteLog
            StringBuilder msg = new StringBuilder();
            msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n\r\n");
            msg.Append("客户信息同步接口 " + DateTime.Now.ToString("u") + "\r\n");
            msg.Append("ProvinceID - " + strProvinceID);
            msg.Append(";SPID - " + strSPID);
            msg.Append(";dealType - " + dealType);
            msg.Append(";XmlInfor - " + XmlInfor);
            msg.Append(";TimeStamp - " + strTimeStamp + "\r\n");

            msg.Append("; 处理结果 - " + Result + "\r\n");
            msg.Append("\r\n");
            msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");

            BTUCenterInterfaceLog.CenterForBizTourLog("NewCardCustomerInfoExport", msg);
            #endregion

        }
            #endregion

        return Result;
    }
Esempio n. 17
0
    public PhoneUnBindReslut PhoneUnBind(string ProvinceID, string SPID, string TimeStamp, string PhoneNum)
    {
        PhoneUnBindReslut Result = new PhoneUnBindReslut();
        Result.Result = ErrorDefinition.BT_IError_Result_System_UnknowError_Code;
        Result.ErrorDescription = "";
        Result.ProvinceID = "35";
        Result.ExtendField = "";

        try
        {
            #region 数据校验
            //检查ProvinceID是否为空
            if (CommonUtility.IsEmpty(ProvinceID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg;
                return Result;
            }

            //检查ProvinceID长度是否有误
            if (ProvinceID.Length != ConstDefinition.Length_ProvinceID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg;
                return Result;
            }

            //检查指定属性是否为空
            ProvinceInfoManager proObject = new ProvinceInfoManager();
            object proDataObject = proObject.GetProvinceData(this.Context);
            if (proObject.GetPropertyByProvinceID(ProvinceID, "ProvinceCode", proDataObject) == "")
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidProvinceID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidProvinceID_Msg;
                return Result;
            }

            //检查SPID是否为空
            if (CommonUtility.IsEmpty(SPID))
            {

                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg;
                return Result;
            }

            //检查SPID长度是否有误
            if (SPID.Length != ConstDefinition.Length_SPID)
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidSPID_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidSPID_Msg;
                return Result;
            }

            //IP是否允许访问
            Result.Result = CommonBizRules.CheckIPLimit(SPID, HttpContext.Current.Request.UserHostAddress, this.Context, out Result.ErrorDescription);
            if (Result.Result != 0)
            {
                return Result;
            }

            //接口访问权限判断
            Result.Result = CommonBizRules.CheckInterfaceLimit(SPID, "PhoneUnBind", this.Context, out Result.ErrorDescription);
            if (Result.Result != 0)
            {
                return Result;
            }
            string phone = "";
            //验证电话号码有效性
            if (!CommonBizRules.PhoneNumValid(this.Context, PhoneNum, out phone))
            {
                Result.Result = ErrorDefinition.BT_IError_Result_InValidPhoneNum_Code;
                Result.ErrorDescription = ErrorDefinition.BT_IError_Result_InValidPhoneNum_Msg;
                return Result;
            }
            PhoneNum = phone;
            #endregion

            Result.Result = BTBizRules.UnBindPhone(PhoneNum, out Result.ErrorDescription, out Result.CustID, out Result.UserAccount);
        }
        catch (Exception e)
        {
            Result.Result = ErrorDefinition.IError_Result_System_UnknowError_Code;
            Result.ErrorDescription = ErrorDefinition.IError_Result_System_UnknowError_Msg + e.Message;
        }
        finally
        {
            try
            {
                #region WriteLog
                StringBuilder msg = new StringBuilder();
                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n\r\n");
                msg.Append("电话号码解绑接口" + DateTime.Now.ToString("u") + "\r\n");
                msg.Append("ProvinceID - " + ProvinceID);
                msg.Append(";SPID - " + SPID);
                msg.Append(";PhoneNum - " + PhoneNum);
                msg.Append(";TimeStamp - " + TimeStamp + "\r\n");

                msg.Append("处理结果 - " + Result.Result);
                msg.Append("; 错误描述 - " + Result.ErrorDescription);
                msg.Append("; ProvinceID - " + Result.ProvinceID);
                msg.Append("; CustID - " + Result.CustID);
                msg.Append("; UserAccount - " + Result.UserAccount);
                msg.Append("; ExtendField - " + Result.ExtendField + "\r\n");

                msg.Append("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n");

                BTUCenterInterfaceLog.CenterForBizTourLog("PhoneUnBind", msg);
                #endregion

                CommonBizRules.WriteDataLog(SPID, Result.CustID, Result.UserAccount, Result.Result,
                    Result.ErrorDescription, PhoneNum, "PhoneUnBind");
            }
            catch { }
        }

        return Result;
    }
Esempio n. 18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        err_username.InnerHtml = "";
        err_phone_code.InnerHtml = "";
        err_page_code.InnerHtml = "";
        err_email.InnerHtml = "";
        err_password.InnerHtml = "";
        Top1.Welcome = "号码百事通用户注册";
        backCount.Value = Convert.ToString((Convert.ToInt32(backCount.Value) - 1));

        if (!Page.IsPostBack)
        {

            //地区联动--start
            ProvinceInfoManager proInfo = new ProvinceInfoManager();
            object ProData = proInfo.GetProvinceData(this.Context);
            DataSet ds = (DataSet)ProData;
            this.proInfoList.DataSource = ds;
            this.proInfoList.DataTextField = "ProvinceName";
            this.proInfoList.DataValueField = "ProvinceID";
            this.proInfoList.DataBind();

            ListItem li = new ListItem("请选择", "-999");
            proInfoList.Items.Add(li);
            proInfoList.SelectedIndex = proInfoList.Items.Count - 1;

            this.areaInfoList.Items.Add(li);
            areaInfoList.SelectedIndex = areaInfoList.Items.Count - 1;

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

            btn_OK.Attributes.Add("onclick", "return CheckInput();");
            CertificateType.Attributes.Add("onchange", "ShowCertificateInfo()");
        }

        if (proInfoList.SelectedIndex != proInfoList.Items.Count - 1)
        {
            PhoneAreaInfoManager areaInfo = new PhoneAreaInfoManager();
            object areaData = areaInfo.GetPhoneAreaData(this.Context, proInfoList.Value);
            PhoneAreaData pad = (PhoneAreaData)areaData;
            this.areaInfoList.DataSource = pad;
            this.areaInfoList.DataTextField = "AreaName";
            this.areaInfoList.DataValueField = "AreaID";
            this.areaInfoList.DataBind();
        }
        else
        {
            areaInfoList.Value = "请选择";
        }
    }