Esempio n. 1
0
 public void btn_nav_Click(object sender, RoutedEventArgs e)
 {
     if (btn_specials.IsFocused)
     {
         Switcher.Switch(new Page_Specials());
         switch_btn_bg(btn_specials, "specials");
         //btn_specials.Background = new ImageBrush(new BitmapImage(new Uri("../../Resources/Images/btn_specials_down_bg.png", UriKind.Relative)));
     }
     else if (btn_drinks.IsFocused)
     {
         Switcher.Switch(new Page_Drinks());
         switch_btn_bg(btn_drinks, "drinks");
     }
     else if (btn_food.IsFocused)
     {
         Switcher.Switch(new Page_Food());
         switch_btn_bg(btn_food, "food");
     }
     else if (btn_help.IsFocused)
     {
         GrayedOutWindow gw = new GrayedOutWindow();
         HelpScreen      hs = new HelpScreen();
         gw.Show();
         hs.ShowDialog();
         gw.Close();
     }
 }
Esempio n. 2
0
        private void btn_payNow_click(object sender, RoutedEventArgs e)
        {
            GrayedOutWindow gw = new GrayedOutWindow();
            PaymentScreen   ps = new PaymentScreen();

            gw.Show();
            ps.ShowDialog();
            gw.Close();
        }
        private void btn_addTab_Click(object sender, RoutedEventArgs e)
        {
            GrayedOutWindow gw = new GrayedOutWindow();
            AddTab          a  = new AddTab(ms, this);

            gw.Show();
            a.ShowDialog();
            gw.Close();
        }
Esempio n. 4
0
        private void btn_submitQueue_Click(object sender, RoutedEventArgs e)
        {
            lbl_submitQueue.IsEnabled = false;
            MainScreen ms = Switcher.pageSwitcher;

            ms.focusedTab.PlaceOrder();
            ms.focusedTab.ClearTray();

            lbl_queueTotal.Content = "Total: $0.00";
            GrayedOutWindow gw = new GrayedOutWindow();

            gw.Show();
            OrderPlacedScreen ops = new OrderPlacedScreen(1000);

            gw.Close();
            showQueue(false);
            btn_payNow.IsEnabled = true;
        }
Esempio n. 5
0
        private void btn_changeTab_Click(object sender, RoutedEventArgs e)
        {
            Button clickedBtn = (Button)sender;

            btn = clickedBtn;
            lbl_submitQueue.IsEnabled = false;
            if (!focusedTab.OrderTrayEmpty())
            {
                GrayedOutWindow gw = new GrayedOutWindow();

                LeavingTabScreen warningScreen = new LeavingTabScreen(this);
                gw.Show();
                warningScreen.ShowDialog();
                gw.Close();
            }
            if (wantToLeave || focusedTab.OrderTrayEmpty())
            {
                foreach (UserTab ut in allTabs.GetTabs())
                {
                    if (ut.GetTabButton().IsFocused)
                    {
                        Storyboard sb = Resources["sbShowTab"] as Storyboard;
                        sb.Begin(btn);

                        focusedTab.ClearTray();
                        lbl_queueTotal.Content  = "Total: $0.00";
                        lbl_tabTotal.Content    = "Total: $" + ut.amountOwing.ToString("F");
                        lbl_tabName.Content     = ut.ToString();
                        grid_summary.Background = ut.GetTabButton().Background;
                        this.focusedTab         = ut;
                    }
                }
            }

            if (focusedTab.amountOwing > 0)
            {
                btn_payNow.IsEnabled = true;
            }
            else
            {
                btn_payNow.IsEnabled = false;
            }
        }
        private void btn_viewItem_Click(object sender, RoutedEventArgs e)
        {
            GrayedOutWindow gw = new GrayedOutWindow();

            gw.Show();
            ExamineItemScreen eis = new ExamineItemScreen(mi);

            //update name, price, description and image of template
            string name1 = Regex.Replace(this.name, @"\n", "");

            eis.lbl_itemName.Content  = name1;
            eis.lbl_itemPrice.Content = this.price;
            eis.tb_description.Text   = this.getDesription();
            eis.image.Source          = background.ImageSource;

            if (this.cbOptions != null)
            {
                for (int i = 1; i < this.cbOptions.Count; i++)
                {
                    eis.dd_sides.Items.Add(cbOptions[i]);
                }
                eis.dd_sides.SelectedIndex = 0;
                // the first item in the list is the label name
                eis.lbl_sides.Content    = cbOptions[0];
                eis.lbl_sides.Visibility = Visibility.Visible;
                eis.dd_sides.Visibility  = Visibility.Visible;
            }

            if (this.isFood)
            {
                eis.lbl_notes.Visibility    = Visibility.Visible;
                eis.txtbox_notes.Visibility = Visibility.Visible;
            }

            //change overlay dimensions
            eis.Height = SystemParameters.PrimaryScreenHeight / 2;
            eis.Width  = SystemParameters.PrimaryScreenWidth / 2;
            eis.ShowDialog();
            gw.Close();
        }
Esempio n. 7
0
        private void btn_addTab_Click(object sender, RoutedEventArgs e)
        {
            lbl_submitQueue.IsEnabled = false;
            if (allTabs.GetTabs().Count < 8)
            {
                if (!focusedTab.OrderTrayEmpty())
                {
                    GrayedOutWindow  gw            = new GrayedOutWindow();
                    LeavingTabScreen warningScreen = new LeavingTabScreen(this);
                    gw.Show();
                    warningScreen.ShowDialog();
                    gw.Close();
                }
                if (wantToLeave || focusedTab.OrderTrayEmpty())
                {
                    GrayedOutWindow gw = new GrayedOutWindow();

                    focusedTab.ClearTray();
                    focusedTab.LoadTray();
                    AddTab at = new AddTab(this, null);
                    gw.Show();
                    at.ShowDialog();
                    gw.Close();
                }
                btn_payNow.IsEnabled = false;
            }
            else
            {
                GrayedOutWindow gw = new GrayedOutWindow();

                Max8TabsWarning mxWarning = new Max8TabsWarning();
                gw.Show();

                mxWarning.ShowDialog();
                gw.Close();
            }
        }
Esempio n. 8
0
        private void btn_exit_Click(object sender, RoutedEventArgs e)
        {
            bool allEmpty = true;

            foreach (UserTab ut in allTabs.GetTabs())
            {
                if (ut.amountOwing != 0)
                {
                    allEmpty = false;
                }
            }
            if (allEmpty)
            {
                GrayedOutWindow gw = new GrayedOutWindow();
                ExitScreen      es = new ExitScreen(this);

                es.textBlock.Text  = "You are about to return to the main menu. This will close all your open tabs.\nAre you sure you want to continue?";
                es.btn_yes.Content = "Yes";
                es.btn_yes.Width   = 160;
                es.btn_no.Content  = "No";
                es.btn_no.Width    = 160;
                es.btn_no.Margin   = new Thickness(210, 0, 0, 52);

                gw.Show();
                es.ShowDialog();
                gw.Close();
            }
            else
            {
                GrayedOutWindow gw = new GrayedOutWindow();
                ExitScreen      es = new ExitScreen(this);
                gw.Show();
                es.ShowDialog();
                gw.Close();
            }
        }