/// <summary> /// Creates a click event for the Jerked Soda button /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnAddJerkedSodaClicked(object sender, RoutedEventArgs e) { var orderControl = this.FindAncestor <OrderControl>(); if (sender is Button) { var item = new JerkedSoda(); var screen = new DrinksCustomizeScreen(item, orderControl); screen.AddDecaf.IsEnabled = false; screen.AddRoomForCream.IsEnabled = false; screen.AddUnsweet.IsEnabled = false; screen.AddLemon.IsEnabled = false; AddItemAndOpenCustomScreen(item, screen); } }
/// <summary> /// Creates a click event for the Texas Tea button /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnAddTexasTeaClicked(object sender, RoutedEventArgs e) { var orderControl = this.FindAncestor <OrderControl>(); if (sender is Button) { var item = new TexasTea(); var screen = new DrinksCustomizeScreen(item, orderControl); screen.AddDecaf.IsEnabled = false; screen.AddRoomForCream.IsEnabled = false; screen.SodaIsSarsparilla.IsEnabled = false; screen.SodaIsCreamSoda.IsEnabled = false; screen.SodaIsOrangeSoda.IsEnabled = false; screen.SodaIsRootBeer.IsEnabled = false; screen.SodaIsBirchBeer.IsEnabled = false; AddItemAndOpenCustomScreen(item, screen); } }
/// <summary> /// Creates a click event for the Cowboy Coffee button /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnAddCowboyCoffeeClicked(object sender, RoutedEventArgs e) { var orderControl = this.FindAncestor <OrderControl>(); if (sender is Button) { var item = new CowboyCoffee(); var screen = new DrinksCustomizeScreen(item, orderControl); screen.AddUnsweet.IsEnabled = false; screen.AddLemon.IsEnabled = false; screen.SodaIsSarsparilla.IsEnabled = false; screen.SodaIsCreamSoda.IsEnabled = false; screen.SodaIsOrangeSoda.IsEnabled = false; screen.SodaIsRootBeer.IsEnabled = false; screen.SodaIsBirchBeer.IsEnabled = false; AddItemAndOpenCustomScreen(item, screen); } }
/// <summary> /// Reopens customization for a menu item /// </summary> /// <param name="sender">the listboxitem </param> /// <param name="args"></param> void ChangePastItem(object sender, SelectionChangedEventArgs args) { IOrderItem item = ((sender as ListBox).SelectedItem as IOrderItem); var oC = this.FindAncestor <OrderControl>(); if (item is Side side) { var screen = new SideCustomizationScreen(side, oC); OpenCustomScreen(side, screen); } else if (item is Entree entree) { if (item is AngryChicken ac) { var screen = new EntreeCustomizeScreen(ac, oC); screen.RemoveCheese.IsEnabled = false; screen.RemoveSourCream.IsEnabled = false; screen.RemoveGreenOnion.IsEnabled = false; screen.RemoveTortillaStrips.IsEnabled = false; screen.RemoveLettuce.IsEnabled = false; screen.RemoveBun.IsEnabled = false; screen.RemoveKetchup.IsEnabled = false; screen.RemoveMustard.IsEnabled = false; screen.RemoveTomato.IsEnabled = false; screen.RemoveMayo.IsEnabled = false; screen.RemoveBacon.IsEnabled = false; screen.RemoveEgg.IsEnabled = false; OpenCustomScreen(entree, screen); } else if (item is CowpokeChili cc) { var screen = new EntreeCustomizeScreen(cc, oC); screen.RemovePickle.IsEnabled = false; screen.RemoveBread.IsEnabled = false; screen.RemoveLettuce.IsEnabled = false; screen.RemoveBun.IsEnabled = false; screen.RemoveKetchup.IsEnabled = false; screen.RemoveMustard.IsEnabled = false; screen.RemoveTomato.IsEnabled = false; screen.RemoveMayo.IsEnabled = false; screen.RemoveBacon.IsEnabled = false; screen.RemoveEgg.IsEnabled = false; OpenCustomScreen(entree, screen); } else if (item is DakotaDoubleBurger ddb) { var screen = new EntreeCustomizeScreen(ddb, oC); screen.RemoveBread.IsEnabled = false; screen.RemoveSourCream.IsEnabled = false; screen.RemoveGreenOnion.IsEnabled = false; screen.RemoveTortillaStrips.IsEnabled = false; screen.RemoveBacon.IsEnabled = false; screen.RemoveEgg.IsEnabled = false; OpenCustomScreen(entree, screen); } else if (item is PecosPulledPork ppp) { var screen = new EntreeCustomizeScreen(ppp, oC); screen.RemoveCheese.IsEnabled = false; screen.RemoveSourCream.IsEnabled = false; screen.RemoveGreenOnion.IsEnabled = false; screen.RemoveTortillaStrips.IsEnabled = false; screen.RemoveLettuce.IsEnabled = false; screen.RemoveBun.IsEnabled = false; screen.RemoveKetchup.IsEnabled = false; screen.RemoveMustard.IsEnabled = false; screen.RemoveTomato.IsEnabled = false; screen.RemoveMayo.IsEnabled = false; screen.RemoveBacon.IsEnabled = false; screen.RemoveEgg.IsEnabled = false; OpenCustomScreen(entree, screen); } else if (item is RustlersRibs) { OpenCustomScreen(entree, new MenuItemSelectionControl()); } else if (item is TexasTripleBurger ttb) { var screen = new EntreeCustomizeScreen(ttb, oC); screen.RemoveBread.IsEnabled = false; screen.RemoveSourCream.IsEnabled = false; screen.RemoveGreenOnion.IsEnabled = false; screen.RemoveTortillaStrips.IsEnabled = false; OpenCustomScreen(entree, screen); } else if (item is TrailBurger tb) { var screen = new EntreeCustomizeScreen(tb, oC); screen.RemoveBread.IsEnabled = false; screen.RemoveSourCream.IsEnabled = false; screen.RemoveGreenOnion.IsEnabled = false; screen.RemoveTortillaStrips.IsEnabled = false; screen.RemoveLettuce.IsEnabled = false; screen.RemoveTomato.IsEnabled = false; screen.RemoveMayo.IsEnabled = false; screen.RemoveBacon.IsEnabled = false; screen.RemoveEgg.IsEnabled = false; OpenCustomScreen(entree, screen); } } else if (item is Drink drink) { if (item is CowboyCoffee cc) { var screen = new DrinksCustomizeScreen(cc, oC); screen.AddUnsweet.IsEnabled = false; screen.AddLemon.IsEnabled = false; screen.SodaIsSarsparilla.IsEnabled = false; screen.SodaIsCreamSoda.IsEnabled = false; screen.SodaIsOrangeSoda.IsEnabled = false; screen.SodaIsRootBeer.IsEnabled = false; screen.SodaIsBirchBeer.IsEnabled = false; OpenCustomScreen(drink, screen); } else if (item is JerkedSoda js) { var screen = new DrinksCustomizeScreen(js, oC); screen.AddDecaf.IsEnabled = false; screen.AddRoomForCream.IsEnabled = false; screen.AddUnsweet.IsEnabled = false; screen.AddLemon.IsEnabled = false; OpenCustomScreen(drink, screen); } else if (item is TexasTea tt) { var screen = new DrinksCustomizeScreen(tt, oC); screen.AddDecaf.IsEnabled = false; screen.AddRoomForCream.IsEnabled = false; screen.SodaIsSarsparilla.IsEnabled = false; screen.SodaIsCreamSoda.IsEnabled = false; screen.SodaIsOrangeSoda.IsEnabled = false; screen.SodaIsRootBeer.IsEnabled = false; screen.SodaIsBirchBeer.IsEnabled = false; OpenCustomScreen(drink, screen); } else if (item is Water w) { var screen = new DrinksCustomizeScreen(w, oC); screen.AddDecaf.IsEnabled = false; screen.AddRoomForCream.IsEnabled = false; screen.AddUnsweet.IsEnabled = false; screen.SodaIsSarsparilla.IsEnabled = false; screen.SodaIsCreamSoda.IsEnabled = false; screen.SodaIsOrangeSoda.IsEnabled = false; screen.SodaIsRootBeer.IsEnabled = false; screen.SodaIsBirchBeer.IsEnabled = false; OpenCustomScreen(drink, screen); } } }