Ejemplo n.º 1
0
        public static BlogEntry GetBlogEntry(Int32 blogEntryID)
        {
            Database  db        = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("HG_GetBlogEntry");

            db.AddInParameter(dbCommand, "entryID", DbType.Int32, blogEntryID);

            List <BlogEntry> BlogEntList = null;

            // Populate the datareader
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                // Call the PopulateObject method passing the datareader to return the object array
                BlogEntList = BlogEntry.PopulateObject(dr);
                dr.Close();
            }

            if (BlogEntList.Count > 0)
            {
                return(BlogEntList[0]);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
        public static List <BlogEntry> GetBlogEntryByMemberID(string WebMemberID)
        {
            Database  db        = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("HG_GetBlogEntryByMemberID");

            db.AddInParameter(dbCommand, "WebMemberID", DbType.String, WebMemberID);

            List <BlogEntry> BlogEntList = null;

            // Populate the datareader
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                // Call the PopulateObject method passing the datareader to return the object array
                BlogEntList = BlogEntry.PopulateObject(dr);
                dr.Close();
            }

            return(BlogEntList);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the blog entries for the mobile application.
        /// </summary>
        public static BlogEntry[] GetMobileBlogEntry(int MemberID)
        {
            Database db = DatabaseFactory.CreateDatabase();

            db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("HG_GetMobileBlogEntry");

            db.AddInParameter(dbCommand, "MemberID", DbType.Int32, MemberID);

            List <BlogEntry> BlogEntList = null;

            // Populate the datareader
            using (IDataReader dr = db.ExecuteReader(dbCommand))
            {
                // Call the PopulateObject method passing the datareader to return the object array
                BlogEntList = BlogEntry.PopulateObject(dr);
                dr.Close();
            }

            return(BlogEntList.ToArray());
        }