Exemple #1
0
        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            diagAddRecipe diagAdd = new diagAddRecipe("New", "");

            if (diagAdd.ShowDialog() == DialogResult.OK)
            {
                time = 0;
                notifier("Dish successfully added.");
                lblNotif.Left         = (this.ClientSize.Width - lblNotif.Size.Width) / 2;
                this.panel3.BackColor = System.Drawing.Color.DodgerBlue;
            }
        }
Exemple #2
0
        private void toolStripMenuItem2_Click(object sender, EventArgs e)
        {
            recBO = new RecipeBO();
            recBL = new RecipeBL();
            diagAddRecipe diagAdd = new diagAddRecipe("Update", RecipeID);

            if (diagAdd.ShowDialog() == DialogResult.OK)
            {
                time = 0;
                notifier("Dish successfully updated.");
                lblNotif.Left         = (this.ClientSize.Width - lblNotif.Size.Width) / 2;
                this.panel3.BackColor = System.Drawing.Color.DodgerBlue;
                try
                {
                    RecipeBO.recipe          = diagAdd.recipename;
                    RecipeBO.cat             = cat;
                    dataGridView1.DataSource = RecipeBL.searchRecipe(RecipeBO);
                }
                catch (Exception)
                {
                    throw;
                }
            }
        }