/// <summary> 
        /// ������֤v2
        /// ���ߣ�tongbo   ʱ�䣺2009-8-14
        /// </summary>
        public static int MUserAuthV3(string SPID, string UAProvinceID,string JFProvinceID, string AuthenName, string AuthenType, MBOSSClass.AuthenRecord[] AuthenRecords, HttpContext Context, out string ErrMsg, out string CustID, out string UserAccount, out string CustType, out string outerid, out string ProvinceID,
            out string RealName, out string UserName, out string NickName, out string dealType, out int type, out string areaid)
        {
            areaid = "";
            type = 0;
            int Result = ErrorDefinition.IError_Result_UnknowError_Code;
            ErrMsg = "";
            CustID = "";
            UserAccount = "";
            CustType = "";
            UserName = "";
            NickName = "";
            RealName = "";
            string UProvinceID = "";
            string SysID = "";

            int CrmResult = ErrorDefinition.IError_Result_UnknowError_Code;

            outerid = "";
            ProvinceID = "";
            dealType = "0";

            try
            {
                //5, E�ҿ�
                //6��c���ֻ��û���
                //7��c���ֻ��û��ֻ���
                //8��ʡ����ͨ��
                //��Զ����֤
                //string AuthenTypeSpan = "5,6,7,8";
                //if (AuthenTypeSpan.IndexOf(AuthenType) < 0) //������֤
                //{
                SqlCommand cmd = new SqlCommand();
                cmd.CommandType = CommandType.StoredProcedure;
                string MSProvinceID = System.Configuration.ConfigurationManager.AppSettings["MSProvinceID"];
                if (UAProvinceID != "" && MSProvinceID.IndexOf(UAProvinceID) >= 0)
                {
                    cmd.CommandText = "dbo.up_Customer_OV3_Interface_MUserAuthV1";
                }
                else
                {
                    cmd.CommandText = "dbo.up_Customer_OV3_Interface_MUserAuthV3";
                    type = 1;
                }

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

                SqlParameter parAuthenName = new SqlParameter("@AuthenName", SqlDbType.VarChar, 256);
                parAuthenName.Value = AuthenName;
                cmd.Parameters.Add(parAuthenName);

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

                SqlParameter parAuthenRecords = new SqlParameter("@AuthenRecords", SqlDbType.Text);
                MBOSSClass.AuthenRecord[] au = new MBOSSClass.AuthenRecord[0];
                parAuthenRecords.Value = MBOSSClass.GenerateXmlForAuthenRecords(AuthenRecords == null ? au : AuthenRecords);
                cmd.Parameters.Add(parAuthenRecords);
                ErrMsg = MBOSSClass.GenerateXmlForAuthenRecords(AuthenRecords == null ? au : AuthenRecords);

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

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

                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);

                SqlParameter parCustID = new SqlParameter("@CustID ", SqlDbType.VarChar, 16);
                parCustID.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(parCustID);

                SqlParameter parUserAccount = new SqlParameter("@UserAccount ", SqlDbType.VarChar, 16);
                parUserAccount.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(parUserAccount);

                SqlParameter parCustType = new SqlParameter("@CustType ", SqlDbType.VarChar, 2);
                parCustType.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(parCustType);

                SqlParameter parUProvinceID = new SqlParameter("@UProvinceID ", SqlDbType.VarChar, 2);
                parUProvinceID.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(parUProvinceID);

                SqlParameter parSysID = new SqlParameter("@SysID ", SqlDbType.VarChar, 4);
                parSysID.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(parSysID);

                SqlParameter parAreaID = new SqlParameter("@AreaID ", SqlDbType.VarChar, 4);
                parAreaID.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(parAreaID);

                SqlParameter parOuterID = new SqlParameter("@outerid ", SqlDbType.VarChar, 30);
                parOuterID.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(parOuterID);

                SqlParameter parUserName = new SqlParameter("@UserName ", SqlDbType.VarChar, 30);
                parUserName.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(parUserName);

                SqlParameter parRealName = new SqlParameter("@RealName ", SqlDbType.VarChar, 30);
                parRealName.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(parRealName);

                SqlParameter parNickName = new SqlParameter("@NickName ", SqlDbType.VarChar, 30);
                parNickName.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(parNickName);

                SqlParameter pardealType = new SqlParameter("@dealType ", SqlDbType.VarChar, 1);
                pardealType.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(pardealType);

                DBUtility.Execute(cmd, DBUtility.BestToneCenterConStr);

                Result = int.Parse(parResult.Value.ToString());
                ErrMsg = parErrMsg.Value.ToString();
                CustID = parCustID.Value.ToString();
                UserAccount = parUserAccount.Value.ToString();
                CustType = parCustType.Value.ToString();
                UProvinceID = parUProvinceID.Value.ToString();
                SysID = parSysID.Value.ToString();
                areaid = parAreaID.Value.ToString();

                outerid = parOuterID.Value.ToString();
                ProvinceID = UProvinceID;
                dealType = pardealType.Value.ToString();

                NickName = parNickName.Value.ToString();
                UserName = parUserName.Value.ToString();
                RealName = parRealName.Value.ToString();

                return Result;

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

            return Result;
        }
