Beispiel #1
0
        /// <summary>
        /// �ͻ���Ϣ��ѯ�ӿ�
        /// ���ߣ�����   ʱ�䣺2009-8-14
        /// </summary>
        /// <param name="ProvinceID"></param>
        /// <param name="SPID"></param>
        /// <param name="UserAccount"></param>
        /// <param name="CustID"></param>
        /// <param name="CertificateCode"></param>
        /// <param name="CertificateType"></param>
        /// <param name="PhoneNum"></param>
        /// <param name="ErrMsg"></param>
        /// <param name="UserDetailInfo"></param>
        /// <returns></returns>
        public static int UserInfoQueryV2(string ProvinceID, string SPID, string UserAccount, string CustID,
            string PhoneNum, string Password, out string ErrMsg, out UserInfo UserDetailInfo, out SubscriptionRecord[] SubscriptionRecords)
        {
            int Result = ErrorDefinition.BT_IError_Result_UnknowError_Code;
            ErrMsg = "";
            UserDetailInfo = null;
            SubscriptionRecords = null;

            SqlConnection myCon = null;
            SqlCommand cmd = new SqlCommand();
            try
            {
                myCon = new SqlConnection(DBUtility.BestToneCenterConStr);
                cmd.Connection = myCon;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "up_Customer_OV3_Interface_UserInfoQuery_2";

                SqlParameter parProvinceID = new SqlParameter("@ProvinceID", SqlDbType.VarChar, 2);
                parProvinceID.Value = ProvinceID;
                cmd.Parameters.Add(parProvinceID);

                SqlParameter parSPID = new SqlParameter("@SPID", SqlDbType.VarChar, 8);
                parSPID.Value = SPID;
                cmd.Parameters.Add(parSPID);

                SqlParameter parUserAccount = new SqlParameter("@UserAccount", SqlDbType.VarChar, 16);
                parUserAccount.Value = (UserAccount == null ? "" : UserAccount);
                cmd.Parameters.Add(parUserAccount);

                SqlParameter parCustID = new SqlParameter("@CustID", SqlDbType.VarChar, 16);
                parCustID.Value = (CustID == null ? "" : CustID);
                cmd.Parameters.Add(parCustID);

                SqlParameter parPhoneNum = new SqlParameter("@PhoneNum", SqlDbType.VarChar, 20);
                parPhoneNum.Value = (PhoneNum == null ? "" : PhoneNum);
                cmd.Parameters.Add(parPhoneNum);

                SqlParameter parPassword = new SqlParameter("@Password", SqlDbType.VarChar, 6);
                parPassword.Value = Password;
                cmd.Parameters.Add(parPassword);

                SqlParameter parEncryptedPassword = new SqlParameter("@EncryptedPassword", SqlDbType.VarChar, 50);
                parEncryptedPassword.Value = (CommonUtility.IsEmpty(Password) ? "" : CryptographyUtil.Encrypt(Password));
                cmd.Parameters.Add(parEncryptedPassword);

                SqlParameter parResult = new SqlParameter("@Result", SqlDbType.Int);
                parResult.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(parResult);

                SqlParameter parErrMsg = new SqlParameter("@ErrMsg ", SqlDbType.VarChar, 256);
                parErrMsg.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(parErrMsg);

                UserDetailInfo = new UserInfo();

                //�����ĸ���
                DataSet ds = DBUtility.FillData(cmd, DBUtility.BestToneCenterConStr);

                Result = int.Parse(parResult.Value.ToString());
                ErrMsg = parErrMsg.Value.ToString();
                //����������������������֤�ɹ�
                if (Result != 0 || ErrMsg == "000")
                    return Result;

                if (ds == null)
                {
                    Result = ErrorDefinition.IError_Result_UserNotExist_Code;
                    ErrMsg = "���û���¼";
                    return Result;
                }

                string UserName = "";
                string MobilePhone = "";

                DataTable tb = new DataTable();
                tb = ds.Tables[0];
                if (tb != null)
                {
                    if (tb.Rows.Count > 0)
                    {
                        string UserType1 = tb.Rows[0]["CustType"].ToString().Trim();
                        #region �ж��Ƿ��������SPID

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

                        int SIP = OldSPID.IndexOf(SPID);

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

                        }

                        #endregion
                        UserDetailInfo.UserType = UserType1;
                        UserDetailInfo.UserAccount = tb.Rows[0]["CardID"].ToString().Trim();
                        UserDetailInfo.Password = "";
                        UserDetailInfo.CustID = tb.Rows[0]["CustID"].ToString().Trim();
                        UserDetailInfo.UProvinceID = tb.Rows[0]["ProvinceID"].ToString().Trim();
                        UserDetailInfo.AreaCode = tb.Rows[0]["AreaID"].ToString().Trim();
                        UserDetailInfo.Status = tb.Rows[0]["Status"].ToString().Trim();
                        UserDetailInfo.RealName = tb.Rows[0]["RealName"].ToString().Trim();
                        //UserDetailInfo.UserName = tb.Rows[0]["UserName"].ToString().Trim();
                        UserName = tb.Rows[0]["UserName"].ToString().Trim();
                        UserDetailInfo.CertificateCode = tb.Rows[0]["CertificateCode"].ToString().Trim();
                        UserDetailInfo.CertificateType = tb.Rows[0]["CertificateType"].ToString().Trim();
                        if (!CommonUtility.IsEmpty(tb.Rows[0]["Birthday"].ToString()))
                        {
                            UserDetailInfo.Birthday = DateTime.Parse(tb.Rows[0]["Birthday"].ToString()).ToString("yyyy-MM-dd HH:mm:ss").Trim();
                        }
                        else
                        {
                            UserDetailInfo.Birthday = "";
                        }
                        UserDetailInfo.Sex = tb.Rows[0]["Sex"].ToString().Trim();
                        UserDetailInfo.CustLevel = tb.Rows[0]["CustLevel"].ToString().Trim();
                        UserDetailInfo.EduLevel = tb.Rows[0]["EduLevel"].ToString().Trim();
                        UserDetailInfo.Favorite = tb.Rows[0]["Favorite"].ToString().Trim();
                        UserDetailInfo.IncomeLevel = tb.Rows[0]["IncomeLevel"].ToString().Trim();
                        UserDetailInfo.Email = tb.Rows[0]["Email"].ToString().Trim();
                        UserDetailInfo.EnterpriseID = tb.Rows[0]["EnterpriseID"].ToString().Trim();
                        UserDetailInfo.PaymentAccountType = "";
                        UserDetailInfo.PaymentAccount = "";
                        UserDetailInfo.PaymentAccountPassword = "";//tb.Rows[0]["PaymentAccountPassword"].ToString().Trim();
                        UserDetailInfo.CustContactTel = tb.Rows[0]["Phone"].ToString().Trim();
                        UserDetailInfo.IsPost = "";

                        if (!tb.Rows[0]["PhoneClass"].ToString().Equals("1"))
                        {
                            MobilePhone = tb.Rows[0]["Phone"].ToString().Trim();
                        }
                    }
                }

                //�󶨵绰
                tb = ds.Tables[1];
                if (tb != null)
                {
                    if (tb.Rows.Count > 0)
                    {
                        UserDetailInfo.BoundPhoneRecords = new BoundPhoneRecord[tb.Rows.Count];
                        for (int i = 0; i < tb.Rows.Count; i++)
                        {
                            BoundPhoneRecord tmpBoundPhone = new BoundPhoneRecord();
                            tmpBoundPhone.Phone = tb.Rows[i]["Phone"].ToString().Trim();
                            UserDetailInfo.BoundPhoneRecords[i] = tmpBoundPhone;
                        }
                    }
                }

                //��ϵ��Ϣ
                tb = ds.Tables[2];
                if (tb != null)
                {
                    if (tb.Rows.Count > 0)
                    {
                        UserDetailInfo.AddressRecords = new AddressRecord[tb.Rows.Count];
                        for (int i = 0; i < tb.Rows.Count; i++)
                        {
                            AddressRecord tmpAddress = new AddressRecord();
                            tmpAddress.Address = tb.Rows[i]["Address"].ToString().Trim();
                            tmpAddress.ContactTel = tb.Rows[i]["Phone"].ToString().Trim();
                            tmpAddress.LinkMan = tb.Rows[i]["RealName"].ToString().Trim();
                            tmpAddress.Zipcode = tb.Rows[i]["Zipcode"].ToString().Trim();
                            tmpAddress.Type = tb.Rows[i]["Type"].ToString().Trim();
                            UserDetailInfo.AddressRecords[i] = tmpAddress;
                        }
                    }
                }

                //������Ϣ---�Ѿ�������
                UserDetailInfo.AssessmentInfos = null;
                //tb = ds.Tables[3];
                //if (tb != null)
                //{
                //    if (tb.Rows.Count > 0)
                //    {
                //        UserDetailInfo.AssessmentInfos = new AssessmentInfoRecord[tb.Rows.Count];
                //        for (int i = 0; i < tb.Rows.Count; i++)
                //        {
                //            AssessmentInfoRecord tmpAssessMent = new AssessmentInfoRecord();
                //            tmpAssessMent.Credit = long.Parse(tb.Rows[i]["Credit"].ToString().Trim());
                //            tmpAssessMent.CreditLevel = tb.Rows[i]["CreditLevel"].ToString().Trim();
                //            tmpAssessMent.Score = long.Parse(tb.Rows[i]["Score"].ToString().Trim());
                //            tmpAssessMent.AvailableScore = long.Parse(tb.Rows[i]["AvailableScore"].ToString().Trim());
                //            UserDetailInfo.AssessmentInfos[i] = tmpAssessMent;
                //        }
                //    }
                //}

                //������¼--�Ѿ�������
                SubscriptionRecords = null;
                //tb = ds.Tables[4];
                //if (tb != null)
                //{
                //    if (tb.Rows.Count > 0)
                //    {
                //        SubscriptionRecords = new SubscriptionRecord[tb.Rows.Count];
                //        for (int i = 0; i < tb.Rows.Count; i++)
                //        {
                //            SubscriptionRecord tmpSub = new SubscriptionRecord();
                //            tmpSub.CustID = tb.Rows[i]["CustID"].ToString().Trim();
                //            tmpSub.EndTime = DateTime.Parse(tb.Rows[i]["EndTime"].ToString()).ToString("yyyy-MM-dd HH:mm:ss").Trim();
                //            tmpSub.ServiceID = tb.Rows[i]["ServiceID"].ToString().Trim();
                //            tmpSub.ServiceName = tb.Rows[i]["ServiceName"].ToString().Trim();
                //            tmpSub.StartTime = DateTime.Parse(tb.Rows[i]["StartTime"].ToString()).ToString("yyyy-MM-dd HH:mm:ss").Trim();
                //            tmpSub.SubscribeStyle = tb.Rows[i]["SubscribeStyle"].ToString().Trim();
                //            tmpSub.TransactionID = tb.Rows[i]["TransactionID"].ToString().Trim();
                //            tmpSub.UserAccount = tb.Rows[i]["UserAccount"].ToString().Trim();
                //            SubscriptionRecords[i] = tmpSub;
                //        }

                //    }
                //}

                tb = ds.Tables[3];
                //��֤��ʽ��Ϣ
                if (tb != null)
                {
                    if (tb.Rows.Count > 0)
                    {
                        //for (int i = 0; i < tb.Rows.Count; i++)
                        //{
                        //    if (tb.Rows[i]["AuthenType"].ToString().Trim() == "1") //�û���
                        //        UserName = tb.Rows[i]["AuthenName"].ToString().Trim();
                        //    else if (tb.Rows[i]["AuthenType"].ToString().Trim() == "1") //�ֻ�
                        //        MobilePhone = tb.Rows[i]["AuthenName"].ToString().Trim();
                        //}
                    }
                }
                StringBuilder sm = new StringBuilder();
                //<?xml version='1.0' encoding='gb2312' standalone='yes'?><Root><UserExtendInfo><MobilePhone></MobilePhone><UserName>moomoofarm</UserName></UserExtendInfo></Root>
                sm.Append(@"<?xml version='1.0' encoding='gb2312' standalone='yes'?><Root><UserExtendInfo><MobilePhone>");
                sm.Append(MobilePhone);
                sm.Append(@"</MobilePhone><UserName>");
                sm.Append(UserName);
                sm.Append(@"</UserName></UserExtendInfo></Root>");
                UserDetailInfo.ExtendField = sm.ToString();

            }
            catch (Exception ex)
            {
                Result = ErrorDefinition.BT_IError_Result_System_UnknowError_Code;
                ErrMsg = ex.Message;
            }

            return Result;
        }
