Exemple #1
0
        /// <summary>
        /// Persists a new instance of UserLocation. Returns true on success.
        /// </summary>
        /// <returns></returns>
        private bool Create()
        {
            this.rowID = Guid.NewGuid();;

            int rowsAffected = DBUserLocation.Create(
                this.rowID,
                this.userGuid,
                this.siteGuid,
                this.iPAddress,
                this.iPAddressLong,
                this.hostname,
                this.longitude,
                this.latitude,
                this.iSP,
                this.continent,
                this.country,
                this.region,
                this.city,
                this.timeZone,
                this.captureCount,
                DateTime.UtcNow,
                DateTime.UtcNow);

            return(rowsAffected > 0);
        }
Exemple #2
0
 private void GetUserLocation(Guid userGuid, long iPAddressLong)
 {
     using (IDataReader reader = DBUserLocation.GetOne(userGuid, iPAddressLong))
     {
         PopulateFromReader(reader);
     }
 }
Exemple #3
0
 /// <summary>
 /// Gets an instance of UserLocation.
 /// </summary>
 /// <param name="rowID"> rowID </param>
 private void GetUserLocation(Guid rowID)
 {
     using (IDataReader reader = DBUserLocation.GetOne(rowID))
     {
         PopulateFromReader(reader);
     }
 }
Exemple #4
0
        /// <summary>
        /// Gets an IList with page of instances of UserLocation.
        /// </summary>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="pageNumber">The page number.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="totalPages">total pages</param>
        public static List <UserLocation> GetPageBySite(
            Guid siteGuid,
            int pageNumber,
            int pageSize,
            out int totalPages)
        {
            totalPages = 1;
            IDataReader reader = DBUserLocation.GetPageBySite(siteGuid, pageNumber, pageSize, out totalPages);

            return(LoadListFromReader(reader));
        }
Exemple #5
0
 /// <summary>
 /// Updates this instance of UserLocation. Returns true on success.
 /// </summary>
 /// <returns>bool</returns>
 private bool Update()
 {
     return(DBUserLocation.Update(
                this.rowID,
                this.userGuid,
                this.siteGuid,
                this.iPAddress,
                this.iPAddressLong,
                this.hostname,
                this.longitude,
                this.latitude,
                this.iSP,
                this.continent,
                this.country,
                this.region,
                this.city,
                this.timeZone,
                this.captureCount + 1,
                DateTime.UtcNow));
 }
Exemple #6
0
 /// <summary>
 /// Gets an IDataReader with rows from the mp_Users table which have the passed in IP Address
 /// </summary>
 public static IDataReader GetUsersByIPAddress(Guid siteGuid, string ipv4Address)
 {
     return(DBUserLocation.GetUsersByIPAddress(siteGuid, ipv4Address));
 }
Exemple #7
0
        /// <summary>
        /// Gets an IList with all instances of UserLocation for the site.
        /// </summary>
        /// <param name="siteGuid"> siteGuid </param>
        public static List <UserLocation> GetBySite(Guid siteGuid)
        {
            IDataReader reader = DBUserLocation.GetBySite(siteGuid);

            return(LoadListFromReader(reader));
        }
Exemple #8
0
        /// <summary>
        /// Gets an IList with all instances of UserLocation for the user.
        /// </summary>
        /// <param name="userGuid"> userGuid </param>
        public static List <UserLocation> GetByUser(Guid userGuid)
        {
            IDataReader reader = DBUserLocation.GetByUser(userGuid);

            return(LoadListFromReader(reader));
        }
Exemple #9
0
 /// <summary>
 /// Gets a count of UserLocation.
 /// </summary>
 public static int GetCountBySite(Guid siteGuid)
 {
     return(DBUserLocation.GetCountBySite(siteGuid));
 }
Exemple #10
0
 /// <summary>
 /// Gets a count of UserLocation.
 /// </summary>
 public static int GetCountByUser(Guid userGuid)
 {
     return(DBUserLocation.GetCountByUser(userGuid));
 }
Exemple #11
0
 public static bool DeleteByUser(Guid userGuid)
 {
     return(DBUserLocation.DeleteByUser(userGuid));
 }
Exemple #12
0
 /// <summary>
 /// Deletes an instance of UserLocation. Returns true on success.
 /// </summary>
 /// <param name="rowID"> rowID </param>
 /// <returns>bool</returns>
 public static bool Delete(Guid rowID)
 {
     return(DBUserLocation.Delete(rowID));
 }