/// <summary> /// �Ķ�����¼ /// </summary> /// <param name="iPList">IP��ַ�б���á�,���ŷָ�</param> /// <param name="ipHistory">ʵ����</param> /// <returns>���Ƿ�ɹ�</returns> public static bool UpdateByIDList(IEnumerable<string> iPList, IpHistory ipHistory, string dbkey) { return UpdateByIDList(iPList, ipHistory, dbkey, null, null); }
/// <summary> /// �Ķ�����¼ /// </summary> /// <param name="iPList">IP��ַ�б���á�,���ŷָ�</param> /// <param name="ipHistory">ʵ����</param> /// <param name="where">��ʱ����������ͳһ��ǰ��Ҫ�����ӷ���and��or�ȵȣ�</param> /// <param name="delCache">�ijɹ��������CACHE key��֧������</param> /// <param name="dbkey">�������ݿ����ӳ��е�����key��Ϊ��ʱʹ��ConnString����</param> /// <returns>���Ƿ�ɹ�</returns> public static bool UpdateByIDList(IEnumerable<string> iPList, IpHistory ipHistory, string dbkey = "", Where where = null, string[] delCache = null) { int value = new SQL().Database(dbkey).Update(IpHistory._) .SetP(IpHistory._CreateTime, ipHistory.CreateTime) .Where(new Where() .And(IpHistory._IP, "(" + iPList .Join(",") + ")", Operator.In) ).Where(where).ToExec(); if (value <= 0) return false; if (delCache.IsNull()) return true; Cache2.Remove("TH.Mailer.IpHistoryCache_", delCache); return true; }
/// <summary> /// �ļ�¼ /// </summary> /// <param name="ipHistory">ʵ����</param> /// <returns>���Ƿ�ɹ�</returns> public static bool Update(IpHistory ipHistory, string dbkey) { return Update(ipHistory, dbkey, null, null); }
/// <summary> /// �ļ�¼ /// </summary> /// <param name="ipHistory">ʵ����</param> /// <param name="where">��ʱ����������ͳһ��ǰ��Ҫ�����ӷ���and��or�ȵȣ�</param> /// <param name="delCache">�ijɹ��������CACHE key��֧������</param> /// <param name="dbkey">�������ݿ����ӳ��е�����key��Ϊ��ʱʹ��ConnString����</param> /// <returns>���Ƿ�ɹ�</returns> public static bool Update(IpHistory ipHistory, string dbkey = "", Where where = null, string[] delCache = null) { if (ipHistory.IP.IsNullEmpty()) return false; int value = new SQL().Database(dbkey).Update(IpHistory._) .SetP(IpHistory._CreateTime, ipHistory.CreateTime) .Where(new Where() .AndP(IpHistory._IP, ipHistory.IP, Operator.Equal, true) ).Where(where).ToExec(); if (value <= 0) return false; if (delCache.IsNull()) return true; Cache2.Remove("TH.Mailer.IpHistoryCache_", delCache); return true; }
/// <summary> /// ��Ӽ�¼ /// </summary> /// <param name="ipHistory">ʵ����</param> /// <returns>����Ƿ�ɹ�</returns> public static bool Insert(IpHistory ipHistory, string dbkey) { return Insert(ipHistory, dbkey, null); }
/// <summary> /// ��Ӽ�¼ /// </summary> /// <param name="ipHistory">ʵ����</param> /// <param name="delCache">��ӳɹ��������CACHE key��֧������</param> /// <param name="dbkey">�������ݿ����ӳ��е�����key��Ϊ��ʱʹ��ConnString����</param> /// <returns>����Ƿ�ɹ�</returns> public static bool Insert(IpHistory ipHistory, string dbkey = "", string[] delCache = null) { int obj = new SQL().Database(dbkey).Insert(IpHistory._) .ValueP(IpHistory._IP, ipHistory.IP) .ValueP(IpHistory._CreateTime, ipHistory.CreateTime) .ToExec(); if (delCache.IsNull()) return obj == 1; Cache2.Remove("TH.Mailer.IpHistoryCache_", delCache); return obj == 1; }