Ejemplo n.º 1
0
        /// <summary>
        /// Gets an IList with page of instances of BannedIPAddresse.
        /// </summary>
        public static List <BannedIPAddress> GetPage(
            int pageNumber,
            int pageSize,
            out int totalPages)
        {
            totalPages = 1;

            List <BannedIPAddress> bannedIPAddressList
                = new List <BannedIPAddress>();

            using (IDataReader reader
                       = DBBannedIP.GetPage(
                             pageNumber,
                             pageSize,
                             out totalPages))
            {
                while (reader.Read())
                {
                    BannedIPAddress bannedIPAddress = new BannedIPAddress();
                    bannedIPAddress.rowID        = Convert.ToInt32(reader["RowID"]);
                    bannedIPAddress.bannedIP     = reader["BannedIP"].ToString();
                    bannedIPAddress.bannedUTC    = Convert.ToDateTime(reader["BannedUTC"]);
                    bannedIPAddress.bannedReason = reader["BannedReason"].ToString();
                    bannedIPAddressList.Add(bannedIPAddress);
                }
            }

            return(bannedIPAddressList);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets an IList with all instances of BannedIPAddress.
        /// </summary>
        public static List <BannedIPAddress> GetAll()
        {
            List <BannedIPAddress> bannedIPAddressList
                = new List <BannedIPAddress>();

            using (IDataReader reader = DBBannedIP.GetAll())
            {
                while (reader.Read())
                {
                    BannedIPAddress bannedIPAddress = new BannedIPAddress();
                    bannedIPAddress.rowID        = Convert.ToInt32(reader["RowID"]);
                    bannedIPAddress.bannedIP     = reader["BannedIP"].ToString();
                    bannedIPAddress.bannedUTC    = Convert.ToDateTime(reader["BannedUTC"]);
                    bannedIPAddress.bannedReason = reader["BannedReason"].ToString();
                    bannedIPAddressList.Add(bannedIPAddress);
                }
            }

            return(bannedIPAddressList);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Compares 2 instances of BannedIPAddresse.
 /// </summary>
 public static int CompareByBannedReason(BannedIPAddress bannedIPAddress1, BannedIPAddress bannedIPAddress2)
 {
     return(bannedIPAddress1.BannedReason.CompareTo(bannedIPAddress2.BannedReason));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Compares 2 instances of BannedIPAddresse.
 /// </summary>
 public static int CompareByBannedUtc(BannedIPAddress bannedIPAddress1, BannedIPAddress bannedIPAddress2)
 {
     return(bannedIPAddress1.BannedUtc.CompareTo(bannedIPAddress2.BannedUtc));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Compares 2 instances of BannedIPAddresse.
 /// </summary>
 public static int CompareByRowId(BannedIPAddress bannedIPAddress1, BannedIPAddress bannedIPAddress2)
 {
     return(bannedIPAddress1.RowId.CompareTo(bannedIPAddress2.RowId));
 }