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); }
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); }
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); }
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); } }
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); }
/// <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); }
public static int UpdateOnline(CT_Wechat_CustomerServiceConnection o) { int i = new D_W_CustomerServiceConnection().UpdateServiceConnection(o); return(i); }