Beispiel #2
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        //testCRMUserAuthResult resultObj = new testCRMUserAuthResult();
        //testSoap obj = new testSoap();
        //obj.Url = "http://bksvc-test.besttone.com.cn/yuan/services/CRMForBTUCenterSoap12";

        //resultObj = obj.CRMUserAuth("3501", "1", "1", "1", "1", "1", "1");

        //string ErrMsg = resultObj.ErrorDescription;
        //int Result = resultObj.Result;
        int a = 0;

        AddressInfoRecord[] addressInfoRecords = new AddressInfoRecord[4];
        addressInfoRecords[0] = new AddressInfoRecord();
        addressInfoRecords[0].Address = "aaaaaa";
        addressInfoRecords[0].Type = "01";
        addressInfoRecords[0].Zipcode = "210031";
        addressInfoRecords[0].ExtendField = "";
        addressInfoRecords[0].DealType = "0";

        addressInfoRecords[1] = new AddressInfoRecord();
        addressInfoRecords[1].Address = "bbbbb";
        addressInfoRecords[1].Type = "01";
        addressInfoRecords[1].Zipcode = "210031";
        addressInfoRecords[1].ExtendField = "";
        addressInfoRecords[1].DealType = "0";

        addressInfoRecords[2] = new AddressInfoRecord();
        addressInfoRecords[2].Address = "cccccc";
        addressInfoRecords[2].Type = "01";
        addressInfoRecords[2].Zipcode = "210031";
        addressInfoRecords[2].ExtendField = "";
        addressInfoRecords[2].DealType = "0";

        addressInfoRecords[3] = new AddressInfoRecord();
        addressInfoRecords[3].Address = "ddddd";
        addressInfoRecords[3].Type = "01";
        addressInfoRecords[3].Zipcode = "210031";
        addressInfoRecords[3].ExtendField = "";
        addressInfoRecords[3].DealType = "0";

        CIPInterfaceForBizSystem face = new CIPInterfaceForBizSystem();
        //face.QueryByPhone("11211111", "15050686791", "");
        face.CustBasicInfoQuery("01010101", "417345346", "");
        //face.CustExtendInfoQuery("11211111", "8600010191502000", "");
        //face.CustProvinceRelationQuery("11211111", "02", "02", "");
        //face.AddressInfoQuery("11211111", "8600010191502000", "");
        //face.FrequentUserUploadQuery("12111111", "8600010191502000",addressInfoRecords, "");
        //face.FrequentUserQuery("12111111", "8600010191502000", "");
        //face.UserRegistryV2("12112222", "41", "", "111111", "20", "130183", "hello", "13029999900", "1419991600", "0", "", "", "1", "");
        //face.SetPwd("12112222", "8600010191502000", "111a11", "1", "");
        //face.SetPwd("12112222", "8600010191502000", "sdfgreert", "2", "");
        face.AddressInfoUpload("11111111", "10051", addressInfoRecords, "");
        AddressRecord[] addresses = new AddressRecord[2];
        addresses[0] = new AddressRecord();
        addresses[0].Address = "上海南汇";
        addresses[0].Type = "02";
        addresses[0].Zipcode = "210031";

        addresses[1] = new AddressRecord();
        addresses[1].Address = "江苏南京";
        addresses[1].Type = "02";
        addresses[1].Zipcode = "210032";

        BoundPhoneRecord[] boundPhoneRecords = new BoundPhoneRecord[1];
        boundPhoneRecords[0] = new BoundPhoneRecord();
        boundPhoneRecords[0].Phone = "15813999999";

        UserInfo userInfo = new UserInfo();
        userInfo.UserType = "20";
        userInfo.UserAccount = "";
        userInfo.Password = "******"; ;
        userInfo.CustID = "";
        userInfo.UProvinceID = "20";
        userInfo.AreaCode = "020";
        userInfo.Status = "00";
        userInfo.RealName = "xiaotong";
        userInfo.CertificateType = "";
        userInfo.CertificateCode = "";
        userInfo.Birthday = "1999-09-29";
        userInfo.Sex = "1";
        userInfo.CustLevel = "4";
        userInfo.EduLevel = "5";
        userInfo.Favorite = "";
        userInfo.IncomeLevel = "3";
        userInfo.Email = "*****@*****.**";
        userInfo.CustContactTel = "15813999999";
        userInfo.AddressRecords = addresses;
        userInfo.BoundPhoneRecords = boundPhoneRecords;
        userInfo.ExtendField = "<?xml version='1.0' encoding='gb2312' standalone='yes'?><Root><UserName>xaotong</UserName><MobilePhone>15888866644</MobilePhone></Root>";

        BestToneUCenterForBizTour best = new BestToneUCenterForBizTour();
           // best.UserInfoQuery("20", "12342343", "203100004", "", "", DateTime.Now.ToString());
        //best.UserRegistry("20", "35000001", "05", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), userInfo);
    }