Exemple #1
0
        private static PostComment.Post[] LoadPosts()
        {
            PostCommentClient pc = new PostCommentClient();

            PostComment.Post[] p = pc.GetPosts();
            return(p);
        }
Exemple #2
0
        private static IEnumerable <Post> LoadPosts()
        {
            var pc = new PostCommentClient();
            var p  = pc.GetPosts();

            return(p);
        }
Exemple #3
0
        private static Laborator6_PostComment.Post[] LoadPosts()
        {
            PostCommentClient pc = new PostCommentClient();

            Laborator6_PostComment.Post[] p = pc.GetPosts();
            return(p);
        }
Exemple #4
0
        private static Lab6_WCF_EF.Post[] LoadPosts()
        {
            PostCommentClient pc = new PostCommentClient();

            Lab6_WCF_EF.Post[] p = pc.GetPosts();
            return(p);
        }
Exemple #5
0
        private void Test()
        {
            Post p1 = new Post()
            {
                Date = DateTime.Now, Description = "desc", Domain = "Domain"
            };
            Post p2 = new Post()
            {
                Date = DateTime.Now, Description = "Description", Domain = "domeniu"
            };
            PostCommentClient postCommentClient = new PostCommentClient();

            postCommentClient.AddPost(p1);
            postCommentClient.AddPost(p2);

            postCommentClient.AddComment(new Comment()
            {
                PostPostId = 1, Text = "very nice comment"
            });
            postCommentClient.AddComment(new Comment()
            {
                PostPostId = 1, Text = "Very mean comment"
            });
            postCommentClient.AddComment(new Comment()
            {
                PostPostId = 2, Text = "random comment"
            });
        }
Exemple #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            PostCommentClient pc = new PostCommentClient();

            bool added = pc.AddPost(new Post
            {
                Description = textBoxDesc.Text,
                Date        = textBoxDate.Text,
                Domain      = textBoxDomain.Text
            });

            if (added)
            {
                RefreshPosts();
            }
        }
Exemple #7
0
        private void buttonAddComment_Click(object sender, EventArgs e)
        {
            if (selectedPostIndex < 0)
            {
                return;
            }

            PostCommentClient pc = new PostCommentClient();

            Post selectedPost = posts[selectedPostIndex];

            Comment comment = new Comment()
            {
                Text       = textBoxComment.Text,
                PostPostId = selectedPost.PostId
            };

            pc.AddComment(comment);

            RefreshPosts();
            RefreshComments(selectedPostIndex);
        }
        public async Task OnGetAsync()
        {
            PostCommentClient pcc = new PostCommentClient();

            /*var posts = await pcc.GetAllPostsAsync();
             * foreach (var item in posts)
             * {
             *
             *  PostDTO pd = new PostDTO();
             *  pd.Description = item.Description;
             *  pd.PostId = item.PostId;
             *  pd.Domain = item.Domain;
             *
             *  foreach (var cc in item.Comments)
             *  {
             *      CommentDTO cdto = new CommentDTO();
             *      cdto.PostPostId = cc.PostPostId;
             *      cdto.Text = cc.Text;
             *      pd.Comments.Add(cdto);
             *  }
             *  Posts.Add(pd);
             * }*/
            Posts = await pcc.GetAllPostsAsync();
        }