Exemple #1
0
        private void btnGetAllComments_Click(object sender, EventArgs e)
        {
            List <CommentDTO> commentDTOs = new DTOManagers.CommentDTOManager().GetAllComments();

            foreach (CommentDTO comment in commentDTOs)
            {
                MessageBox.Show(comment.ToString());
            }
        }
Exemple #2
0
        private void btnGetCommentsForNews_Click(object sender, EventArgs e)
        {
            int id = int.Parse(txtGetCommentsForNews.Text);
            List <CommentDTO> dtos = new DTOManagers.CommentDTOManager().GetCommentsForNews(id);

            foreach (CommentDTO dto in dtos)
            {
                MessageBox.Show(dto.ToString());
            }
        }
Exemple #3
0
        private void btnUpdateComment_Click(object sender, EventArgs e)
        {
            int               commentId = int.Parse(txtUpdateComment.Text);
            CommentDTO        dto       = new DTOManagers.CommentDTOManager().GetComment(commentId);
            CreateCommentForm form      = new CreateCommentForm(dto);

            if (form.ShowDialog() == DialogResult.OK)
            {
                dto.Content = form.Content;
                if (new DTOManagers.CommentDTOManager().UpdateComment(dto) != null)
                {
                    MessageBox.Show("Azuriran komentar");
                }
                else
                {
                    MessageBox.Show("Greska");
                }
            }
        }