Example #1
0
 public ForumController()
 {
     forumCategory           = LogicFactory.LogicFactory.GetForumCategory();
     forumCategoryCollection = LogicFactory.LogicFactory.GetForumCategoryCollection();
     forumThread             = LogicFactory.LogicFactory.GetForumThread();
     forumThreadCollection   = LogicFactory.LogicFactory.GetForumThreadCollection();
     forumPost           = LogicFactory.LogicFactory.GetForumPost();
     forumPostCollection = LogicFactory.LogicFactory.GetForumPostCollection();
     account             = LogicFactory.LogicFactory.GetAccount();
     accountCollection   = LogicFactory.LogicFactory.GetAccountCollection();
 }
        public void CreatePost(IForumPost forumPost)
        {
            IForumPostDto forumPostDto = DataHandlerFactory.DataHandlerFactory.GetForumPostDto();

            forumPostDto.ThreadID        = forumPost.ThreadID;
            forumPostDto.AccountID       = forumPost.AccountID;
            forumPostDto.PostMessage     = forumPost.PostMessage;
            forumPostDto.PostDateCreated = forumPost.PostDateCreated;

            db.CreatePost(forumPostDto);
        }
Example #3
0
        public IActionResult PostEdit(int postID)
        {
            forumPost = forumPostCollection.GetForumPost(postID);

            PostEditViewModel model = new PostEditViewModel()
            {
                PostID      = forumPost.PostID,
                ThreadID    = forumPost.ThreadID,
                PostMessage = forumPost.PostMessage
            };

            return(View(model));
        }
        public ForumPostDrop(IPortalLiquidContext portalLiquidContext, IDataAdapterDependencies dependencies, IForumPost post)
            : base(portalLiquidContext, post)
        {
            if (dependencies == null)
            {
                throw new ArgumentNullException("dependencies");
            }

            _dependencies = dependencies;

            Post   = post;
            Author = post.Author != null ? new AuthorDrop(portalLiquidContext, Post.Author) : null;

            _thread = new Lazy <ForumThreadDrop>(() => new ForumThreadDrop(this, _dependencies, Post.Thread), LazyThreadSafetyMode.None);
        }
 public void UpdateLatestPost(IForumPost forumPost, bool incremementForumThreadCount = false)
 {
     UpdateLatestPost(((IForumPostInfo)forumPost).EntityReference, incremementForumThreadCount);
 }