Beispiel #1
0
        /// <summary>
        /// Handles what happens when the Customize Entree button is clicked.
        /// </summary>
        /// <param name="sender">The object being clicked.</param>
        /// <param name="e">The RoutedEventArgs.</param>
        private void EntreeClick(object sender, RoutedEventArgs e)
        {
            CustomizeEntree page = new CustomizeEntree();

            page.InitPage(_combo.Entree, this);
            page.SetEditedEntree(_combo.Entree);
            NavigationService.Navigate(page);
        }
Beispiel #2
0
 public void EntreeClick(object sender, RoutedEventArgs args)
 {
     if (DataContext is Order order)
     {
         if (CollectionViewSource.GetDefaultView(order.Items).CurrentItem is CretaceousCombo com)
         {
             CustomizeEntree e = new CustomizeEntree();
             e.LoadButtonsAndContent(com.Entree);
             NavigationService.Navigate(e);
         }
     }
 }
Beispiel #3
0
        /// <summary>
        /// Handles what happens when an entree button is clicked.
        /// </summary>
        /// <param name="sender">The object being clicked.</param>
        /// <param name="args">The RoutedEventArgs.</param>
        private void EntreeClick(object sender, RoutedEventArgs args)
        {
            Button b = sender as Button;

            if (b != null)
            {
                Entree entree = new Brontowurst();

                switch (b.Tag)
                {
                case "Brontowurst":
                    entree = new Brontowurst();
                    break;

                case "DinoNuggets":
                    entree = new DinoNuggets();
                    break;

                case "PrehistoricPBJ":
                    entree = new PrehistoricPBJ();
                    break;

                case "PterodactylWings":
                    entree = new PterodactylWings();
                    break;

                case "SteakosaurusBurger":
                    entree = new SteakosaurusBurger();
                    break;

                case "TRexKingBurger":
                    entree = new TRexKingBurger();
                    break;

                case "VelociWrap":
                    entree = new VelociWrap();
                    break;
                }

                AddItem(entree);

                CustomizeEntree nextPage = new CustomizeEntree();
                nextPage.InitPage(entree, new MenuCategorySelection());
                NavigationService.Navigate(nextPage);
            }

            //NavigationService.Navigate(new MenuCategorySelection());
        }
