Esempio n. 1
0
        /// <summary>
        /// ��ȡ�û�������ʶ������û���Ϣ
        /// </summary>
        public static BasicInfoV2Record[] GetQueryByUserName(string SPID, string UserName, out int Result, out string ErrMsg)
        {
            List<BasicInfoV2Record> BasicInfoList = new List<BasicInfoV2Record>();
            ErrMsg = "";
            Result = ErrorDefinition.IError_Result_UnknowError_Code;

            SqlConnection myCon = null;
            SqlCommand cmd = new SqlCommand();
            DataSet ds = null;

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

                SqlParameter parUserName = new SqlParameter("@UserName", SqlDbType.VarChar, 20);
                parUserName.Value = UserName;
                cmd.Parameters.Add(parUserName);

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

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

                ds = DBUtility.FillData(cmd, DBUtility.BestToneCenterConStr);
                if (ds != null)
                    if (ds.Tables.Count != 0)
                        if (ds.Tables[0].Rows.Count != 0)
                        {
                            int RowCount = ds.Tables[0].Rows.Count;

                            BasicInfoV2Record rs = new BasicInfoV2Record();
                            for (int i = 0; i < RowCount; i++)
                            {
                                string strSourceSPID = ds.Tables[0].Rows[i]["SourceSPID"].ToString().Trim();

                                rs = new BasicInfoV2Record();
                                rs.CustID = ds.Tables[0].Rows[i]["CustID"].ToString().Trim();
                                rs.CustType = ds.Tables[0].Rows[i]["CustType"].ToString().Trim();
                                rs.PhoneClass = ds.Tables[0].Rows[i]["PhoneClass"].ToString().Trim();
                                rs.RealName = ds.Tables[0].Rows[i]["RealName"].ToString().Trim();
                                rs.Sex = ds.Tables[0].Rows[i]["Sex"].ToString().Trim();
                                BasicInfoList.Add(rs);

                            }
                        }
                Result = int.Parse(parResult.Value.ToString());
            }
            catch (Exception e)
            {
                Result = ErrorDefinition.IError_Result_System_UnknowError_Code;
                ErrMsg = "��ȡ�û���ʶ����Ϣ�����" + e.Message;
            }

            return BasicInfoList.ToArray();
        }
Esempio n. 2
0
        /// <summary>
        /// ��ѯ�ͻ���Դ
        /// </summary>
        public static string QueryCustFrom(string SPID, string CustID, out int Result, out string ErrMsg)
        {
            string custfrom = "";
            ErrMsg = "";
            Result = ErrorDefinition.IError_Result_UnknowError_Code;
            SqlConnection myCon = null;
            SqlCommand cmd = new SqlCommand();
            DataSet ds = null;
            try
            {
                myCon = new SqlConnection(DBUtility.BestToneCenterConStr);
                cmd.Connection = myCon;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "up_Customer_V3_Interface_QueryCustFrom";

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

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

                ds = DBUtility.FillData(cmd, DBUtility.BestToneCenterConStr);
                if (ds != null)
                    if (ds.Tables.Count != 0)
                        if (ds.Tables[0].Rows.Count != 0)
                        {
                            int RowCount = ds.Tables[0].Rows.Count;

                            BasicInfoV2Record rs = new BasicInfoV2Record();
                            for (int i = 0; i < RowCount; i++)
                            {
                                custfrom = ds.Tables[0].Rows[i]["fromContent"].ToString().Trim();
                            }
                        }
                Result = int.Parse(parResult.Value.ToString());
            }
            catch (Exception e)
            {
                Result = ErrorDefinition.IError_Result_System_UnknowError_Code;
                ErrMsg = "��ѯ�ͻ���Դ�����" + e.Message;
            }

            return custfrom;
        }
Esempio n. 3
0
        /// <summary>
        /// 获取主叫号码返回识别出的用户信息
        /// </summary>
        public static BasicInfoV2Record[] GetQueryByPhone(string SPID, string PhoneNum, out int Result, out string ErrMsg)
        {
            List<BasicInfoV2Record> BasicInfoList = new List<BasicInfoV2Record>();
            ErrMsg = "";
            Result = ErrorDefinition.IError_Result_UnknowError_Code;

            SqlConnection myCon = null;
            SqlCommand cmd = new SqlCommand();
            DataSet ds = null;
            StringBuilder msg = new StringBuilder();
            try
            {
                myCon = new SqlConnection(DBUtility.BestToneCenterConStr);
                cmd.Connection = myCon;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "up_Customer_V3_Interface_QueryByPhone";

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

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

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

                ds = DBUtility.FillData(cmd, DBUtility.BestToneCenterConStr);
                if (ds != null)
                    if (ds.Tables.Count != 0)
                        if (ds.Tables[0].Rows.Count != 0)
                        {
                            int RowCount = ds.Tables[0].Rows.Count;

                            BasicInfoV2Record rs = new BasicInfoV2Record();
                            for (int i = 0; i < RowCount; i++)
                            {
                                string strSourceSPID = ds.Tables[0].Rows[i]["SourceSPID"].ToString().Trim();

                                rs = new BasicInfoV2Record();
                                rs.CustID = ds.Tables[0].Rows[i]["CustID"].ToString().Trim();
                                rs.CustType = ds.Tables[0].Rows[i]["CustType"].ToString().Trim();
                                rs.PhoneClass = ds.Tables[0].Rows[i]["PhoneClass"].ToString().Trim();
                                rs.RealName = ds.Tables[0].Rows[i]["RealName"].ToString().Trim();
                                rs.Sex = ds.Tables[0].Rows[i]["Sex"].ToString().Trim();

                                //积分商城用户可以取得所有客户信息,其他系统用户只能看到号百客户信息
                                if (strScoreBesttonePSID == SPID)
                                {
                                    BasicInfoList.Add(rs);
                                }
                                else
                                {
                                    if ("41".Equals(rs.CustType) || "42".Equals(rs.CustType))
                                    {
                                        BasicInfoList.Add(rs);
                                    }
                                }
                            }
                        }
                Result = int.Parse(parResult.Value.ToString());
            }
            catch (Exception e)
            {
                Result = ErrorDefinition.IError_Result_System_UnknowError_Code;
                ErrMsg = "获取电话识别信息出错," + e.Message;
                msg.AppendFormat(e.ToString());
            }
            finally {
                BTUCenterInterfaceLog.CenterForBizTourLog("QueryByPhone", msg);
            }

            return BasicInfoList.ToArray();
        }