Exemplo n.º 2
0
    /// <summary>
    /// 网厅返回给UA系统的可接受的帐号列表解析
    /// </summary>
    /// <param name="XmlInfo">返回的帐号列表(XML)</param>
    /// <returns></returns>
    public static MBOSSClass.AuthenRecord[] GetAccountInfoFromXML(string XmlInfo)
    {
        string XMLValue = "";
            XmlNodeList nodeList = null;
            XmlNodeList nodeList1 = null;
            MBOSSClass.AuthenRecord[] ais = new MBOSSClass.AuthenRecord[0];
            try
            {

                XmlDocument xmlReader = new XmlDocument();
                xmlReader.LoadXml(XmlInfo);

                nodeList = xmlReader.GetElementsByTagName("AccountList");
                nodeList1 = nodeList[0].SelectNodes("AccountInfo");
                ais = new MBOSSClass.AuthenRecord[nodeList1.Count];
                for (int i = 0; i < nodeList1.Count; i++)
                {
                    MBOSSClass.AuthenRecord ai = new MBOSSClass.AuthenRecord();
                    ai.AuthenName = nodeList1[0].SelectNodes("AccountID")[0].InnerText == null ? "" : nodeList1[i].SelectNodes("AccountID")[0].InnerText;
                    ai.AuthenType = nodeList1[0].SelectNodes("AccountType")[0].InnerText == null ? "" : nodeList1[i].SelectNodes("AccountType")[0].InnerText;

                    try
                    {
                        ai.areaid = "";
                        XmlNodeList node3 = nodeList1[i].SelectNodes("PWDAttrList/PWDAttr");
                        for (int r = 0; r < node3.Count; r++)
                        {
                            //     string ss = node3[r].SelectNodes("AttrName")[0].InnerText;
                            if (node3[r].SelectNodes("AttrName")[0].InnerText == "CityCode")
                            {
                                ai.areaid = node3[r].SelectNodes("AttrValue")[0].InnerText == null ? "" : node3[r].SelectNodes("AttrValue")[0].InnerText;
                            }
                        }

                    }
                    catch
                    {
                        ai.areaid = "";
                    }

                    ai.ExtendField = "";
                    switch (ai.AuthenType)
                    {
                        //case "2000001":
                        //    ai.AuthenType = "9";
                        //    break;
                        //case "2000002":
                        //    ai.AuthenType = "11";
                        //    break;
                        //case "2000003":
                        //    ai.AuthenType = "10";
                        //    break;
                        //case "2000004":
                        //    ai.AuthenType = "7";
                        //    break;
                        case "0000000":
                            ai.AuthenType = "0";
                            break;
                        default:
                            ai.AuthenType = "-1";
                            break;
                    }

                    ais[i] = ai;

                }
                // nodeValue = (nodeList1.Count != 0) ? nodeList1[0].OuterXml : "";
            }
            catch (Exception)
            { ais = new MBOSSClass.AuthenRecord[0]; }

            return ais;
    }