public CommentViewModel(MBlogModel.Comment comment) { Comment = BBCode.ToHtml(comment.CommentText); Commented = comment.Commented; EMail = comment.EMail; Name = comment.Name ?? "Anonymous"; }
public void AddNicknamesToUser(MBlogModel.User user) { foreach (MBlogModel.Blog blog in user.Blogs) { Nicknames.Add(blog.Nickname); } }
public NewPostViewModel(MBlogModel.Post post) { DatePosted = post.Posted; Id = post.Id; Title = post.Title; Post = post.BlogPost; BlogId = post.BlogId; }
public CreateBlogViewModel(MBlogModel.Blog blog) { IsCreate = false; ApproveComments = blog.ApproveComments; Title = blog.Title; Description = blog.Description; CommentsEnabled = blog.CommentsEnabled; Nickname = blog.Nickname; }
private void Add(MBlogModel.Post post) { var vm = new HomePagePostViewModel { Title = post.Title, DatePosted = post.Posted, Post = post.BlogPost, UserName = post.Blog.User.Name }; HomePagePostViewModels.Add(vm); }
public PostViewModel(MBlogModel.Post post) : this() { DateLastEdited = post.Edited; DatePosted = post.Posted; Id = post.Id; Title = post.Title; Post = post.BlogPost; Link = post.TitleLink; AddCommentViewModel = new AddCommentViewModel(post.Id, post.CommentsEnabled); foreach (MBlogModel.Comment comment in post.Comments) { if (comment.Approved) { var cvm = new CommentViewModel(comment); AddCommentViewModel.AddComment(cvm); } } }
public ShowMediaViewModel(MBlogModel.Media media) : this() { Id = media.Id; FileName = media.FileName; Title = media.Title; LinkKey = media.LinkKey; ContentType = media.MimeType; Caption = media.Caption; Description = media.Description; Alternate = media.Alternate; Year = media.Year; Month = media.Month; Day = media.Day; Url = media.Url; UserId = media.UserId; Alignment = media.Alignment; Size = media.Size; DisplayDate = new DateTime(media.Year, media.Month, media.Day).ToShortDateString(); }