public AddComment(IPostManager postManager, IAppUser user, AppPostModel post) { this._postManager = postManager; this._user = user; this._post = post; InitializeComponent(); }
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); }
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(); }
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; }
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(); }