public BlogPost GetABlogPost(int PostID)
        {
            SqlConnection conn = new SqlConnection(Database.HadozDB());
            SqlCommand command = new SqlCommand("Blog_GetABlogPost", conn);

            command.CommandType = CommandType.StoredProcedure;
            command.Parameters.Add("@PostID", SqlDbType.Int).Value = PostID;

            BlogPost bp = null;
            SqlDataReader reader = null;

            try
            {
                conn.Open();
                reader = command.ExecuteReader();

                while (reader.Read())
                {
                    bp = new BlogPost(reader.GetInt32(reader.GetOrdinal("PostID")),
                                      reader.GetString(reader.GetOrdinal("Title")),
                                      reader.GetString(reader.GetOrdinal("Body")),
                                      reader.GetString(reader.GetOrdinal("Excerpt")),
                                      reader.GetDateTime(reader.GetOrdinal("CreateDate")).ToLongDateString(),
                                      reader.GetDateTime(reader.GetOrdinal("UpdateDate")).ToLongDateString(),
                                      reader.GetInt32(reader.GetOrdinal("Status")),
                                      reader.GetInt32(reader.GetOrdinal("AuthorID")));
                }

                reader.Close();
            }
            catch (Exception e)
            {

            }
            finally
            {
                if (conn != null && conn.State == ConnectionState.Open)
                {
                    conn.Close();
                }
            }
           
            return bp;
        }
        //CRUD
        public List<BlogPost> GetAllBlogPosts()
        {
            SqlConnection conn = new SqlConnection(Database.HadozDB());
            SqlCommand command = new SqlCommand("Blog_GetAllBlogPosts", conn);

            command.CommandType = CommandType.StoredProcedure;
            //command.Parameters.Add("@Email", SqlDbType.VarChar, 256).Value = "email";

            BlogPost bp;
            List<BlogPost> blogPosts = new List<BlogPost>();
            SqlDataReader reader = null;

            try {
                conn.Open();
                reader = command.ExecuteReader();

                while (reader.Read())
	            {
                    bp = new BlogPost(reader.GetInt32(reader.GetOrdinal("PostID")),
                                      reader.GetString(reader.GetOrdinal("Title")),
                                      reader.GetString(reader.GetOrdinal("Body")),
                                      reader.GetString(reader.GetOrdinal("Excerpt")),
                                      reader.GetDateTime(reader.GetOrdinal("CreateDate")).ToLongDateString(),
                                      reader.GetDateTime(reader.GetOrdinal("UpdateDate")).ToLongDateString(),
                                      reader.GetInt32(reader.GetOrdinal("Status")),
                                      reader.GetInt32(reader.GetOrdinal("AuthorID")));
                    blogPosts.Add(bp);
	            }

                reader.Close();
            }
            catch(Exception e){

            }
            finally {
                if (conn != null && conn.State == ConnectionState.Open)
                {
                    conn.Close();
                }
            }

            return blogPosts;
        }