Esempio n. 1
0
        }/*private void BtnModify_Click(object sender, EventArgs e)*/

        /// <summary>
        /// This method modifies the KidMeal at the given index, where the index
        /// is the position the meal is in in the meal list.
        /// </summary>
        /// <remarks>
        /// NAME: ModifyKidsMeal
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/13/2019
        /// </remarks>
        /// <param name="a_mealIndex">The index of the meal to be modified</param>
        private void ModifyKidsMeal(int a_mealIndex)
        {
            KidsMeal             chosenKidsMeal = (KidsMeal)m_customerChecks[m_currentlySelectedTab].GetMealAtIndex(a_mealIndex);
            KidsMealModification kmm            = new KidsMealModification(chosenKidsMeal);

            kmm.ShowDialog();
            UpdateDisplay();
        }/*private void ModifyKidsMeal(int a_mealIndex)*/
Esempio n. 2
0
        }/*BtnSaladSelection_Click(object sender, EventArgs e)*/

        /// <summary>
        /// This event is raised when any of the Kids Meal options are selected.
        /// The database is queried for the details of the meal using the
        /// button's respective tag and the meal is added to the check
        /// </summary>
        /// <remarks>
        /// NAME: BtnKidsMeals_Click
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/13/2019
        /// </remarks>
        /// <param name="sender">The button that raised the event</param>
        /// <param name="e">The EventArgs of the event</param>
        private void BtnKidsMeals_Click(object sender, EventArgs e)
        {
            Button kidsMealButton = sender as Button;
            Entree sandwich       = new Entree();

            sandwich.RetrieveAttributesFromDb((string)kidsMealButton.Tag);
            sandwich.RetrieveBasePriceFromDb((string)kidsMealButton.Tag);

            KidsMeal kidsMeal = new KidsMeal();

            kidsMeal.AddEntreeToMeal(sandwich);
            KidsMealModification kmm = new KidsMealModification(kidsMeal);

            kmm.ShowDialog();

            m_customerChecks[m_currentlySelectedTab].AddMealToCheck(kidsMeal);
            UpdateDisplay();
        }/*private void BtnKidsMeals_Click(object sender, EventArgs e)*/