Пример #1
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"
            });
        }
Пример #2
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();
            }
        }