Ejemplo n.º 1
0
        internal static int _update(DbContentHit dbContentHit)
        {
            Database  database;
            DbCommand dbCommand;

            database = DatabaseFactory.CreateDatabase();

            dbCommand = database.GetSqlStringCommand("UPDATE kitCms_Hits SET UserID=@UserID," +
                                                     "UserAgent=@UserAgent," +
                                                     "UserHostAddress=@UserHostAddress," +
                                                     "UserHostName=@UserHostName," +
                                                     "RequestDate=@RequestDate," +
                                                     "RequestReferrer=@RequestReferrer," +
                                                     "RequestContentID=@RequestContentID," +
                                                     "IsUnique=@IsUnique WHERE DbContentHitID=@DbContentHitID;");

            fillParameters(database, dbCommand, dbContentHit);
            database.AddInParameter(dbCommand, "DbContentHitID", DbType.Int32, dbContentHit.iD);
            // Abandon remaining updates if no rows have been updated by returning false immediately.
            if (database.ExecuteNonQuery(dbCommand) == 0)
            {
                return(-1);
            }

            return(dbContentHit.iD);
        }
Ejemplo n.º 2
0
        internal static bool _fill(DbContentHit dbContentHit)
        {
            StringBuilder query;
            Database      database;
            DbCommand     dbCommand;

            query = new StringBuilder("SELECT ");
            query.Append(string.Join(",", InnerJoinFields));
            query.Append(" FROM kitCms_Hits WHERE DbContentHitID=");
            query.Append(dbContentHit.iD);
            query.Append(";");

            database  = DatabaseFactory.CreateDatabase();
            dbCommand = database.GetSqlStringCommand(query.ToString());
            IDataReader r = database.ExecuteReader(dbCommand);

            if (!r.Read())
            {
                throw(new Exception(string.Format("Cannot find DbContentHitID '{0}'.",
                                                  dbContentHit.iD)));
            }

            FillFromReader(dbContentHit, r, 0, 1);

            return(true);
        }
