}/*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)*/
}/*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)*/
}/*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)*/