Beispiel #4
0
        private void TryAddEntree(Entree e)
        {
            if (entree == null)
            {
                Order order = (Order)DataContext;
                entree = e;
                if (!isForCombo)
                {
                    order.Add(entree);
                }
            }
            else
            {
                Order order = (Order)DataContext;
                if (!isForCombo)
                {
                    order.Remove(entree);
                }

                entree = e;
                if (!isForCombo)
                {
                    order.Add(entree);
                }
            }
            CustomizeEntree ce = new CustomizeEntree(entree, isForCombo);

            ce.DataContext = this.DataContext;
            NavigationService.Navigate(ce);

            /*
             * MainWindow mw = (MainWindow)Application.Current.MainWindow;
             * mw.OrderList.OrderItems.SelectedItem = entree;
             *
             * NavigationService.Navigate(new MenuCategorySelection());
             */
        }
 public void EntreeClick(object sender, RoutedEventArgs args)
 {
     if (DataContext is Order order)
     {
         if (sender == BrontowurstButton)
         {
             order.Items.Add(new Brontowurst());
             CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast();
             CustomizeEntree e = new CustomizeEntree();
             e.LoadButtonsAndContent(new Brontowurst());
             NavigationService.Navigate(e);
         }
         else if (sender == VelociwrapButton)
         {
             order.Items.Add(new VelociWrap());
             CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast();
             CustomizeEntree e = new CustomizeEntree();
             e.LoadButtonsAndContent(new VelociWrap());
             NavigationService.Navigate(e);
         }
         else if (sender == SteakosaurusButton)
         {
             order.Items.Add(new SteakosaurusBurger());
             CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast();
             CustomizeEntree e = new CustomizeEntree();
             e.LoadButtonsAndContent(new SteakosaurusBurger());
             NavigationService.Navigate(e);
         }
         else if (sender == TRexButton)
         {
             order.Items.Add(new TRexKingBurger());
             CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast();
             CustomizeEntree e = new CustomizeEntree();
             e.LoadButtonsAndContent(new TRexKingBurger());
             NavigationService.Navigate(e);
         }
         else if (sender == DinoNuggetsButton)
         {
             order.Items.Add(new DinoNuggets());
             CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast();
             CustomizeEntree e = new CustomizeEntree();
             e.LoadButtonsAndContent(new DinoNuggets());
             NavigationService.Navigate(e);
         }
         else if (sender == WingsButton)
         {
             order.Items.Add(new PterodactylWings());
             CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast();
             CustomizeEntree e = new CustomizeEntree();
             e.LoadButtonsAndContent(new PterodactylWings());
             NavigationService.Navigate(e);
         }
         else
         {
             order.Items.Add(new PrehistoricPBJ());
             CollectionViewSource.GetDefaultView(order.Items).MoveCurrentToLast();
             CustomizeEntree e = new CustomizeEntree();
             e.LoadButtonsAndContent(new PrehistoricPBJ());
             NavigationService.Navigate(e);
         }
     }
 }
        public void OnAddEntreeButtonClicked(object sender, RoutedEventArgs e)
        {
            var orderControl = this.FindAncestor <OrderControl>();

            if (DataContext is Order order)
            {
                if (sender is Button button)
                {
                    switch (button.Tag)
                    {
                    case "CowpokeChili":
                        var cowpokeEntree = new CowpokeChili();
                        var screen        = new CustomizeEntree("Cowpoke Chili");
                        screen.DataContext = cowpokeEntree;
                        order.Add(cowpokeEntree);
                        orderControl.SwapScreen(screen);
                        order.InvokePropertyChanged();
                        break;

                    case "RustlersRibs":
                        var rustlersEntree = new RustlersRibs();
                        screen             = new CustomizeEntree("Rustlers Ribs");
                        screen.DataContext = rustlersEntree;
                        order.Add(rustlersEntree);
                        orderControl.SwapScreen(screen);
                        order.InvokePropertyChanged();
                        break;

                    case "AngryChicken":
                        var angryEntree = new AngryChicken();
                        screen             = new CustomizeEntree("Angry Chicken");
                        screen.DataContext = angryEntree;
                        order.Add(angryEntree);
                        orderControl.SwapScreen(screen);
                        order.InvokePropertyChanged();
                        break;

                    case "TexasTripleBurger":
                        var texasEntree = new TexasTripleBurger();
                        screen             = new CustomizeEntree("Texas Triple");
                        screen.DataContext = texasEntree;
                        order.Add(texasEntree);
                        orderControl.SwapScreen(screen);
                        break;

                    case "PecosPulledPork":
                        var pecosEntree = new PecosPulledPork();
                        screen             = new CustomizeEntree("Pecos Pulled Pork");
                        screen.DataContext = pecosEntree;
                        order.Add(pecosEntree);
                        orderControl.SwapScreen(screen);
                        break;

                    case "DakotaDoubleBurger":
                        var dakotaEntree = new DakotaDoubleBurger();
                        screen             = new CustomizeEntree("Dakota Double Burger");
                        screen.DataContext = dakotaEntree;
                        order.Add(dakotaEntree);
                        orderControl.SwapScreen(screen);
                        break;

                    case "TrailBurger":
                        var trailEntree = new TrailBurger();
                        screen             = new CustomizeEntree("Trail Burger");
                        screen.DataContext = trailEntree;
                        order.Add(trailEntree);
                        orderControl.SwapScreen(screen);
                        break;
                    }
                }
            }
        }
        public void OnItemSelectionChanged(object sender, SelectionChangedEventArgs e, OrderControl oc, Order o)
        {
            var item = e.AddedItems[0];

            if (e.AddedItems[0] is CowpokeChili)
            {
                var screen = new CustomizeEntree("Cowpoke Chili");
                screen.DataContext = item;
                oc.SwapScreen(screen);
            }
            if (e.AddedItems[0] is AngryChicken)
            {
                var screen = new CustomizeEntree("Angry Chicken");
                screen.DataContext = item;
                oc.SwapScreen(screen);
            }
            if (e.AddedItems[0] is DakotaDoubleBurger)
            {
                var screen = new CustomizeEntree("Dakota Double Burger");
                screen.DataContext = item;
                oc.SwapScreen(screen);
            }
            if (e.AddedItems[0] is PecosPulledPork)
            {
                var screen = new CustomizeEntree("Pecos Pulled Pork");
                screen.DataContext = item;
                oc.SwapScreen(screen);
            }
            if (e.AddedItems[0] is RustlersRibs)
            {
                var screen = new CustomizeEntree("Rustler Ribs");
                screen.DataContext = item;
                oc.SwapScreen(screen);
            }
            if (e.AddedItems[0] is TexasTripleBurger)
            {
                var screen = new CustomizeEntree("Texas Triple Burger");
                screen.DataContext = item;
                oc.SwapScreen(screen);
            }
            if (e.AddedItems[0] is TrailBurger)
            {
                var screen = new CustomizeEntree("Trail Burger");
                screen.DataContext = item;
                oc.SwapScreen(screen);
            }

            if (e.AddedItems[0] is CowboyCoffee)
            {
                var screen = new CustomizeDrink("Cowboy Coffee", e.AddedItems[0], o);
                screen.DataContext = item;
                oc.SwapScreen(screen);
            }
            if (e.AddedItems[0] is JerkedSoda)
            {
                var screen = new CustomizeDrink("Jerked Soda", e.AddedItems[0], o);
                screen.DataContext = item;
                oc.SwapScreen(screen);
            }
            if (e.AddedItems[0] is TexasTea)
            {
                var screen = new CustomizeDrink("Texas Tea", e.AddedItems[0], o);
                screen.DataContext = item;
                oc.SwapScreen(screen);
            }
            if (e.AddedItems[0] is Water)
            {
                var screen = new CustomizeDrink("Water", e.AddedItems[0], o);
                screen.DataContext = item;
                oc.SwapScreen(screen);
            }

            if (e.AddedItems[0] is BakedBeans)
            {
                var screen = new CustomizeSide(e.AddedItems[0], o);
                screen.DataContext = item;
                oc.SwapScreen(screen);
            }
            if (e.AddedItems[0] is ChiliCheeseFries)
            {
                var screen = new CustomizeSide(e.AddedItems[0], o);
                screen.DataContext = item;
                oc.SwapScreen(screen);
            }
            if (e.AddedItems[0] is CornDodgers)
            {
                var screen = new CustomizeSide(e.AddedItems[0], o);
                screen.DataContext = item;
                oc.SwapScreen(screen);
            }
            if (e.AddedItems[0] is PanDeCampo)
            {
                var screen = new CustomizeSide(e.AddedItems[0], o);
                screen.DataContext = item;
                oc.SwapScreen(screen);
            }
        }
