示例#1
0
 public AddComment(IPostManager postManager, IAppUser user, AppPostModel post)
 {
     this._postManager = postManager;
     this._user        = user;
     this._post        = post;
     InitializeComponent();
 }
示例#2
0
 private void UpdateData()
 {
     this._post        = _mapper.Map <AppPostModel> (this._postManager.GetPostById(this._post.PostId));
     Title.Text        = _post.Title;
     Body.Text         = _post.Body;
     LikeCount.Text    = Convert.ToString(_post.Likes);
     DislikeCount.Text = Convert.ToString(_post.Dislikes);
 }
示例#3
0
 public PostViewForm(IUserManager userManager, IPostManager postManager, IMapper mapper, IAppUser user, AppPostModel post)
 {
     this._userManager = userManager;
     this._mapper      = mapper;
     this._postManager = postManager;
     this._user        = user;
     this._post        = post;
     InitializeComponent();
     UpdateData();
 }
示例#4
0
        private void RefreshGrid()
        {
            this._post = this._mapper.Map <AppPostModel>(_postManager.GetPostById(this._post.PostId));
            var CommentsBL = new BindingList <CommentDTO>(_post.Comments);

            CommentListBS.DataSource = CommentsBL;

            CommentListBN.BindingSource = CommentListBS;
            CommentListDGV.DataSource   = CommentListBS;
        }
示例#5
0
 public CommentList(IPostManager postManager, IMapper mapper, IAppUser user, AppPostModel post)
 {
     this._mapper      = mapper;
     this._postManager = postManager;
     this._user        = user;
     this._post        = post;
     this._postManager.AddCommentToPost(post.PostId, _user.UserId, "Some comment");
     InitializeComponent();
     RefreshGrid();
 }