コード例 #1
0
 /// <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);
 }
コード例 #2
0
 /// <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;
 }
コード例 #3
0
 /// <summary>
 /// �޸ļ�¼
 /// </summary>
 /// <param name="ipHistory">ʵ����</param>
 /// <returns>�޸��Ƿ�ɹ�</returns>
 public static bool Update(IpHistory ipHistory, string dbkey)
 {
     return Update(ipHistory, dbkey, null, null);
 }
コード例 #4
0
 /// <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;
 }
コード例 #5
0
 /// <summary>
 /// ��Ӽ�¼
 /// </summary>
 /// <param name="ipHistory">ʵ����</param>
 /// <returns>����Ƿ�ɹ�</returns>
 public static bool Insert(IpHistory ipHistory, string dbkey)
 {
     return Insert(ipHistory, dbkey, null);
 }
コード例 #6
0
 /// <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;
 }