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();
        }
示例#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();
            }
        }
示例#3
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();
            }
        }