Пример #1
0
        /// <summary>
        /// event handler for the milk button tells drink customization what to disable
        /// changes screen to special requests customization
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void MilkButton(object sender, RoutedEventArgs e)
        {
            MarkarthMilk        mm    = new MarkarthMilk();
            DrinkCustomizations src   = new DrinkCustomizations(mm, 4);
            OrderWindow         order = this.FindAncestor <OrderWindow>();

            if (DataContext is Order orders)
            {
                orders.Add(mm);
            }
            order.Swap(src);
        }
Пример #2
0
        /// <summary>
        /// event handler for the coffee button tells drink customization what to disable
        /// changes screen to special requests customization
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void CoffeeButton(object sender, RoutedEventArgs e)
        {
            CandlehearthCoffee  chc   = new CandlehearthCoffee();
            DrinkCustomizations src   = new DrinkCustomizations(chc, 1);
            OrderWindow         order = this.FindAncestor <OrderWindow>();

            if (DataContext is Order orders)
            {
                orders.Add(chc);
            }
            order.Swap(src);
        }
Пример #3
0
        /// <summary>
        /// event handler for the apple juice button tells drink customization what to disable
        /// changes screen to special requests customization
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void AppleJuiceButton(object sender, RoutedEventArgs e)
        {
            AretinoAppleJuice   aj    = new AretinoAppleJuice();
            DrinkCustomizations src   = new DrinkCustomizations(aj, 3);
            OrderWindow         order = this.FindAncestor <OrderWindow>();

            if (DataContext is Order orders)
            {
                orders.Add(aj);
            }
            order.Swap(src);
        }
Пример #4
0
        /// <summary>
        /// event handler for the water button tells drink customization what to disable
        /// changes screen to special requests customization
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void WaterButton(object sender, RoutedEventArgs e)
        {
            WarriorWater        ww    = new WarriorWater();
            DrinkCustomizations src   = new DrinkCustomizations(ww, 2);
            OrderWindow         order = this.FindAncestor <OrderWindow>();

            if (DataContext is Order orders)
            {
                orders.Add(ww);
            }
            order.Swap(src);
        }
Пример #5
0
        /// <summary>
        /// event handler for the soda button tells drink customization what to disable
        /// changes screen to special requests customization
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void SodaButton(object sender, RoutedEventArgs e)
        {
            SailorSoda          ss    = new SailorSoda();
            DrinkCustomizations src   = new DrinkCustomizations(ss, 0);
            OrderWindow         order = this.FindAncestor <OrderWindow>();

            if (DataContext is Order orders)
            {
                orders.Add(ss);
            }
            order.Swap(src);
        }
Пример #6
0
 /// <summary>
 /// event handler for the back button chooses to change the screen to sides menu, drinks customizion, or flavor
 /// customization based on the private variable sideOrd drink
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void SizeBackButton(object sender, RoutedEventArgs e)
 {
     if (sideOrDrinkType == 5 || sideOrDrinkType == 6 || sideOrDrinkType == 7 || sideOrDrinkType == 8)// if it's a side
     {
         SidesMenu   swap  = new SidesMenu();
         OrderWindow order = this.FindAncestor <OrderWindow>();
         order.Swap(swap);
     }
     else if (sideOrDrinkType == 0)// if its a drink and a soda
     {
         FlavorCustomization swap  = new FlavorCustomization((SailorSoda)obj);
         OrderWindow         order = this.FindAncestor <OrderWindow>();
         order.Swap(swap);
     }
     else // if its any other drink type
     {
         DrinkCustomizations swap  = new DrinkCustomizations(obj, sideOrDrinkType);
         OrderWindow         order = this.FindAncestor <OrderWindow>();
         order.Swap(swap);
     }
 }
 void EditItem(object sender, RoutedEventArgs e)
 {
     if (DataContext is Order order)
     {
         if (sender is Button button)
         {
             if (button.DataContext is IOrderItem item)
             {
                 if (item is BriarheartBurger bb)
                 {
                     BurgerCustomization bc        = new BurgerCustomization(bb, 0);
                     OrderWindow         orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is DoubleDraugr dd)
                 {
                     BurgerCustomization bc        = new BurgerCustomization(dd, 1);
                     OrderWindow         orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is ThalmorTriple tt)
                 {
                     BurgerCustomization bc        = new BurgerCustomization(tt, 2);
                     OrderWindow         orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is GardenOrcOmelette goo)
                 {
                     OmeletteCustomization bc        = new OmeletteCustomization(goo);
                     OrderWindow           orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is PhillyPoacher pp)
                 {
                     PoacherCustomization bc        = new PoacherCustomization(pp);
                     OrderWindow          orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is SmokehouseSkeleton shs)
                 {
                     SkeletonCustomization bc        = new SkeletonCustomization(shs);
                     OrderWindow           orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is ThugsT_Bone ttb)
                 {
                     TBoneCustomization bc        = new TBoneCustomization(ttb);
                     OrderWindow        orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is DragonbornWaffleFries dwf)
                 {
                     SizeCustomization bc        = new SizeCustomization(5, dwf);
                     OrderWindow       orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is FriedMiraak fm)
                 {
                     SizeCustomization bc        = new SizeCustomization(6, fm);
                     OrderWindow       orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is MadOtarGrits mog)
                 {
                     SizeCustomization bc        = new SizeCustomization(7, mog);
                     OrderWindow       orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is VokunSalad vs)
                 {
                     SizeCustomization bc        = new SizeCustomization(8, vs);
                     OrderWindow       orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is AretinoAppleJuice aj)
                 {
                     DrinkCustomizations bc        = new DrinkCustomizations(aj, 3);
                     OrderWindow         orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is CandlehearthCoffee chc)
                 {
                     DrinkCustomizations bc        = new DrinkCustomizations(chc, 1);
                     OrderWindow         orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is MarkarthMilk mm)
                 {
                     DrinkCustomizations bc        = new DrinkCustomizations(mm, 4);
                     OrderWindow         orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is SailorSoda ss)
                 {
                     DrinkCustomizations bc        = new DrinkCustomizations(ss, 0);
                     OrderWindow         orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
                 if (item is WarriorWater ww)
                 {
                     DrinkCustomizations bc        = new DrinkCustomizations(ww, 2);
                     OrderWindow         orderList = this.FindAncestor <OrderWindow>();
                     orderList.Swap(bc);
                 }
             }
         }
     }
 }