private void boughtAndClear_Click(object sender, EventArgs e)
        {
            foreach (string item in user.UserShoppingList.Items.Keys)
            {
                bool found = false;
                foreach (FoodItem foodItem in user.MyKitchen)
                {
                    if (item.Equals(foodItem.Name))
                    {
                        foodItem.TotalServings += user.UserShoppingList.Items[item];
                        found = true;
                    }
                }
                if (!found)
                {
                    NewFood newFoodForm = new NewFood(user, item, user.UserShoppingList.Items[item]);
                    newFoodForm.Show();
                }
            }
            user.UserShoppingList.Clear();

            MessageBox.Show("Your kitchen has been updated!!");

            this.Close();
        }
        private void newShoppingItemButton_Click(object sender, EventArgs e)
        {
            // Functionality when "New Shopping Item" button pushed.
            NewFood newFood = new NewFood(user);

            newFood.Show();
        }
Esempio n. 3
0
        private void ateNewFoodButton_Click(object sender, EventArgs e)
        {
            // Functionality when "New Food" button clicked.
            NewFood newFood = new NewFood(user);

            newFood.Show();
            this.Close();
        }
Esempio n. 4
0
        private void addFoodItemButton_Click(object sender, EventArgs e)
        {
            NewFood newFood = new NewFood(user);

            newFood.Show();
        }