private void backExixtingEventButton_Click(object sender, EventArgs e)
        {
            ExistingEvent existingEvent = new ExistingEvent(this);

            this.Hide();
            existingEvent.Show();
        }
Esempio n. 2
0
        private void existingEventToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ExistingEvent existingEvent = new ExistingEvent(this);

            this.Hide();
            existingEvent.Show();
        }
        private void removeButton_Click(object sender, EventArgs e)
        {
            try
            {
                SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnection"].ConnectionString);
                string        sql        = "DELETE FROM Pictures WHERE PictureID='" + pictureId.ToString() + "'";
                SqlCommand    command    = new SqlCommand(sql, connection);
                connection.Open();
                SqlDataReader reader = command.ExecuteReader();
                MessageBox.Show("Picture Deleted");

                //PictureEvents pictureEvents = new PictureEvents(this);
                connection.Close();
                ExistingEvent existingEvent = new ExistingEvent(this);
                this.Hide();
                existingEvent.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }