Ejemplo n.º 1
0
        public AccountPage(String email)
        {
            InitializeComponent();

            this.email = email;
            Image myimage = new Bitmap(MySQLFunctions.getProfileImage(email));

            ProfilePicture.BackgroundImage = myimage;
            user_button.Text  = MySQLFunctions.getName(email);
            username_lbl.Text = MySQLFunctions.getName(email);
            Bio_lbl.Text      = MySQLFunctions.getBio(email);
            home_lbl.Text     = MySQLFunctions.getHome(email);
            Image backImage = new Bitmap(MySQLFunctions.getBackgroundImage(email));

            CoverPicture.BackgroundImage = backImage;

            panel4.Hide();
            if (MySQLFunctions.getTotalPosts(email) != "0")
            {
                int    totalPosts = int.Parse(MySQLFunctions.getTotalPosts(email));
                string post       = "";
                for (int i = totalPosts; i > 0; i--)
                {
                    post = MySQLFunctions.getPost(email, i.ToString());
                    if (post.Length != 0)
                    {
                        postsTooDelete.Items.Add(post);
                        AccountAddPost a = new AccountAddPost(i, isNewPage);
                        a.post_lbl.Text = post;
                        a.post_lbl.Size = new System.Drawing.Size(700, 25);

                        isNewPage      = false;
                        postCurrentNum = i;

                        this.Controls.Add(a.post_background);
                        a.post_background.Controls.Add(a.post_lbl);
                        a.post_background.Controls.Add(a.date_lbl);

                        a.date_lbl.Text = MySQLFunctions.getDate(email, i.ToString());

                        a.post_lbl.Show();
                        a.date_lbl.Show();
                        a.post_background.Show();
                        PanelLocation += 100; //Adding an amount
                    }
                    else
                    {
                        i--;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void Submit_post_button_Click(object sender, EventArgs e)
        {
            AccountAddPost ah = new AccountAddPost(postCurrentNum, isNewPage);

            ah.post_lbl.Text = textBox1.Text;
            ah.post_lbl.Size = new System.Drawing.Size(700, 25);

            this.Controls.Add(ah.post_background);
            ah.post_background.Controls.Add(ah.post_lbl);
            ah.post_background.Controls.Add(ah.date_lbl);

            ah.post_lbl.Show();
            ah.date_lbl.Show();
            ah.post_background.Show();

            PanelLocation += 100;

            MySQLFunctions.savePost(email, textBox1.Text, ah.date_lbl.Text);

            this.Hide();
            AddProfileImage a = new AddProfileImage(2, email);

            this.Close();
        }