Exemple #1
0
        private void ShareMultipleButton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(ShareTextBox.Text))
            {
                MessageBox.Show("İçerik girmediniz!");
                return;
            }

            var request = new WallPostCreateRequest();

            request.Body     = ShareTextBox.Text;
            request.PostedBy = FormHelper.Username;
            request.PostType = WallPostType.text;
            if (ShareToOwnWallCheckbox.Checked)
            {
                request.TargetWall = new WallModel {
                    OwnerId = FormHelper.Username, WallOwnerType = WallType.user
                };
            }
            else
            {
                var ownerType = WallSelectionComboBox.Text == "Grup" ? WallType.group : WallType.user;
                request.TargetWall = new WallModel {
                    OwnerId = WallOwnerTextBox.Text, WallOwnerType = ownerType
                };
            }

            var provider = new WallPostProvider();

            for (int i = 0; i < 100; i++)
            {
                var postId        = provider.AddPost(request);
                var feedProvider  = new NewsfeedProvider();
                var newsFeedEntry = new NewsfeedItem
                {
                    By = request.PostedBy,
                    ReferencePostId = postId,
                    FeedType        = NewsfeedActionType.wallpost,
                    WallOwner       = new NewsfeedWallModel {
                        IsPublic = true, OwnerId = request.PostedBy, WallOwnerType = WallType.user
                    }
                };
                feedProvider.AddNewsfeedItem(newsFeedEntry);
            }
        }
Exemple #2
0
        private void RefreshGroupWallButton_Click(object sender, EventArgs e)
        {
            var groupName = GroupWallGroupNameTextBox.Text;


            GroupWallGridView.Rows.Clear();
            GroupWallGridView.Columns.Clear();
            GroupWallGridView.Columns.Add("Id", "Id");
            GroupWallGridView.Columns.Add("Body", "İçerik");
            GroupWallGridView.Columns.Add("PostedBy", "Paylaşan");
            GroupWallGridView.Columns.Add("CreatedDate", "Paylaşım Tarihi");
            GroupWallGridView.Columns.Add("ModifiedDate", "Güncellenme Tarihi");
            GroupWallGridView.Columns.Add("LikeCount", "Beğeni Sayısı");
            GroupWallGridView.Columns.Add("CommentCount", "Yorum Sayısı");

            var likeButton = new DataGridViewCheckBoxColumn();

            likeButton.Name       = "Like";
            likeButton.HeaderText = "Beğen";
            GroupWallGridView.Columns.Add(likeButton);
            var commentButton = new DataGridViewButtonColumn();

            commentButton.Name       = "Comment";
            commentButton.HeaderText = "Comment";
            commentButton.Text       = "Beğen";
            GroupWallGridView.Columns.Add(commentButton);
            var commentCountButton = new DataGridViewButtonColumn();

            commentCountButton.Name       = "CommentDetails";
            commentCountButton.HeaderText = "Yorumlar";
            commentCountButton.Text       = "Yorumlar";
            GroupWallGridView.Columns.Add(commentCountButton);


            var provider = new WallPostProvider();
            var posts    = provider.GetGroupWall(groupName, 0, 100);


            foreach (var post in posts)
            {
                GroupWallGridView.Rows.Add(post.Id, post.Body, post.PostedBy, post.CreatedDate, post.ModifiedDate, post.LikeCount, post.CommentCount, false);
            }
        }
Exemple #3
0
        private void GenerateWallPostGrid()
        {
            WallPostGridView.Rows.Clear();
            WallPostGridView.Columns.Clear();
            WallPostGridView.Columns.Add("Id", "Id");
            WallPostGridView.Columns.Add("Body", "İçerik");
            WallPostGridView.Columns.Add("PostedBy", "Paylaşan");
            WallPostGridView.Columns.Add("CreatedDate", "Paylaşım Tarihi");
            WallPostGridView.Columns.Add("ModifiedDate", "Güncellenme Tarihi");
            WallPostGridView.Columns.Add("LikeCount", "Beğeni Sayısı");
            WallPostGridView.Columns.Add("CommentCount", "Yorum Sayısı");

            var likeButton = new DataGridViewCheckBoxColumn();

            likeButton.Name       = "Like";
            likeButton.HeaderText = "Beğen";
            WallPostGridView.Columns.Add(likeButton);
            var commentButton = new DataGridViewButtonColumn();

            commentButton.Name       = "Comment";
            commentButton.HeaderText = "Comment";
            commentButton.Text       = "Beğen";
            WallPostGridView.Columns.Add(commentButton);
            var commentCountButton = new DataGridViewButtonColumn();

            commentCountButton.Name       = "CommentDetails";
            commentCountButton.HeaderText = "Yorumlar";
            commentCountButton.Text       = "Yorumlar";
            WallPostGridView.Columns.Add(commentCountButton);


            var provider = new WallPostProvider();
            var posts    = provider.GetUserWallDetailed(FormHelper.Username, DateTime.Now, 1000);


            foreach (var post in posts)
            {
                WallPostGridView.Rows.Add(post.Id, post.Body, post.PostedBy, post.CreatedDate, post.ModifiedDate, post.LikeCount, post.CommentCount, false);
            }
        }