コード例 #1
0
 public static bool Add(BanIpHistory banIpHistory)
 {
     try
     {
         var banIpHistories = BanIpHistoryAccess.Get(banIpHistory.ZoneId, banIpHistory.IP);
         if (null != banIpHistories && banIpHistories.Count > 0)
         {
             return(BanIpHistoryAccess.Update(banIpHistory));
         }
         else
         {
             return(BanIpHistoryAccess.Add(banIpHistory));
         }
     }
     catch (Exception ex)
     {
         var zoneTableId = ZoneAccess.GetZoneByZoneId(banIpHistory.ZoneId).TableID;
         AuditLogBusiness.Add(new AuditLogEntity(zoneTableId, LogLevel.Error,
                                                 $"Add ban ip histories failure, the reason is:[{ex.Message}].<br />stack trace:{ex.StackTrace}."));
         return(false);
     }
 }
コード例 #2
0
 public static void AddList(List <BanIpHistory> banIpHistory)
 {
     BanIpHistoryAccess.Add(banIpHistory);
 }