示例#1
0
        }/*private void ModifyKidsMeal(int a_mealIndex)*/

        /// <summary>
        /// Modifies the meal passed into this method via the AttributeModification form.
        /// </summary>
        /// <remarks>
        /// NAME: ModifyMeal
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/13/2019
        /// </remarks>
        /// <param name="a_toBeModified">The Entree to be modified.</param>
        private void ModifyMeal(Entree a_toBeModified)
        {
            AttributeModification modifySelection = new AttributeModification(a_toBeModified);

            modifySelection.ShowDialog();
            UpdateDisplay();
        }/*private void ModifyMeal(Entree a_toBeModified)*/
示例#2
0
        }/*private void BtnSignatureAndProteinSelection_Click(object sender, EventArgs e)*/

        /// <summary>
        /// This click event is triggered whenever the user selects one of the salad buttons. A new Entree is
        /// created which queries the database for the salad attributes, which is then
        /// passed into the attribute modification form.
        /// </summary>
        /// <remarks>
        /// NAME: BtnSaladSelection_Click
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/13/2019
        /// </remarks>
        /// <param name="sender">The button that triggered this event - the salad buttons</param>
        /// <param name="e">The EventArgs associated with this event.</param>
        private void BtnSaladSelection_Click(object sender, EventArgs e)
        {
            Button selectedSalad = sender as Button;
            Entree signature     = new Entree();

            signature.RetrieveAttributesFromDb((string)selectedSalad.Tag);
            signature.RetrieveBasePriceFromDb((string)selectedSalad.Tag);

            AttributeModification atModForm = new AttributeModification(signature);

            atModForm.ShowDialog();

            m_customerChecks[m_currentlySelectedTab].CreateNewMealOrAddEntreeToMeal(signature);
            UpdateDisplay();
        }/*BtnSaladSelection_Click(object sender, EventArgs e)*/
示例#3
0
        }/*private void RadioButtonSelection_CheckedChanged(object sender, EventArgs e)*/

        /// <summary>
        /// This event is raised whenever the user selects a protein option. If a signature hasn't
        /// been selected yet, return. Otherwise, create the desired Entree object by retrieving
        /// the sandwiches attributes from the database.
        /// </summary>
        /// <remarks>
        /// NAME: BtnSignatureAndProteinSelection_Click
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/13/2019
        /// </remarks>
        /// <param name="sender">The button that raised this event</param>
        /// <param name="e">The EventArgs of the event</param>
        private void BtnSignatureAndProteinSelection_Click(object sender, EventArgs e)
        {
            if (m_selectedSignature == null)
            {
                return;
            }

            Button proteinButton = sender as Button;
            Entree signature     = new Entree();

            //On the menu, The Classic Signature is the only sandwich which recipe differs depending on the protein selection.
            //This feels like an iffy way to do it, but in the interest of keeping a generic method for ringing up a sandwich,
            //this is the best solution I could think of at the time I fleshed out this part of the project.

            if (proteinButton.Text.Equals("Grilled") && m_selectedSignature.Text.Equals("Classic Smash"))
            {
                //Since there is no "Classic Chicken" button, I just need to pass "ClassicChicken" so the db knows to get the chicken version of this signature
                signature.RetrieveAttributesFromDb("ClassicChicken");
                signature.RetrieveBasePriceFromDb("ClassicChicken");
            }
            else if (proteinButton.Text.Equals("Crispy") && m_selectedSignature.Text.Equals("Classic Smash"))
            {
                signature.RetrieveAttributesFromDb("ClassicCrispy");
                signature.RetrieveBasePriceFromDb("ClassicCrispy");
            }
            else
            {
                signature.RetrieveAttributesFromDb((string)m_selectedSignature.Tag);
                signature.RetrieveBasePriceFromDb((string)m_selectedSignature.Tag);
            }

            signature.SetProteinType(proteinButton.Text);
            AttributeModification atModForm = new AttributeModification(signature);

            atModForm.ShowDialog();

            m_customerChecks[m_currentlySelectedTab].CreateNewMealOrAddEntreeToMeal(signature);
            m_selectedSignature.Checked = false;
            m_selectedSignature         = null;
            Debug.WriteLine(signature.CalculatePrice());
            UpdateDisplay();
        }/*private void BtnSignatureAndProteinSelection_Click(object sender, EventArgs e)*/