Exemple #1
0
 private void Confirm_Order(object sender, RoutedEventArgs e)
 {
     if (Switcher.GetConfirmCheckout().VerifyNo.Text == "1234")
     {
         Run_Confirm_Order(sender, e);
     }
     else
     {
         MessageBox.Show("Wrong Verification Number Input!");
     }
 }
        private void Open_Finalized(object sender, RoutedEventArgs e)
        {
            if (MainWindow.GlobalSubtotal != 0)
            {
                //Check if Order has Alcohol
                foreach (CheckoutItem child in Switcher.GetCheckout().CheckoutItemList.Children)
                {
                    if (child.checkout_item_alcohol == true)
                    {
                        MainWindow.hasAlcohol = true;
                    }
                }

                //Order has Alcohol
                if (MainWindow.hasAlcohol == true)
                {
                    Switcher.GetConfirmCheckout().OrderConfirmVerify.Text = "Enter Verification No. :";
                    Switcher.GetConfirmCheckout().VerifyNo.Visibility = Visibility.Visible;
                    Switcher.GetConfirmCheckout().VerifyBorder.Visibility = Visibility.Visible;
                    Switcher.GetConfirmCheckout().VerifyNo.Text = "";
                }
                else
                {
                    Switcher.GetConfirmCheckout().OrderConfirmVerify.Text = "";
                    Switcher.GetConfirmCheckout().VerifyNo.Visibility = Visibility.Hidden;
                    Switcher.GetConfirmCheckout().VerifyBorder.Visibility = Visibility.Hidden;
                    Switcher.GetConfirmCheckout().VerifyNo.Text = "1234";
                }

                Window window = new Window
                {
                    Title   = "Confirm Checkout",
                    Content = Switcher.GetConfirmCheckout(),
                    Height  = 400,
                    Width   = 300
                };

                MainWindow.hasAlcohol = false;

                window.ShowDialog();
            }
            else
            {
                MessageBox.Show("Please order select our food items!");
            }
        }