Beispiel #8
0
        /// <summary>
        /// Generalized event handler for button IOrderItem button clicks
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void OnIOrderItemButtonClicked(object sender, RoutedEventArgs e)
        {
            var orderControl = this.FindAncestor <OrderControl>();

            if (DataContext is Order CurrentOrder)
            {
                if (sender is Button button)
                {
                    switch (button.Tag)
                    {
                    case "CowpokeChili":
                    {
                        var item   = new CowpokeChili();
                        var screen = new CustomizeEntree(item as IOrderItem);
                        CurrentOrder.Add(item);
                        orderControl.SwapScreen(screen);
                        break;
                    }

                    case "AngryChicken":
                    {
                        var item   = new AngryChicken();
                        var screen = new CustomizeEntree(item as IOrderItem);
                        CurrentOrder.Add(item);
                        orderControl.SwapScreen(screen);
                        break;
                    }

                    case "DakotaDoubleBurger":
                    {
                        var item   = new DakotaDoubleBurger();
                        var screen = new CustomizeEntree(item as IOrderItem);
                        CurrentOrder.Add(item);
                        orderControl.SwapScreen(screen);
                        break;
                    }

                    case "PecosPulledPork":
                    {
                        var item   = new PecosPulledPork();
                        var screen = new CustomizeEntree(item as IOrderItem);
                        CurrentOrder.Add(item);
                        orderControl.SwapScreen(screen);
                        break;
                    }

                    case "RustlersRibs":
                    {
                        var item = new RustlersRibs();
                        CurrentOrder.Add(item);
                        break;
                    }

                    case "TexasTripleBurger":
                    {
                        var item   = new TexasTripleBurger();
                        var screen = new CustomizeEntree(item as IOrderItem);
                        CurrentOrder.Add(item);
                        orderControl.SwapScreen(screen);
                        break;
                    }

                    case "TrailBurger":
                    {
                        var item   = new TrailBurger();
                        var screen = new CustomizeEntree(item as IOrderItem);
                        CurrentOrder.Add(item);
                        orderControl.SwapScreen(screen);
                        break;
                    }

                    case "BakedBeans":
                    {
                        var item   = new BakedBeans();
                        var screen = new CustomizeSide(item);
                        CurrentOrder.Add(item);
                        orderControl.SwapScreen(screen);
                        break;
                    }

                    case "ChiliCheeseFries":
                    {
                        var item   = new ChiliCheeseFries();
                        var screen = new CustomizeSide(item);
                        CurrentOrder.Add(item);
                        orderControl.SwapScreen(screen);
                        break;
                    }

                    case "CornDodgers":
                    {
                        var item   = new CornDodgers();
                        var screen = new CustomizeSide(item);
                        CurrentOrder.Add(item);
                        orderControl.SwapScreen(screen);
                        break;
                    }

                    case "PanDeCampo":
                    {
                        var item   = new PanDeCampo();
                        var screen = new CustomizeSide(item);
                        CurrentOrder.Add(item);
                        orderControl.SwapScreen(screen);
                        break;
                    }

                    case "CowboyCoffee":
                    {
                        var item   = new CowboyCoffee();
                        var screen = new CustomizeDrink(item);
                        CurrentOrder.Add(item);
                        orderControl.SwapScreen(screen);
                        break;
                    }

                    case "JerkedSoda":
                    {
                        var item   = new JerkedSoda();
                        var screen = new CustomizeDrink(item);
                        CurrentOrder.Add(item);
                        orderControl.SwapScreen(screen);
                        break;
                    }

                    case "TexasTea":
                    {
                        var item   = new TexasTea();
                        var screen = new CustomizeDrink(item);
                        CurrentOrder.Add(item);
                        orderControl.SwapScreen(screen);
                        break;
                    }

                    case "Water":
                    {
                        var item   = new Water();
                        var screen = new CustomizeDrink(item);
                        CurrentOrder.Add(item);
                        orderControl.SwapScreen(screen);
                        break;
                    }
                    }
                }
            }
        }
        public void OnItemAddEntreeClicked(object sender, RoutedEventArgs e)
        {
            IOrderItem entree;
            var        orderControl = this.FindAncestor <OrderControl>();

            if (DataContext is Order order)
            {
                if (sender is Button button)
                {
                    switch (button.Name)
                    {
                    case "AddCowPokeChilli":
                        entree = new CowpokeChili();
                        var screen = new CustomizeEntree();
                        screen.DataContext = entree;
                        order.Add(entree);
                        orderControl.SwapScreen(screen);
                        screen.Title.Text = "Customize Cowpoke Chilli";
                        screen.ChilliMenu();
                        break;

                    case "AddRustlersRibs":
                        entree = new RustlersRibs();
                        var screen2 = new CustomizeEntree();
                        screen2.DataContext = entree;
                        order.Add(entree);
                        orderControl.SwapScreen(screen2);
                        screen2.Title.Text = "Customize Rustler's Ribs";
                        break;

                    case "AddPecosPulledPork":
                        entree = new PecosPulledPork();
                        var screen3 = new CustomizeEntree();
                        screen3.DataContext = entree;
                        order.Add(entree);
                        orderControl.SwapScreen(screen3);
                        screen3.Title.Text = "Customize Pecos Pulled Pork";
                        screen3.PecosPulledPork();
                        break;

                    case "AddTrailBurger":
                        entree = new TrailBurger();
                        var screen4 = new CustomizeEntree();
                        screen4.DataContext = entree;
                        order.Add(entree);
                        orderControl.SwapScreen(screen4);
                        screen4.Title.Text = "Customize Trail Burger";
                        screen4.TrailBurger();
                        break;

                    case "DakotaDoubleBurger":
                        entree = new DakotaDoubleBurger();
                        var screen5 = new CustomizeEntree();
                        screen5.DataContext = entree;
                        order.Add(entree);
                        orderControl.SwapScreen(screen5);
                        screen5.Title.Text = "Customize Dakota Double Burger";
                        screen5.DakotaDouble();
                        break;

                    case "AddTexasTripleBurger":
                        entree = new TexasTripleBurger();
                        var screen6 = new CustomizeEntree();
                        screen6.DataContext = entree;
                        order.Add(entree);
                        orderControl.SwapScreen(screen6);
                        screen6.Title.Text = "Customize Texas Triple Burger";
                        screen6.TexasTriple();
                        break;

                    case "AddAngryChicken":
                        entree = new AngryChicken();
                        var screen7 = new CustomizeEntree();
                        screen7.DataContext = entree;
                        order.Add(entree);
                        orderControl.SwapScreen(screen7);
                        screen7.Title.Text = "Customize Angry Chicken";
                        screen7.AngryChickenMenu();
                        break;
                    }
                }
            }
        }
