Exemple #1
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;
            }
        }
Exemple #2
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();
            }
        }