void ComboButtonClick(object sender, RoutedEventArgs e)
 {
     if (comboButton.Content as String == "Combo")
     {
         comboButton.Content = "Add Combo";
         order.IsCombo       = true;
         combo = new Combo();
     }
     else
     {
         comboButton.Content = "Combo";
         order.Add(combo);
         order.IsCombo = false;
         combo         = null;
     }
 }
        /// <summary>
        /// event handler for the tyrannotea drink item that asks if we want to make it sweet and if we want to add lemon
        /// </summary>
        /// <param name="sender">reference to the control</param>
        /// <param name="args">contains the event data</param>
        private void SelectTyrannotea(object sender, RoutedEventArgs args)
        {
            if (combo != null)
            {
                order       = DataContext as Order;
                drink       = new Tyrannotea();
                tea         = (Tyrannotea)drink;
                combo.Drink = tea;
                SpecialButtons.Children.Clear();
                sweet         = new Button();
                sweet.Height  = 100;
                sweet.Width   = 100;
                sweet.Content = "Sweet";
                SpecialButtons.Children.Add(sweet);
                sweet.Click += new RoutedEventHandler(OnAddSweet);

                lemon         = new Button();
                lemon.Height  = 100;
                lemon.Width   = 100;
                lemon.Content = "AddLemon";
                SpecialButtons.Children.Add(lemon);
                lemon.Click += new RoutedEventHandler(OnAddLemonTea);
            }
            else
            {
                order = DataContext as Order;
                drink = new Tyrannotea();
                tea   = (Tyrannotea)drink;
                SpecialButtons.Children.Clear();
                sweet         = new Button();
                sweet.Height  = 100;
                sweet.Width   = 100;
                sweet.Content = "Sweet";
                SpecialButtons.Children.Add(sweet);
                sweet.Click += new RoutedEventHandler(OnAddSweet);

                lemon         = new Button();
                lemon.Height  = 100;
                lemon.Width   = 100;
                lemon.Content = "AddLemon";
                SpecialButtons.Children.Add(lemon);
                lemon.Click += new RoutedEventHandler(OnAddLemonTea);

                order.Add(tea);
            }
        }
示例#3
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());
             */
        }
        /// <summary>
        /// Click ThugsTBone
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void ClickThugsTBone(object sender, RoutedEventArgs e)
        {
            ThugsTBone a = new ThugsTBone();

            Orders.Add(a);
            listviewload();
        }
        /// <summary>
        /// Event for clicking the cowpoke chili button
        /// </summary>
        /// <param name="sender">sender</param>
        /// <param name="e">e</param>
        private void AddCowpokeChiliButton_Click(object sender, RoutedEventArgs e)
        {
            var orderControl = this.FindAncestor <OrderControl>();

            if (DataContext is Order order)
            {
                var item   = new CowpokeChili();
                var screen = new CowpokeChiliCustomization();
                screen.DataContext = item;
                order.Add(item);
                orderControl?.SwapScreen(screen);
            }
        }
示例#6
0
 /// <summary>
 /// Adds an item to the order
 /// </summary>
 /// <param name="item"></param>
 public void AddItem(IOrderItem item)
 {
     order.Add(item);
 }
 /// <summary>
 /// adds item to order
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void addBriarheartBurger(object sender, RoutedEventArgs e)
 {
     curentOrder.Add(new BriarheartBurger());
 }