Beispiel #10
0
        private void OnItemSelectChange(object sender, SelectionChangedEventArgs e)
        {
            var Control = this.FindAncestor <OrderControl>();

            if (Control == null)
            {
                return;
            }

            foreach (object Item in e.AddedItems)
            {
                if (Item is CowpokeChili)
                {
                    var cpc = new CustomizeEntree();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Cowpoke Chilli";
                    cpc.ChilliMenu();
                }
                else if (Item is AngryChicken)
                {
                    var cpc = new CustomizeEntree();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Angry Chicken";
                    cpc.AngryChickenMenu();
                }
                else if (Item is DakotaDoubleBurger)
                {
                    var cpc = new CustomizeEntree();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Dakota Double Burger";
                    cpc.DakotaDouble();
                }
                else if (Item is PecosPulledPork)
                {
                    var cpc = new CustomizeEntree();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Pecos Pulled Pork";
                    cpc.PecosPulledPork();
                }
                else if (Item is RustlersRibs)
                {
                    var cpc = new CustomizeEntree();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Rustler's Ribs";
                }
                else if (Item is TrailBurger)
                {
                    var cpc = new CustomizeEntree();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Trail Burger";
                    cpc.TrailBurger();
                }
                else if (Item is TexasTripleBurger)
                {
                    var cpc = new CustomizeEntree();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Texas Triple Burger";
                    cpc.TexasTriple();
                }
                else if (Item is BakedBeans)
                {
                    var cpc = new CustomizeSides();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Baked Beans";
                }
                else if (Item is ChiliCheeseFries)
                {
                    var cpc = new CustomizeSides();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Chilli Cheese Fries";
                }
                else if (Item is PanDeCampo)
                {
                    var cpc = new CustomizeSides();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Pan De Campo";
                }
                else if (Item is CornDodgers)
                {
                    var cpc = new CustomizeSides();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Corn Dodgers";
                }
                else if (Item is JerkedSoda)
                {
                    var cpc = new CustomizeDrink();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Jerked Soda";
                    cpc.SodaMenu();
                }
                else if (Item is CowboyCoffee)
                {
                    var cpc = new CustomizeDrink();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Cowboy Coffee";
                    cpc.CoffeeMenu();
                }
                else if (Item is Water)
                {
                    var cpc = new CustomizeDrink();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Water";
                    cpc.WaterMenu();
                }
                else if (Item is TexasTea)
                {
                    var cpc = new CustomizeDrink();
                    cpc.DataContext = Item;
                    Control.SwapScreen(cpc);
                    cpc.Title.Text = "Customize Texas Tea";
                    cpc.TeaMenu();
                }
            }
        }