Ejemplo n.º 3
0
        private static void fillParameters(Database database, DbCommand dbCommand, DbContentHit dbContentHit)
        {
            #region General

            if (dbContentHit.user == null)
            {
                addParameter(database, dbCommand, "UserID", DbType.Int32, DBNull.Value);
            }
            else
            {
                addParameter(database, dbCommand, "UserID", DbType.Int32, dbContentHit.user.ID);
            }
            addParameter(database, dbCommand, "UserAgent", DbType.String, dbContentHit.userAgent);
            addParameter(database, dbCommand, "UserHostAddress", DbType.String, dbContentHit.userHostAddress);
            addParameter(database, dbCommand, "UserHostName", DbType.String, dbContentHit.userHostName);
            addParameter(database, dbCommand, "RequestDate", DbType.Date, dbContentHit.requestDate);
            addParameter(database, dbCommand, "RequestReferrer", DbType.String, dbContentHit.requestReferrer);
            if (dbContentHit.requestContent == null)
            {
                addParameter(database, dbCommand, "RequestContentID", DbType.Int32, DBNull.Value);
            }
            else
            {
                addParameter(database, dbCommand, "RequestContentID", DbType.Int32, dbContentHit.requestContent.ID);
            }
            addParameter(database, dbCommand, "IsUnique", DbType.Boolean, dbContentHit.isUnique);

            #endregion
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Deep copies the current DbContentHit to another instance of DbContentHit.
        /// </summary>
        /// <param name="DbContentHit">The DbContentHit to copy to.</param>
        /// <param name="isolation">Placeholders are used to isolate the DbContentHit from its children.</param>
        public void CopyTo(DbContentHit dbContentHit, bool isolation)
        {
            dbContentHit.iD              = iD;
            dbContentHit.isPlaceHolder   = isPlaceHolder;
            dbContentHit.isSynced        = isSynced;
            dbContentHit.userAgent       = userAgent;
            dbContentHit.userHostAddress = userHostAddress;
            dbContentHit.userHostName    = userHostName;
            dbContentHit.requestDate     = requestDate;
            dbContentHit.requestReferrer = requestReferrer;
            dbContentHit.isUnique        = isUnique;

            if (user != null)
            {
                if (isolation)
                {
                    dbContentHit.user = user.NewPlaceHolder();
                }
                else
                {
                    dbContentHit.user = user.Copy(false);
                }
            }
            if (requestContent != null)
            {
                if (isolation)
                {
                    dbContentHit.requestContent = requestContent.NewPlaceHolder();
                }
                else
                {
                    dbContentHit.requestContent = requestContent.Copy(false);
                }
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Makes a deep copy of the current DbContentHit.
        /// </summary>
        /// <returns> A new DbContentHit object reflecting the cloned DbContentHit object.</returns>
        public DbContentHit Copy()
        {
            DbContentHit dbContentHit = new DbContentHit();

            CopyTo(dbContentHit);
            return(dbContentHit);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Makes a deep copy of the current DbContentHit.
        /// </summary>
        /// <returns> A new DbContentHit object reflecting the cloned DbContentHit object.</returns>
        /// <param name="isolation">Placeholders are used to isolate the DbContentHit from its children.</param>
        public DbContentHit Copy(bool isolation)
        {
            DbContentHit dbContentHit = new DbContentHit();

            CopyTo(dbContentHit, isolation);
            return(dbContentHit);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Clones DbContentHit object and clones child objects with cloning or replication.
        /// as the parent object.
        /// </summary>
        /// <returns> A new DbContentHit object reflecting the replicated DbContentHit object.</returns>
        public DbContentHit Clone()
        {
            DbContentHit clonedDbContentHit = new DbContentHit();

            clonedDbContentHit.iD              = iD;
            clonedDbContentHit.isSynced        = isSynced;
            clonedDbContentHit.userAgent       = userAgent;
            clonedDbContentHit.userHostAddress = userHostAddress;
            clonedDbContentHit.userHostName    = userHostName;
            clonedDbContentHit.requestDate     = requestDate;
            clonedDbContentHit.requestReferrer = requestReferrer;
            clonedDbContentHit.isUnique        = isUnique;


            if (user != null)
            {
                clonedDbContentHit.user = user;
            }

            if (requestContent != null)
            {
                clonedDbContentHit.requestContent = requestContent;
            }

            return(clonedDbContentHit);
        }
Ejemplo n.º 8
0
        public static DbContentHit ParseFromReader(IDataReader r, int idOffset, int dataOffset)
        {
            DbContentHit dbContentHit = new DbContentHit();

            FillFromReader(dbContentHit, r, idOffset, dataOffset);
            return(dbContentHit);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Inserts a DbContentHit into the database. All children should have been
        /// saved to the database before insertion. New children will not be
        /// related to this object in the database.
        /// </summary>
        /// <param name="_DbContentHit">The DbContentHit to insert into the database.</param>
        internal static int _insert(DbContentHit dbContentHit)
        {
            int       id;
            string    query;
            Database  database;
            DbCommand dbCommand;

            database = DatabaseFactory.CreateDatabase();

            query = "INSERT INTO kitCms_Hits" +
                    "(," +
                    "UserID," +
                    "UserAgent," +
                    "UserHostAddress," +
                    "UserHostName," +
                    "RequestDate," +
                    "RequestReferrer," +
                    "RequestContentID," +
                    "IsUnique) VALUES (," +
                    "@UserID," +
                    "@UserAgent," +
                    "@UserHostAddress," +
                    "@UserHostName," +
                    "@RequestDate," +
                    "@RequestReferrer," +
                    "@RequestContentID," +
                    "@IsUnique);";

            dbCommand = database.GetSqlStringCommand(query);
            fillParameters(database, dbCommand, dbContentHit);
            database.ExecuteNonQuery(dbCommand);
            dbCommand = database.GetSqlStringCommand("SELECT @@IDENTITY AS IDVal");
            id        = (int)database.ExecuteScalar(dbCommand);
            return(id);
        }
Ejemplo n.º 10
0
        public int SaveHit(System.Web.HttpRequest request, bool isUnique, GreyFoxUser user)
        {
            DbContentHit hit = new DbContentHit();

            hit.User            = user;
            hit.UserAgent       = request.UserAgent;
            hit.UserHostAddress = request.UserHostAddress;
            hit.UserHostName    = request.UserHostName;
            hit.RequestDate     = DateTime.Now;
            hit.IsUnique        = isUnique;
            if (request.UrlReferrer != null)
            {
                hit.RequestReferrer = request.UrlReferrer.ToString();

                if (hit.RequestReferrer.Length > 255)
                {
                    hit.RequestReferrer = hit.RequestReferrer.Substring(0, 255);
                }
            }
            else
            {
                hit.RequestReferrer = "None";
            }
            hit.RequestContent = this;
            return(hit.Save());
        }
Ejemplo n.º 11
0
        public static DbContentHit NewPlaceHolder(int iD)
        {
            DbContentHit dbContentHit = new DbContentHit();

            dbContentHit.iD            = iD;
            dbContentHit.isPlaceHolder = true;
            dbContentHit.isSynced      = true;
            return(dbContentHit);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Duplicates DbContentHit object into a database; may or may not be the same database
        /// as the parent object.
        /// </summary>
        /// <returns> A new DbContentHit object reflecting the replicated DbContentHit object.</returns>
        public DbContentHit Duplicate()
        {
            DbContentHit clonedDbContentHit = this.Clone();

            // Insert must be called after children are replicated!
            clonedDbContentHit.iD       = DbContentHitManager._insert(clonedDbContentHit);
            clonedDbContentHit.isSynced = true;
            return(clonedDbContentHit);
        }
Ejemplo n.º 13
0
        public bool Equals(DbContentHit dbContentHit)
        {
            if (dbContentHit == null)
            {
                return(false);
            }

            return(this.iD == dbContentHit.iD);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Inserts a DbContentHit into the database. All children should have been
        /// saved to the database before insertion. New children will not be
        /// related to this object in the database.
        /// </summary>
        /// <param name="_DbContentHit">The DbContentHit to insert into the database.</param>
        internal static int _insert(DbContentHit dbContentHit)
        {
            int       id;
            string    query;
            Database  database;
            DbCommand dbCommand;

            database = DatabaseFactory.CreateDatabase();

            query = "INSERT INTO kitCms_Hits " +
                    "(" +
                    "UserID," +
                    "UserAgent," +
                    "UserHostAddress," +
                    "UserHostName," +
                    "RequestDate," +
                    "RequestReferrer," +
                    "RequestContentID," +
                    "IsUnique) VALUES (" +
                    "@UserID," +
                    "@UserAgent," +
                    "@UserHostAddress," +
                    "@UserHostName," +
                    "@RequestDate," +
                    "@RequestReferrer," +
                    "@RequestContentID," +
                    "@IsUnique);";

            if (database.ConnectionStringWithoutCredentials.StartsWith("provider=microsoft.jet.oledb.4.0"))
            {
                // Microsoft Access
                // Connection must remain open for IDENTITY to return correct value,
                // therefore use the dbCommand object's Connection directly to control
                // connection state.
                dbCommand = database.GetSqlStringCommand(query);
                fillParameters(database, dbCommand, dbContentHit);
                dbCommand.Connection = database.CreateConnection();
                dbCommand.Connection.Open();
                dbCommand.ExecuteNonQuery();
                dbCommand.CommandText = "SELECT @@IDENTITY AS LastID";
                id = (int)dbCommand.ExecuteScalar();
                dbCommand.Connection.Close();
            }
            else
            {
                //// Microsoft SQL Server
                dbCommand = database.GetSqlStringCommand(query + " SELECT @LastID = SCOPE_IDENTITY();");
                fillParameters(database, dbCommand, dbContentHit);
                database.AddOutParameter(dbCommand, "@LastID", DbType.Int32, 10);
                database.ExecuteNonQuery(dbCommand);
                id = (int)dbCommand.Parameters["@LastID"].Value;
            }
            return(id);
        }
Ejemplo n.º 15
0
        public void Remove(DbContentHit value)
        {
            OnCollectionChanged(EventArgs.Empty);
            int index = IndexOf(value);

            if (index == -1)
            {
                throw(new Exception("DbContentHit not found in collection."));
            }
            RemoveAt(index);
        }
Ejemplo n.º 16
0
 public int IndexOf(DbContentHit value)
 {
     lock (this)
     {
         for (int x = 0; x < count; x++)
         {
             if (DbContentHitArray[x].Equals(value))
             {
                 return(x);
             }
         }
         return(-1);
     }
 }
Ejemplo n.º 17
0
 public int Add(DbContentHit value)
 {
     OnCollectionChanged(EventArgs.Empty);
     lock (this)
     {
         count++;
         // Resize the array if the count is greater than the length
         // of the array.
         if (count > DbContentHitArray.GetUpperBound(0) + 1)
         {
             DbContentHit[] tempDbContentHitArray = new DbContentHit[count * 2];
             Array.Copy(DbContentHitArray, tempDbContentHitArray, count - 1);
             DbContentHitArray = tempDbContentHitArray;
         }
         DbContentHitArray[count - 1] = value;
     }
     return(count - 1);
 }
Ejemplo n.º 18
0
 public void Insert(int index, DbContentHit value)
 {
     OnCollectionChanged(EventArgs.Empty);
     lock (this)
     {
         count++;
         // Resize the array if the count is greater than the length
         // of the array.
         if (count > DbContentHitArray.GetUpperBound(0) + 1)
         {
             DbContentHit[] tempDbContentHitArray = new DbContentHit[count * 2];
             Array.Copy(DbContentHitArray, tempDbContentHitArray, count - 1);
             DbContentHitArray = tempDbContentHitArray;
         }
         for (int x = index + 1; x == count - 2; x++)
         {
             DbContentHitArray[x] = DbContentHitArray[x - 1];
         }
         DbContentHitArray[index] = value;
     }
 }
Ejemplo n.º 19
0
        /// <summary>
        /// Fills the {0} from a OleIDataReader.
        /// </summary>
        public static void FillFromReader(DbContentHit dbContentHit, IDataReader r, int idOffset, int dataOffset)
        {
            dbContentHit.iD            = r.GetInt32(idOffset);
            dbContentHit.isSynced      = true;
            dbContentHit.isPlaceHolder = false;

            if (!r.IsDBNull(0 + dataOffset) && r.GetInt32(0 + dataOffset) > 0)
            {
                dbContentHit.user = GreyFoxUser.NewPlaceHolder(r.GetInt32(0 + dataOffset));
            }
            dbContentHit.userAgent       = r.GetString(1 + dataOffset);
            dbContentHit.userHostAddress = r.GetString(2 + dataOffset);
            dbContentHit.userHostName    = r.GetString(3 + dataOffset);
            dbContentHit.requestDate     = r.GetDateTime(4 + dataOffset);
            dbContentHit.requestReferrer = r.GetString(5 + dataOffset);
            if (!r.IsDBNull(6 + dataOffset) && r.GetInt32(6 + dataOffset) > 0)
            {
                dbContentHit.requestContent = DbContentClip.NewPlaceHolder(r.GetInt32(6 + dataOffset));
            }
            dbContentHit.isUnique = r.GetBoolean(7 + dataOffset);
        }
Ejemplo n.º 20
0
        public int Compare(DbContentHit a, DbContentHit b)
        {
            int result = 0;

            for (int i = 0; i <= _keys.GetUpperBound(0); i++)
            {
                switch (_keys[i])
                {
                case HitCompareKey.RequestDate:
                    result = a.RequestDate.CompareTo(b.RequestDate);
                    break;
                }

                // cease compare processing if the result is not equal
                if (result != 0)
                {
                    return(result);
                }
            }

            return(result);
        }
Ejemplo n.º 21
0
 public bool Contains(DbContentHit value)
 {
     return(IndexOf(value) != -1);
 }
Ejemplo n.º 22
0
        public DbContentHitCollection GetCollection(int topCount, string whereClause, string sortClause, params DbContentHitFlags[] optionFlags)
        {
            StringBuilder          query;
            Database               database;
            DbCommand              dbCommand;
            IDataReader            r;
            DbContentHitCollection dbContentHitCollection;

            int innerJoinOffset;

            query = new StringBuilder("SELECT ");

            if (topCount > 0)
            {
                query.Append("TOP ");
                query.Append(topCount);
                query.Append(" ");
            }

            foreach (string columnName in InnerJoinFields)
            {
                query.Append("DbContentHit.");
                query.Append(columnName);
                query.Append(",");
            }

            innerJoinOffset = InnerJoinFields.GetUpperBound(0) + 1;
            int userOffset                        = -1;
            int userContactOffset                 = -1;
            int requestContentOffset              = -1;
            int requestContentStatusOffset        = -1;
            int requestContentParentCatalogOffset = -1;
            int requestContentRatingOffset        = -1;
            int requestContentWorkingDraftOffset  = -1;

            //
            // Append Option Flag Fields
            //
            if (optionFlags != null)
            {
                for (int x = 0; x < optionFlags.Length; x++)
                {
                    switch (optionFlags[x])
                    {
                    case DbContentHitFlags.User:
                        for (int i = 0; i <= GreyFoxUserManager.InnerJoinFields.GetUpperBound(0); i++)
                        {
                            query.Append("User.");
                            query.Append(GreyFoxUserManager.InnerJoinFields[i]);
                            query.Append(",");
                        }
                        userOffset      = innerJoinOffset;
                        innerJoinOffset = userOffset + GreyFoxUserManager.InnerJoinFields.GetUpperBound(0) + 1;
                        break;

                    case DbContentHitFlags.UserContact:
                        for (int i = 0; i <= GreyFoxContactManager.InnerJoinFields.GetUpperBound(0); i++)
                        {
                            query.Append("User_Contact.");
                            query.Append(GreyFoxContactManager.InnerJoinFields[i]);
                            query.Append(",");
                        }
                        userContactOffset = innerJoinOffset;
                        innerJoinOffset   = userContactOffset + GreyFoxContactManager.InnerJoinFields.GetUpperBound(0) + 1;
                        break;

                    case DbContentHitFlags.RequestContent:
                        for (int i = 0; i <= DbContentClipManager.InnerJoinFields.GetUpperBound(0); i++)
                        {
                            query.Append("RequestContent.");
                            query.Append(DbContentClipManager.InnerJoinFields[i]);
                            query.Append(",");
                        }
                        requestContentOffset = innerJoinOffset;
                        innerJoinOffset      = requestContentOffset + DbContentClipManager.InnerJoinFields.GetUpperBound(0) + 1;
                        break;

                    case DbContentHitFlags.RequestContentStatus:
                        for (int i = 0; i <= DbContentStatusManager.InnerJoinFields.GetUpperBound(0); i++)
                        {
                            query.Append("RequestContent_Status.");
                            query.Append(DbContentStatusManager.InnerJoinFields[i]);
                            query.Append(",");
                        }
                        requestContentStatusOffset = innerJoinOffset;
                        innerJoinOffset            = requestContentStatusOffset + DbContentStatusManager.InnerJoinFields.GetUpperBound(0) + 1;
                        break;

                    case DbContentHitFlags.RequestContentParentCatalog:
                        for (int i = 0; i <= DbContentCatalogManager.InnerJoinFields.GetUpperBound(0); i++)
                        {
                            query.Append("RequestContent_ParentCatalog.");
                            query.Append(DbContentCatalogManager.InnerJoinFields[i]);
                            query.Append(",");
                        }
                        requestContentParentCatalogOffset = innerJoinOffset;
                        innerJoinOffset = requestContentParentCatalogOffset + DbContentCatalogManager.InnerJoinFields.GetUpperBound(0) + 1;
                        break;

                    case DbContentHitFlags.RequestContentRating:
                        for (int i = 0; i <= DbContentRatingManager.InnerJoinFields.GetUpperBound(0); i++)
                        {
                            query.Append("RequestContent_Rating.");
                            query.Append(DbContentRatingManager.InnerJoinFields[i]);
                            query.Append(",");
                        }
                        requestContentRatingOffset = innerJoinOffset;
                        innerJoinOffset            = requestContentRatingOffset + DbContentRatingManager.InnerJoinFields.GetUpperBound(0) + 1;
                        break;

                    case DbContentHitFlags.RequestContentWorkingDraft:
                        for (int i = 0; i <= DbContentClipManager.InnerJoinFields.GetUpperBound(0); i++)
                        {
                            query.Append("RequestContent_WorkingDraft.");
                            query.Append(DbContentClipManager.InnerJoinFields[i]);
                            query.Append(",");
                        }
                        requestContentWorkingDraftOffset = innerJoinOffset;
                        innerJoinOffset = requestContentWorkingDraftOffset + DbContentClipManager.InnerJoinFields.GetUpperBound(0) + 1;
                        break;
                    }
                }
            }

            //
            // Remove trailing comma
            //
            query.Length--;
            if (optionFlags != null)
            {
                query.Append(" FROM ");

                //
                // Start INNER JOIN expressions
                //
                for (int x = 0; x < optionFlags.Length; x++)
                {
                    query.Append("(");
                }

                query.Append("kitCms_Hits AS DbContentHit");
            }
            else
            {
                query.Append(" FROM kitCms_Hits AS DbContentHit");
            }
            //
            // Finish INNER JOIN expressions
            //
            if (optionFlags != null)
            {
                for (int x = 0; x < optionFlags.Length; x++)
                {
                    switch (optionFlags[x])
                    {
                    case DbContentHitFlags.User:
                        query.Append(" LEFT JOIN sysGlobal_Users AS User ON DbContentHit.UserID = User.GreyFoxUserID)");
                        break;

                    case DbContentHitFlags.UserContact:
                        query.Append(" LEFT JOIN sysGlobal_Contacts AS User_Contact ON User.ContactID = User_Contact.GreyFoxContactID)");
                        break;

                    case DbContentHitFlags.RequestContent:
                        query.Append(" LEFT JOIN kitCms_Clips AS RequestContent ON DbContentHit.RequestContentID = RequestContent.DbContentClipID)");
                        break;

                    case DbContentHitFlags.RequestContentStatus:
                        query.Append(" LEFT JOIN kitCms_Statuses AS RequestContent_Status ON RequestContent.StatusID = RequestContent_Status.DbContentStatusID)");
                        break;

                    case DbContentHitFlags.RequestContentParentCatalog:
                        query.Append(" LEFT JOIN kitCms_Catalogs AS RequestContent_ParentCatalog ON RequestContent.ParentCatalogID = RequestContent_ParentCatalog.DbContentCatalogID)");
                        break;

                    case DbContentHitFlags.RequestContentRating:
                        query.Append(" LEFT JOIN kitCms_Ratings AS RequestContent_Rating ON RequestContent.RatingID = RequestContent_Rating.DbContentRatingID)");
                        break;

                    case DbContentHitFlags.RequestContentWorkingDraft:
                        query.Append(" LEFT JOIN kitCms_Clips AS RequestContent_WorkingDraft ON RequestContent.WorkingDraftID = RequestContent_WorkingDraft.DbContentClipID)");
                        break;
                    }
                }
            }

            //
            // Render where clause
            //
            if (whereClause != string.Empty)
            {
                query.Append(" WHERE ");
                query.Append(whereClause);
            }

            //
            // Render sort clause
            //
            if (sortClause != string.Empty)
            {
                query.Append(" ORDER BY ");
                query.Append(sortClause);
            }

            //
            // Render final semicolon
            //
            query.Append(";");
            database  = DatabaseFactory.CreateDatabase();
            dbCommand = database.GetSqlStringCommand(query.ToString());
                        #if DEBUG
            try
            {
                r = database.ExecuteReader(dbCommand);
            }
            catch (Exception e)
            {
                string msg = e.Message;
                throw(new Exception(msg + " --- Query: " + query.ToString()));
            }
                        #else
            r = database.ExecuteReader(dbCommand);
                        #endif

            dbContentHitCollection = new DbContentHitCollection();

            while (r.Read())
            {
                DbContentHit dbContentHit = ParseFromReader(r, 0, 1);

                // Fill User
                if (userOffset != -1 && !r.IsDBNull(userOffset))
                {
                    GreyFoxUserManager.FillFromReader(dbContentHit.user, r, userOffset, userOffset + 1);

                    // Fill
                    if (userContactOffset != -1 && !r.IsDBNull(userContactOffset))
                    {
                        GreyFoxContactManager.FillFromReader(dbContentHit.user.Contact, "sysGlobal_Contacts", r, userContactOffset, userContactOffset + 1);
                    }
                }

                // Fill RequestContent
                if (requestContentOffset != -1 && !r.IsDBNull(requestContentOffset))
                {
                    DbContentClipManager.FillFromReader(dbContentHit.requestContent, r, requestContentOffset, requestContentOffset + 1);

                    // Fill
                    if (requestContentStatusOffset != -1 && !r.IsDBNull(requestContentStatusOffset))
                    {
                        DbContentStatusManager.FillFromReader(dbContentHit.requestContent.Status, r, requestContentStatusOffset, requestContentStatusOffset + 1);
                    }

                    // Fill Parent Catalog
                    if (requestContentParentCatalogOffset != -1 && !r.IsDBNull(requestContentParentCatalogOffset))
                    {
                        DbContentCatalogManager.FillFromReader(dbContentHit.requestContent.ParentCatalog, r, requestContentParentCatalogOffset, requestContentParentCatalogOffset + 1);
                    }

                    // Fill
                    if (requestContentRatingOffset != -1 && !r.IsDBNull(requestContentRatingOffset))
                    {
                        DbContentRatingManager.FillFromReader(dbContentHit.requestContent.Rating, r, requestContentRatingOffset, requestContentRatingOffset + 1);
                    }

                    // Fill
                    if (requestContentWorkingDraftOffset != -1 && !r.IsDBNull(requestContentWorkingDraftOffset))
                    {
                        DbContentClipManager.FillFromReader(dbContentHit.requestContent.WorkingDraft, r, requestContentWorkingDraftOffset, requestContentWorkingDraftOffset + 1);
                    }
                }

                dbContentHitCollection.Add(dbContentHit);
            }

            return(dbContentHitCollection);
        }
Ejemplo n.º 23
0
 /// <summary>
 /// Deep copies the current DbContentHit to another instance of DbContentHit.
 /// This method does not provide isolated copies; use overriden method for this feature.
 /// </summary>
 /// <param name="DbContentHit">The DbContentHit to copy to.</param>
 public void CopyTo(DbContentHit dbContentHit)
 {
     CopyTo(dbContentHit, false);
 }
Ejemplo n.º 24
0
        /// <summary>
        /// Compares the object's ID to another object's ID.
        /// </summary>
        int IComparable.CompareTo(object obj)
        {
            DbContentHit dbContentHit = (DbContentHit)obj;

            return(this.iD - dbContentHit.iD);
        }
Ejemplo n.º 25
0
 /// <summary>
 /// Compares the object's ID to another object's ID.
 /// </summary>
 public int CompareTo(DbContentHit dbContentHit)
 {
     return(this.iD - dbContentHit.iD);
 }