示例#1
0
        private static List <UserLocation> LoadListFromReader(IDataReader reader)
        {
            List <UserLocation> userLocationList = new List <UserLocation>();

            try
            {
                while (reader.Read())
                {
                    UserLocation userLocation = new UserLocation();
                    userLocation.rowID           = new Guid(reader["RowID"].ToString());
                    userLocation.userGuid        = new Guid(reader["UserGuid"].ToString());
                    userLocation.siteGuid        = new Guid(reader["SiteGuid"].ToString());
                    userLocation.iPAddress       = reader["IPAddress"].ToString();
                    userLocation.iPAddressLong   = Convert.ToInt64(reader["IPAddressLong"]);
                    userLocation.hostname        = reader["Hostname"].ToString();
                    userLocation.longitude       = Convert.ToDouble(reader["Longitude"]);
                    userLocation.latitude        = Convert.ToDouble(reader["Latitude"]);
                    userLocation.iSP             = reader["ISP"].ToString();
                    userLocation.continent       = reader["Continent"].ToString();
                    userLocation.country         = reader["Country"].ToString();
                    userLocation.region          = reader["Region"].ToString();
                    userLocation.city            = reader["City"].ToString();
                    userLocation.timeZone        = reader["TimeZone"].ToString();
                    userLocation.captureCount    = Convert.ToInt32(reader["CaptureCount"]);
                    userLocation.firstCaptureUTC = Convert.ToDateTime(reader["FirstCaptureUTC"]);
                    userLocation.lastCaptureUTC  = Convert.ToDateTime(reader["LastCaptureUTC"]);
                    userLocationList.Add(userLocation);
                }
            }
            finally
            {
                reader.Close();
            }

            return(userLocationList);
        }
示例#2
0
 /// <summary>
 /// Compares 2 instances of UserLocation.
 /// </summary>
 public static int CompareByLastCaptureUTC(UserLocation userLocation1, UserLocation userLocation2)
 {
     return(userLocation1.LastCaptureUTC.CompareTo(userLocation2.LastCaptureUTC));
 }
示例#3
0
 /// <summary>
 /// Compares 2 instances of UserLocation.
 /// </summary>
 public static int CompareByCaptureCount(UserLocation userLocation1, UserLocation userLocation2)
 {
     return(userLocation1.CaptureCount.CompareTo(userLocation2.CaptureCount));
 }
示例#4
0
 /// <summary>
 /// Compares 2 instances of UserLocation.
 /// </summary>
 public static int CompareByTimeZone(UserLocation userLocation1, UserLocation userLocation2)
 {
     return(userLocation1.TimeZone.CompareTo(userLocation2.TimeZone));
 }
示例#5
0
 /// <summary>
 /// Compares 2 instances of UserLocation.
 /// </summary>
 public static int CompareByCity(UserLocation userLocation1, UserLocation userLocation2)
 {
     return(userLocation1.City.CompareTo(userLocation2.City));
 }
示例#6
0
 /// <summary>
 /// Compares 2 instances of UserLocation.
 /// </summary>
 public static int CompareByRegion(UserLocation userLocation1, UserLocation userLocation2)
 {
     return(userLocation1.Region.CompareTo(userLocation2.Region));
 }
示例#7
0
 /// <summary>
 /// Compares 2 instances of UserLocation.
 /// </summary>
 public static int CompareByContinent(UserLocation userLocation1, UserLocation userLocation2)
 {
     return(userLocation1.Continent.CompareTo(userLocation2.Continent));
 }
示例#8
0
 /// <summary>
 /// Compares 2 instances of UserLocation.
 /// </summary>
 public static int CompareByISP(UserLocation userLocation1, UserLocation userLocation2)
 {
     return(userLocation1.ISP.CompareTo(userLocation2.ISP));
 }
示例#9
0
 /// <summary>
 /// Compares 2 instances of UserLocation.
 /// </summary>
 public static int CompareByHostname(UserLocation userLocation1, UserLocation userLocation2)
 {
     return(userLocation1.Hostname.CompareTo(userLocation2.Hostname));
 }
示例#10
0
 /// <summary>
 /// Compares 2 instances of UserLocation.
 /// </summary>
 public static int CompareByIPAddress(UserLocation userLocation1, UserLocation userLocation2)
 {
     return(userLocation1.IPAddress.CompareTo(userLocation2.IPAddress));
 }