Exemplo n.º 1
0
        private void sendPostBtn_Click(object sender, EventArgs e)
        {
            if (sharePostTxt.Text != "" && sharePostTxt.ForeColor == Color.Black)
            {
                List <int> tagID  = TagFriends.tagID;
                int        postID = proxy.AddPost(user.ID, sharePostTxt.Text, imageLocation);

                if (postID != 0)
                {
                    if (tagID.Count > 0)
                    {
                        ITaggedPost taggedPost = new TagDecorador(new TaggedPost(postID, proxy), tagID[0]);

                        if (tagID.Count > 1)
                        {
                            for (int i = 1; i < tagID.Count; i++)
                            {
                                taggedPost = new TagDecorador(taggedPost, tagID[i]);
                            }
                        }

                        List <int> tags = taggedPost.ObtenerTags();
                    }

                    TagFriends.tagID.Clear();
                    TagFriends.tagged.Clear();
                    refresh();
                }
                else
                {
                    MessageBox.Show("Ocurrió un error al publicar el post.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Escribir en el post.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }