public CT_Wechat_Online GetOnline(string OpenId) { string sql = "SELECT * FROM CT_Wechat_Online WHERE WO_OpenId='" + OpenId + "';"; CT_Wechat_Online o = DataHelper.ConvertToObject <CT_Wechat_Online>(sql); return(o); }
public static void AddOnline(string OpenId, string ON_date, string Key) { D_W_Online _d_on_s = new D_W_Online(); CT_Wechat_Online o = _d_on_s.GetOnline(OpenId); if (o == null) { _d_on_s.AddOnline(OpenId, ON_date, Key); } else { _d_on_s.UpdateOnline(OpenId, ON_date, Key); } }
/// <summary> /// 判断在指定时间内是否选择了顾问,进行聊天 /// </summary> /// <param name="second"></param> /// <returns></returns> public static bool isSelectExpire(string OpenId, CommunicatorKey Key, int second) { CT_Wechat_Online on = B_W_Online.GetOnline(OpenId); if (on == null) { return(false); } if (on.WO_Key != Key.ToString()) { return(false); } int datetime = wechatHandle.ConvertDateTimeInt(DateTime.Now); if (datetime - Convert.ToInt32(on.WO_DateTime) > second) { return(false); } return(true); }