Exemple #1
0
        public int UpdateServiceConnection(CT_Wechat_CustomerServiceConnection o)
        {
            string sql = "  UPDATE CT_Wechat_CustomerServiceConnection SET CSC_Connection_dt='" + o.CSC_Connection_dt + "',  CSC_Connection_Status=" + o.CSC_Connection_Status + " WHERE CSC_AD_OPENID='" + o.CSC_AD_OpenId + "' AND CSC_CS_OpenId='" + o.CSC_CS_OpenId + "';";
            int    i   = SqlHelper.ExecuteNonQuery(sql);

            return(i);
        }
Exemple #2
0
        public int AddServiceConnection(CT_Wechat_CustomerServiceConnection o)
        {
            string sql = "INSERT INTO CT_Wechat_CustomerServiceConnection([CSC_AD_OpenId],[CSC_CS_OpenId] ,[CSC_Connection_dt],[CSC_Connection_Status]) VALUES('" + o.CSC_AD_OpenId + "','" + o.CSC_CS_OpenId + "' ,'" + o.CSC_Connection_dt + "'," + o.CSC_Connection_Status + ");";
            int    i   = SqlHelper.ExecuteNonQuery(sql);

            return(i);
        }
Exemple #3
0
        public CT_Wechat_CustomerServiceConnection GetServiceConnection(string AD_OpenId, string CS_OpenId)
        {
            string sql = "SELECT * FROM CT_Wechat_CustomerServiceConnection WHERE CSC_AD_OPENID='" + AD_OpenId + "' AND CSC_CS_OpenId='" + CS_OpenId + "';";

            CT_Wechat_CustomerServiceConnection o = DataHelper.ConvertToObject <CT_Wechat_CustomerServiceConnection>(sql);

            return(o);
        }
Exemple #4
0
        public static void AddServiceConnection(CT_Wechat_CustomerServiceConnection _o)
        {
            D_W_CustomerServiceConnection       _d_Conn_s = new D_W_CustomerServiceConnection();
            CT_Wechat_CustomerServiceConnection o         = _d_Conn_s.GetServiceConnection(_o.CSC_AD_OpenId, _o.CSC_CS_OpenId);

            if (o == null)
            {
                _d_Conn_s.AddServiceConnection(_o);
            }
            else
            {
                _d_Conn_s.UpdateServiceConnection(_o);
            }
        }
Exemple #5
0
            public static bool IsCustomConnectExpire(string CS_OpenId, int minute, out string OpenId)
            {
                CT_Wechat_CustomerServiceConnection _C = B_W_CustomerServiceConnection.GetServiceConnection(CS_OpenId, 2);

                if (_C == null)
                {
                    OpenId = null;
                    return(false);
                }
                if (_C.CSC_Connection_dt.AddMinutes(minute) < DateTime.Now)
                {
                    OpenId = null;
                    return(false);
                }
                OpenId = _C.CSC_AD_OpenId;
                return(true);
            }
Exemple #6
0
        /// <summary>
        /// 获取正则建立连接的客服信息,1代表客服,2代表客户
        /// </summary>
        /// <param name="OpenId"></param>
        /// <param name="_type"></param>
        /// <returns></returns>
        public CT_Wechat_CustomerServiceConnection GetServiceConnection(string OpenId, int _type)
        {
            string sql = string.Empty;

            if (_type == 1)
            {
                sql = "SELECT TOP 1 * FROM CT_Wechat_CustomerServiceConnection WHERE CSC_AD_OpenId='" + OpenId + "' AND CSC_Connection_Status=1 ORDER BY CSC_Connection_dt DESC;";
            }
            else if (_type == 2)
            {
                sql = "SELECT TOP 1 * FROM CT_Wechat_CustomerServiceConnection WHERE CSC_CS_OpenId='" + OpenId + "' AND CSC_Connection_Status=1 ORDER BY CSC_Connection_dt DESC;";
            }

            CT_Wechat_CustomerServiceConnection o = DataHelper.ConvertToObject <CT_Wechat_CustomerServiceConnection>(sql);

            return(o);
        }
Exemple #7
0
        public static int UpdateOnline(CT_Wechat_CustomerServiceConnection o)
        {
            int i = new D_W_CustomerServiceConnection().UpdateServiceConnection(o);

            return(i);
        }