Пример #1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show("Would you like to delete this Template?", "Delete Template", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                try
                {
                    Notice_Template template = new Notice_Template();
                    template = db.Notice_Template.Find(tempID);

                    db.Notice_Template.Remove(template);
                    db.SaveChanges();

                    int    Marketing_Template_ID    = template.Template_ID;
                    string Marketing_Template_Value = Convert.ToString(template);

                    MessageBox.Show("Marketing Template Successfully Deleted");
                    UCSearchTemplate MaintainTemplate = new UCSearchTemplate("Maintain Template");
                    panel1.Controls.Add(MaintainTemplate);
                    MaintainTemplate.BringToFront();
                    MaintainTemplate.Dock = DockStyle.Fill;
                }
                catch (Exception)
                {
                    MessageBox.Show("Error has occured, and template was not deleted successfully");
                }
            }
        }
Пример #2
0
        private void pictureBox4_Click(object sender, EventArgs e)
        {
            UCSearchTemplate notification = new UCSearchTemplate("Publish Template");

            //panel4.Controls.Add(notification);
            notification.BringToFront();
            notification.Dock = DockStyle.Fill;
        }
Пример #3
0
        private void pictureBox2_Click(object sender, EventArgs e)
        {
            UCSearchTemplate SearchTemplate = new UCSearchTemplate("Maintain Template");

            //panel4.Controls.Add(SearchTemplate);
            SearchTemplate.BringToFront();
            SearchTemplate.Dock = DockStyle.Fill;
        }