Exemple #1
0
        private void BindPost()
        {
            PostQueries postRepository = new PostQueries(Config.GetLog());
            int         postId         = this.GetCurrentPostId();

            MyBlog.Reporting.Projections.DTOPost post = postRepository.FindById(postId);

            this.litPublishDate.Text  = Utils.FormatDate(post.PublishDate.Value);
            this.litSubject.Text      = Utils.FormatText(post.Subject);
            this.litBody.Text         = Utils.FormatText(post.Body);
            this.litCommentCount.Text = post.Comments.Count().ToString();
            this.litCategories.Text   = FormatCategories(post.Categories);

            //Up to the page to decide how to order the comments
            this.repReplies.DataSource = post.Comments.OrderBy(c => c.CreationDate);
            this.repReplies.DataBind();

            pnlReply.Visible = post.CommentsEnabled;
        }
Exemple #2
0
        protected string FormatPublishDate(object o)
        {
            DateTime dt = (DateTime)o;

            return(Utils.FormatDate(dt));
        }