Exemple #1
0
 /// <summary>
 /// Event handler for the "remove" button
 /// Removes a recipe
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void Remove_Click(object sender, EventArgs e)
 {
     if (recipeList.Count == 0 || recipeList is null)
     {
         DisplayError();
     }
     else
     {
         MessageBox.Show("Choose a recipe to delete.");
         ViewRecipeForm FormView = new ViewRecipeForm(0);
         FormView.ShowDialog();
     }
 }
Exemple #2
0
 /// <summary>
 /// Event handler for the "view" button
 /// Displays a recipe in a nice format.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void View_Click(object sender, EventArgs e)
 {
     if (recipeList.Count == 0)
     {
         DisplayError();
     }
     else
     {
         MessageBox.Show("Choose a recipe to view.");
         //Display all available recipes
         ViewRecipeForm FormView = new ViewRecipeForm(2);
         FormView.ShowDialog();
     }
 }
Exemple #3
0
 /// <summary>
 /// Event handler for the "edit" button
 /// Edits a recipe
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void Edit_Click(object sender, EventArgs e)
 {
     if (recipeList.Count == 0)
     {
         DisplayError();
     }
     else
     {
         //Display all recipes
         MessageBox.Show("Choose a recipe to edit.");
         ViewRecipeForm FormView = new ViewRecipeForm(1);
         FormView.ShowDialog();
     }
 }