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); }
/// <summary> /// Compares 2 instances of UserLocation. /// </summary> public static int CompareByLastCaptureUTC(UserLocation userLocation1, UserLocation userLocation2) { return(userLocation1.LastCaptureUTC.CompareTo(userLocation2.LastCaptureUTC)); }
/// <summary> /// Compares 2 instances of UserLocation. /// </summary> public static int CompareByCaptureCount(UserLocation userLocation1, UserLocation userLocation2) { return(userLocation1.CaptureCount.CompareTo(userLocation2.CaptureCount)); }
/// <summary> /// Compares 2 instances of UserLocation. /// </summary> public static int CompareByTimeZone(UserLocation userLocation1, UserLocation userLocation2) { return(userLocation1.TimeZone.CompareTo(userLocation2.TimeZone)); }
/// <summary> /// Compares 2 instances of UserLocation. /// </summary> public static int CompareByCity(UserLocation userLocation1, UserLocation userLocation2) { return(userLocation1.City.CompareTo(userLocation2.City)); }
/// <summary> /// Compares 2 instances of UserLocation. /// </summary> public static int CompareByRegion(UserLocation userLocation1, UserLocation userLocation2) { return(userLocation1.Region.CompareTo(userLocation2.Region)); }
/// <summary> /// Compares 2 instances of UserLocation. /// </summary> public static int CompareByContinent(UserLocation userLocation1, UserLocation userLocation2) { return(userLocation1.Continent.CompareTo(userLocation2.Continent)); }
/// <summary> /// Compares 2 instances of UserLocation. /// </summary> public static int CompareByISP(UserLocation userLocation1, UserLocation userLocation2) { return(userLocation1.ISP.CompareTo(userLocation2.ISP)); }
/// <summary> /// Compares 2 instances of UserLocation. /// </summary> public static int CompareByHostname(UserLocation userLocation1, UserLocation userLocation2) { return(userLocation1.Hostname.CompareTo(userLocation2.Hostname)); }
/// <summary> /// Compares 2 instances of UserLocation. /// </summary> public static int CompareByIPAddress(UserLocation userLocation1, UserLocation userLocation2) { return(userLocation1.IPAddress.CompareTo(userLocation2.IPAddress)); }