void ClickDone(object sender, RoutedEventArgs e) { MainMenuSelection custom = new MainMenuSelection(); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); }
/// <summary> /// Event handler for when the customize drink button is clicked for a combo /// Sends the user to the correct customization screen /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void CustomizeDrinkClick(object sender, RoutedEventArgs e) { if (combo.Drink is WarriorWater w) { CustomizeWarriorWater custom = new CustomizeWarriorWater(w, combo, true); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } else if (combo.Drink is SailorSoda s) { CustomizeSailorSoda custom = new CustomizeSailorSoda(s, combo, true); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } else if (combo.Drink is AretinoAppleJuice a) { CustomizeAretinoAppleJuice custom = new CustomizeAretinoAppleJuice(a, combo, true); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } else if (combo.Drink is MarkarthMilk m) { CustomizeMarkarthMilk custom = new CustomizeMarkarthMilk(m, combo, true); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } else if (combo.Drink is CandlehearthCoffee c) { CustomizeCandlehearthCoffee custom = new CustomizeCandlehearthCoffee(c, combo, true); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } }
/// <summary> /// Event handler for when the customize side button is clicked for a combo /// Sends the user to the correct customization screen /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void CustomizeSideClick(object sender, RoutedEventArgs e) { if (combo.Side is DragonbornWaffleFries dwf) { CustomizeDragonbornWaffleFries custom = new CustomizeDragonbornWaffleFries(dwf, combo, true); OrderComponent order = this.FindAncestor <OrderComponent>(); order.Swap(custom); } else if (combo.Side is VokunSalad v) { CustomizeVokunSalad custom = new CustomizeVokunSalad(v, combo, true); OrderComponent order = this.FindAncestor <OrderComponent>(); order.Swap(custom); } else if (combo.Side is MadOtarGrits mog) { CustomizeMadOtarGrits custom = new CustomizeMadOtarGrits(mog, combo, true); OrderComponent order = this.FindAncestor <OrderComponent>(); order.Swap(custom); } else if (combo.Side is FriedMiraak f) { CustomizeFriedMiraak custom = new CustomizeFriedMiraak(f, combo, true); OrderComponent order = this.FindAncestor <OrderComponent>(); order.Swap(custom); } }
/// <summary> /// Event handler for if the user finishes their order /// Should clear order summary and order number should increment /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void OnFinishClick(object sender, RoutedEventArgs e) { PaymentOptions pay = new PaymentOptions(); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); // Find the Order Component that is a parent of the current order summary orderComponent.Swap(pay); }
void ClickSidesButton(object sender, RoutedEventArgs e) { SelectSides selectSides = new SelectSides(); OrderComponent order = this.FindAncestor <OrderComponent>(); order.Swap(selectSides); }
/// <summary> /// Event handler for if user wants to return to their order /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void ReturnToOrderClicked(object sender, RoutedEventArgs e) { MainMenuSelection main = new MainMenuSelection(); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); // Find the Order Component that is a parent of the current order summary orderComponent.Swap(main); }
/// <summary> /// Event handler for when the user wants to return to the main menu /// Should take them back to the main menu /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mainMenuButton_Click(object sender, RoutedEventArgs e) { MainMenuSelection main = new MainMenuSelection(); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(main); }
void ChangeDrinkClick(object sender, RoutedEventArgs e) { SelectDrinks custom = new SelectDrinks(combo, true); OrderComponent order = this.FindAncestor <OrderComponent>(); order.Swap(custom); }
/// <summary> /// Event handler for if user selects cash payment /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void OnCashSelect(object sender, RoutedEventArgs e) { if (DataContext is Order order) { CashPayment cashPay = new CashPayment(order); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); // Find the Order Component that is a parent of the current order summary orderComponent.Swap(cashPay); } }
/// <summary> /// Event handler for if the user cancels the order /// Should clear order summary and retain the same order number /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void OnCancelClick(object sender, RoutedEventArgs e) { Order newOrder = new Order(); MainMenuSelection main = new MainMenuSelection(); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); // Find the Order Component that is a parent of the current order summary orderComponent.DataContext = newOrder; // Set the data context of the order component to be the new order orderComponent.Swap(main); }
/// <summary> /// Event handler for if the users wants to return to their order and is not ready to pay yet /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void OnReturnSelect(object sender, RoutedEventArgs e) { if (DataContext is Order order) { MainMenuSelection main = new MainMenuSelection(); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(main); } }
/// <summary> /// Event handler for if the user wants to finalize the sale /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void FinalizeSaleClicked(object sender, RoutedEventArgs e) { cashDrawer.PrintReceipt(true, thisOrder); Order newOrder = new Order(); MainMenuSelection main = new MainMenuSelection(); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); // Find the Order Component that is a parent of the current order summary orderComponent.DataContext = newOrder; // Set the data context of the order component to be the new order orderComponent.Swap(main); }
void ClickComboButton(object sender, RoutedEventArgs e) { if (DataContext is Order order) { ComboMeal c = new ComboMeal(); order.Add(c); CustomizeComboMeal customizeCombo = new CustomizeComboMeal(c); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(customizeCombo); } }
void ClickDone(object sender, RoutedEventArgs e) { if (IsCombo) { CustomizeComboMeal custom = new CustomizeComboMeal(c); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } else { SelectEntrees custom = new SelectEntrees(); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } }
/// <summary> /// Event handler for if user selects credit card payment /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void OnCreditSelect(object sender, RoutedEventArgs e) { if (DataContext is Order order) { var result = CardReader.RunCard(order.Total); if (result is CardTransactionResult.Approved) { Order newOrder = new Order(); UpdateCashDrawer cashDrawer = new UpdateCashDrawer(order.Total); MainMenuSelection main = new MainMenuSelection(); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); // Find the Order Component that is a parent of the current order summary orderComponent.DataContext = newOrder; // Set the data context of the order component to be the new order orderComponent.Swap(main); cashDrawer.PrintReceipt(false, order); // Print receipt for false (paying with card, not cash), and this order } } }
/// <summary> /// Event handler for when the customize entree button is clicked for a combo. /// Sends the user to the correct customization screen /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void CustomizeEntreeClick(object sender, RoutedEventArgs e) { if (combo.Entree is BriarheartBurger b) { CustomizeBriarheartBurger custom = new CustomizeBriarheartBurger(b, combo, true); OrderComponent order = this.FindAncestor <OrderComponent>(); order.Swap(custom); } else if (combo.Entree is DoubleDraugr d) { CustomizeDoubleDraugr custom = new CustomizeDoubleDraugr(d, combo, true); OrderComponent order = this.FindAncestor <OrderComponent>(); order.Swap(custom); } else if (combo.Entree is ThalmorTriple t) { CustomizeThalmorTriple custom = new CustomizeThalmorTriple(t, combo, true); OrderComponent order = this.FindAncestor <OrderComponent>(); order.Swap(custom); } else if (combo.Entree is GardenOrcOmelette g) { CustomizeGardenOrcOmelette custom = new CustomizeGardenOrcOmelette(g, combo, true); OrderComponent order = this.FindAncestor <OrderComponent>(); order.Swap(custom); } else if (combo.Entree is ThugsTBone tb) { CustomizeThugsTBone custom = new CustomizeThugsTBone(tb, combo, true); OrderComponent order = this.FindAncestor <OrderComponent>(); order.Swap(custom); } else if (combo.Entree is SmokehouseSkeleton s) { CustomizeSmokehouseSkeleton custom = new CustomizeSmokehouseSkeleton(s, combo, true); OrderComponent order = this.FindAncestor <OrderComponent>(); order.Swap(custom); } else if (combo.Entree is PhillyPoacher p) { CustomizePhillyPoacher custom = new CustomizePhillyPoacher(p, combo, true); OrderComponent order = this.FindAncestor <OrderComponent>(); order.Swap(custom); } }
void AddVokunSalad(object sender, RoutedEventArgs e) { if (IsCombo) { c.Side = new VokunSalad(); CustomizeComboMeal custom = new CustomizeComboMeal(c); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } if (DataContext is Order order) { VokunSalad v = new VokunSalad(); order.Add(v); CustomizeVokunSalad custom = new CustomizeVokunSalad(v, false); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } }
void AddDoubleDraugr(object sender, RoutedEventArgs e) { if (IsCombo) { c.Entree = new DoubleDraugr(); CustomizeComboMeal custom = new CustomizeComboMeal(c); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } else if (DataContext is Order order) { DoubleDraugr d = new DoubleDraugr(); order.Add(d); CustomizeDoubleDraugr custom = new CustomizeDoubleDraugr(d, false); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } }
void AddThalmorTriple(object sender, RoutedEventArgs e) { if (IsCombo) { c.Entree = new ThalmorTriple(); CustomizeComboMeal custom = new CustomizeComboMeal(c); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } if (DataContext is Order order) { ThalmorTriple t = new ThalmorTriple(); order.Add(t); CustomizeThalmorTriple custom = new CustomizeThalmorTriple(t, false); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } }
void AddPhillyPoacher(object sender, RoutedEventArgs e) { if (IsCombo) { c.Entree = new PhillyPoacher(); CustomizeComboMeal custom = new CustomizeComboMeal(c); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } if (DataContext is Order order) { PhillyPoacher p = new PhillyPoacher(); order.Add(p); CustomizePhillyPoacher custom = new CustomizePhillyPoacher(p, false); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } }
void AddBriarheartBurger(object sender, RoutedEventArgs e) { if (IsCombo) { c.Entree = new BriarheartBurger(); CustomizeComboMeal custom = new CustomizeComboMeal(c); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } if (DataContext is Order order) { BriarheartBurger b = new BriarheartBurger(); order.Add(b); CustomizeBriarheartBurger custom = new CustomizeBriarheartBurger(b, false); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } }
void AddSmokehouseSkeleton(object sender, RoutedEventArgs e) { if (IsCombo) { c.Entree = new SmokehouseSkeleton(); CustomizeComboMeal custom = new CustomizeComboMeal(c); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } if (DataContext is Order order) { SmokehouseSkeleton s = new SmokehouseSkeleton(); order.Add(s); CustomizeSmokehouseSkeleton custom = new CustomizeSmokehouseSkeleton(s, false); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } }
void AddGardenOrcOmelette(object sender, RoutedEventArgs e) { if (IsCombo) { c.Entree = new GardenOrcOmelette(); CustomizeComboMeal custom = new CustomizeComboMeal(c); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } if (DataContext is Order order) { GardenOrcOmelette g = new GardenOrcOmelette(); order.Add(g); CustomizeGardenOrcOmelette custom = new CustomizeGardenOrcOmelette(g, false); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } }
void AddAretinoAppleJuice(object sender, RoutedEventArgs e) { if (IsCombo) { c.Drink = new AretinoAppleJuice(); CustomizeComboMeal custom = new CustomizeComboMeal(c); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } if (DataContext is Order order) { AretinoAppleJuice a = new AretinoAppleJuice(); order.Add(a); CustomizeAretinoAppleJuice custom = new CustomizeAretinoAppleJuice(a, false); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } }
void AddMadOtarGrits(object sender, RoutedEventArgs e) { if (IsCombo) { c.Side = new MadOtarGrits(); CustomizeComboMeal custom = new CustomizeComboMeal(c); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } if (DataContext is Order order) { MadOtarGrits m = new MadOtarGrits(); order.Add(m); CustomizeMadOtarGrits custom = new CustomizeMadOtarGrits(m, false); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } }
void AddMarkarthMilk(object sender, RoutedEventArgs e) { if (IsCombo) { c.Drink = new MarkarthMilk(); CustomizeComboMeal custom = new CustomizeComboMeal(c); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } if (DataContext is Order order) { MarkarthMilk m = new MarkarthMilk(); order.Add(m); CustomizeMarkarthMilk custom = new CustomizeMarkarthMilk(m, false); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } }
void AddSailorSoda(object sender, RoutedEventArgs e) { if (IsCombo) { c.Drink = new SailorSoda(); CustomizeComboMeal custom = new CustomizeComboMeal(c); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } if (DataContext is Order order) { SailorSoda s = new SailorSoda(); order.Add(s); CustomizeSailorSoda custom = new CustomizeSailorSoda(s, false); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } }
void AddCandlehearthCoffee(object sender, RoutedEventArgs e) { if (IsCombo) { c.Drink = new CandlehearthCoffee(); CustomizeComboMeal custom = new CustomizeComboMeal(c); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } if (DataContext is Order order) { CandlehearthCoffee c = new CandlehearthCoffee(); order.Add(c); CustomizeCandlehearthCoffee custom = new CustomizeCandlehearthCoffee(c, false); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } }
void AddWarriorWater(object sender, RoutedEventArgs e) { if (IsCombo) { c.Drink = new WarriorWater(); CustomizeComboMeal custom = new CustomizeComboMeal(c); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } if (DataContext is Order order) { WarriorWater w = new WarriorWater(); order.Add(w); CustomizeWarriorWater custom = new CustomizeWarriorWater(w, false); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } }
void AddFriedMiraak(object sender, RoutedEventArgs e) { if (IsCombo) { c.Side = new FriedMiraak(); CustomizeComboMeal custom = new CustomizeComboMeal(c); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } if (DataContext is Order order) { FriedMiraak f = new FriedMiraak(); order.Add(f); CustomizeFriedMiraak custom = new CustomizeFriedMiraak(f, false); OrderComponent orderComponent = this.FindAncestor <OrderComponent>(); orderComponent.Swap(custom); } }