Beispiel #11
0
        /// <summary>
        /// Determines what happens when the selected object is changed.
        /// </summary>
        /// <param name="sender">The ListBox that is being updated.</param>
        /// <param name="e">The SelectionChagedEventArgs of the selection change.</param>
        public void SelectionChange(object sender, SelectionChangedEventArgs e)
        {
            ListBox buff = sender as ListBox;

            if (selectedItem != null)
            {
                if (uxListBox != buff)
                {
                    uxListBox.SelectedItem = null;
                }
            }

            uxListBox = buff;

            if (e.AddedItems.Count > 0)
            {
                selectedItem = e.AddedItems[0] as IOrderItem;
            }

            if (selectedItem != lastSelectedItem)
            {
                if (selectedItem is Entree entree)
                {
                    //Console.WriteLine("Selected an entree");
                    CustomizeEntree page = new CustomizeEntree();
                    page.InitPage(entree, new MenuCategorySelection());
                    page.SetEditedEntree(entree);
                    MainWindow window = Window.GetWindow(this) as MainWindow;
                    window.GetCurrentPage().NavigationService.Navigate(page);
                }
                else if (selectedItem is Side side)
                {
                    //Console.WriteLine("Selected a side");
                    SideSelection page = new SideSelection();
                    page.SetEditedSide(side, new MenuCategorySelection());
                    MainWindow window = Window.GetWindow(this) as MainWindow;
                    window.GetCurrentPage().NavigationService.Navigate(page);
                }
                else if (selectedItem is Drink drink)
                {
                    //Console.WriteLine("Selected a drink");
                    DrinkSelection page = new DrinkSelection();
                    page.SetReturnPage(new MenuCategorySelection());
                    page.SetEditedDrink(drink);
                    MainWindow window = Window.GetWindow(this) as MainWindow;
                    window.GetCurrentPage().NavigationService.Navigate(page);
                }
                else if (selectedItem is CretaceousCombo combo)
                {
                    //Console.WriteLine("Selected a combo");
                    CustomizeCombo page = new CustomizeCombo();
                    page.SetReturnPage(new MenuCategorySelection());
                    Console.WriteLine("Combo size: " + combo.Size);
                    page.SetCombo(combo);
                    MainWindow window = Window.GetWindow(this) as MainWindow;
                    window.GetCurrentPage().NavigationService.Navigate(page);
                }
            }

            lastSelectedItem = selectedItem;
        }